Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastAPI: Support new settings system #149

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/domain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
)
from .pyris_message import PyrisMessage, IrisMessageRole
from app.domain.data import image_message_content_dto
from app.domain.feature_dto import FeatureDTO
Hialus marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions app/domain/feature_dto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from pydantic import BaseModel


class FeatureDTO(BaseModel):
id: str
name: str
description: str
49 changes: 46 additions & 3 deletions app/web/routers/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from app.pipeline.chat.course_chat_pipeline import CourseChatPipeline
from app.pipeline.chat.exercise_chat_pipeline import ExerciseChatPipeline
from app.dependencies import TokenValidator
from app.domain import FeatureDTO

router = APIRouter(prefix="/api/v1/pipelines", tags=["pipelines"])
logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -86,9 +87,51 @@ def run_course_chat_pipeline(variant: str, dto: CourseChatPipelineExecutionDTO):
thread.start()


@router.get("/{feature}")
@router.get("/{feature}/variants")
def get_pipeline(feature: str):
"""
Get the pipeline for the given feature.
Get the pipeline variants for the given feature.
"""
return Response(status_code=status.HTTP_501_NOT_IMPLEMENTED)
match feature:
case "CHAT":
return [
FeatureDTO(
id="default",
name="Default Variant",
description="Default chat variant.",
)
]
case "PROGRAMMING_EXERCISE_CHAT":
return [
FeatureDTO(
id="default",
name="Default Variant",
description="Default programming exercise chat variant.",
)
]
case "COURSE_CHAT":
return [
FeatureDTO(
id="default",
name="Default Variant",
description="Default course chat variant.",
)
]
case "COMPETENCY_GENERATION":
return [
FeatureDTO(
id="default",
name="Default Variant",
description="Default competency generation variant.",
)
]
case "LECTURE_INGESTION":
return [
FeatureDTO(
id="default",
name="Default Variant",
description="Default lecture ingestion variant.",
)
]
case _:
return Response(status_code=status.HTTP_400_BAD_REQUEST)
Hialus marked this conversation as resolved.
Show resolved Hide resolved
Loading