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

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -14,3 +14,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 @@ -19,6 +19,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
from app.pipeline.competency_extraction_pipeline import CompetencyExtractionPipeline

router = APIRouter(prefix="/api/v1/pipelines", tags=["pipelines"])
Expand Down Expand Up @@ -127,9 +128,51 @@ def run_competency_extraction_pipeline(
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