Skip to content

Commit

Permalink
Merge branch 'main' into track-token-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjoham committed Oct 11, 2024
2 parents 74b1239 + 9e19d18 commit 6bcb002
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 15 deletions.
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
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)
24 changes: 12 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
black==24.8.0
fastapi==0.112.2
fastapi==0.115.0
flake8==7.1.1
langchain==0.2.14
ollama==0.3.1
openai==1.42.0
pre-commit==3.8.0
langchain==0.3.2
ollama==0.3.3
openai==1.51.0
pre-commit==4.0.0
psutil==6.0.0
pydantic==2.8.2
PyMuPDF==1.24.9
pytz==2024.1
pydantic==2.9.2
PyMuPDF==1.24.11
pytz==2024.2
PyYAML==6.0.2
requests==2.32.3
sentry-sdk[starlette,fastapi,openai]==2.13.0
unstructured==0.15.7
uvicorn==0.30.6
weaviate-client==4.7.1
sentry-sdk[starlette,fastapi,openai]==2.15.0
unstructured==0.15.13
uvicorn==0.31.0
weaviate-client==4.8.1

0 comments on commit 6bcb002

Please sign in to comment.