Skip to content

Athena: In Context Learning with weaviate DB #97

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import httpx
from pydantic import BaseModel, Field

from typing import Literal
from .modules_endpoint import get_modules
from assessment_module_manager.app import app
from assessment_module_manager.logger import logger
Expand Down Expand Up @@ -29,7 +29,7 @@ class HealthResponse(BaseModel):
and whether all the modules are healthy (i.e. reachable).
Additional information about the modules is also provided.
"""
status: str = Field(const=True, default="ok", example="ok")
status: str = Field(Literal=True, default="ok", example="ok")
modules: dict = Field(
example=[
{
Expand Down
2 changes: 1 addition & 1 deletion athena/athena/athena/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class SubmissionSelectorRequest(BaseModel):
class Config:
# Allow camelCase field names in the API (converted to snake_case)
alias_generator = to_camel
allow_population_by_field_name = True
populate_by_name = True

@app.post("/select_submission", responses=module_responses)
@authenticated
Expand Down
2 changes: 1 addition & 1 deletion athena/athena/athena/schemas/exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class Exercise(Schema, ABC):
meta: dict = Field({}, example={"internal_id": "5"})

class Config:
orm_mode = True
from_attributes = True
2 changes: 1 addition & 1 deletion athena/athena/athena/schemas/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def to_model(self, is_suggestion: bool = False, lms_id: Optional[int] = None, lm
return type(self).get_model_class()(**self.dict(), is_suggestion=is_suggestion, lms_id=lms_id, lms_url=lms_url)

class Config:
orm_mode = True
from_attributes = True
4 changes: 2 additions & 2 deletions athena/athena/athena/schemas/modeling_exercise.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, Literal
from pydantic import Field

from .exercise_type import ExerciseType
Expand All @@ -8,6 +8,6 @@
class ModelingExercise(Exercise):
"""A modeling exercise that can be solved by students, enhanced with metadata."""

type: ExerciseType = Field(ExerciseType.modeling, const=True)
type: ExerciseType = Field(ExerciseType.modeling, Literal=True)

example_solution: Optional[str] = Field(None, description="An example solution to the exercise.")
4 changes: 2 additions & 2 deletions athena/athena/athena/schemas/programming_exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from athena.helpers.programming.code_repository import get_repository_zip, get_repository
from .exercise_type import ExerciseType
from .exercise import Exercise

from typing import Literal

class ProgrammingExercise(Exercise):
"""A programming exercise that can be solved by students, enhanced with metadata."""

type: ExerciseType = Field(ExerciseType.programming, const=True)
type: ExerciseType = Field(ExerciseType.programming, Literal=True)

programming_language: str = Field(description="The programming language that is used for this exercise.", example="java")
solution_repository_uri: AnyUrl = Field(description="URL to the solution git repository, which contains the "
Expand Down
2 changes: 1 addition & 1 deletion athena/athena/athena/schemas/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ def to_model(self):
class Config:
# Allow camelCase field names in the API (converted to snake_case)
alias_generator = to_camel
allow_population_by_field_name = True
populate_by_name = True
2 changes: 1 addition & 1 deletion athena/athena/athena/schemas/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ class Submission(Schema, ABC):
meta: dict = Field({}, example={})

class Config:
orm_mode = True
from_attributes = True
4 changes: 2 additions & 2 deletions athena/athena/athena/schemas/text_exercise.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, Literal
from pydantic import Field

from .exercise_type import ExerciseType
Expand All @@ -8,6 +8,6 @@
class TextExercise(Exercise):
"""A text exercise that can be solved by students, enhanced with metadata."""

type: ExerciseType = Field(ExerciseType.text, const=True)
type: ExerciseType = Field(ExerciseType.text, Literal=True)

example_solution: Optional[str] = Field(None, description="An example solution to the exercise.")
25 changes: 13 additions & 12 deletions athena/athena/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion athena/athena/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MIT"
python = "3.11.*"
fastapi = "^0.109.1"
uvicorn = "^0.23.0"
httpx = "^0.24.1"
httpx = "^0.26.0"
gitpython = "^3.1.41"
sqlalchemy = {extras = ["mypy"], version = "^2.0.21"}
psycopg2 = "^2.9.9"
Expand Down
Loading