Skip to content

Commit

Permalink
Merge branch 'develop' into feature/modeling/caching
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonWehrhahn authored Jan 10, 2025
2 parents 672f762 + 7082cec commit ce29d4a
Show file tree
Hide file tree
Showing 39 changed files with 2,777 additions and 2,753 deletions.
2 changes: 1 addition & 1 deletion athena/athena/models/db_modeling_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class DBModelingFeedback(DBFeedback, Base):
__tablename__ = "modeling_feedbacks"

element_ids: Optional[list[str]] = Column(JSON) # type: ignore
element_ids: Optional[list[str]] = Column(JSON) # type: ignore # Todo: Remove after adding migrations to athena
reference: Optional[str] = Column(String, nullable=True) # type: ignore

exercise_id = Column(BigIntegerWithAutoincrement, ForeignKey("modeling_exercises.id", ondelete="CASCADE"), index=True)
Expand Down
2 changes: 1 addition & 1 deletion athena/athena/schemas/modeling_feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
class ModelingFeedback(Feedback):
"""Feedback on a modeling exercise."""

element_ids: Optional[List[str]] = Field([], description="referenced diagram element IDs", example=["id_1"])
element_ids: Optional[List[str]] = Field([], description="referenced diagram element IDs", example=["id_1"]) # Todo: Remove after adding migrations to athena
reference: Optional[str] = Field(None, description="reference to the diagram element", example="ClassAttribute:5a337bdf-da00-4bd0-a6f0-78ba5b84330e")
2 changes: 0 additions & 2 deletions llm_core/llm_core/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
types.append(openai_config.OpenAIModelConfig)
if default_model_name in openai_config.available_models:
DefaultModelConfig = openai_config.OpenAIModelConfig
if "openai_gpt-4o-mini" in openai_config.available_models:
MiniModelConfig = openai_config.OpenAIModelConfig(model_name="openai_gpt-4o-mini",max_tokens=3000, temperature=0,top_p=0.9,presence_penalty=0,frequency_penalty=0)
if evaluation_model_name in openai_config.available_models:
evaluation_model = openai_config.available_models[evaluation_model_name]
except AttributeError:
Expand Down
1,690 changes: 855 additions & 835 deletions llm_core/poetry.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions llm_core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ athena = {path = "../athena", develop = true}
langsmith = ">=0.1.0,<0.2.0"
gitpython = "3.1.41"
langchain = "0.2.15"
langchain-community="0.2.10"
langchain-community="0.2.15"
langchain-openai = "0.1.23"
nltk = "3.8.1"
nltk = "3.9.1"
openai = "1.51.1"
python-dotenv = "1.0.0"
tiktoken = "0.7.0"
Expand All @@ -26,4 +26,4 @@ prospector = "^1.10.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ async def suggest_feedback(exercise: Exercise, submission: Submission, is_graded


if __name__ == "__main__":
nltk.download("punkt")
nltk.download("punkt_tab")
tiktoken.get_encoding("cl100k_base")
app.start()
1,090 changes: 540 additions & 550 deletions modules/modeling/module_modeling_llm/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/modeling/module_modeling_llm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ athena = { path = "../../../athena", develop = true }
#athena = { git = "https://github.com/ls1intum/Athena.git", rev = "d9ff3bd", subdirectory = "athena"}
llm_core = { path = "../../../llm_core", develop = true }
python-dotenv = "1.0.0"
nltk = "3.8.1"
nltk = "3.9.1"
gitpython = "3.1.41"
tiktoken = "0.7.0"
langsmith = "0.1.106"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ async def generate_suggestions_by_file(
chat_prompt=chat_prompt,
prompt_input=prompt_input,
pydantic_object=AssessmentModel,
use_function_calling=True,
tags=[
f"exercise-{exercise.id}",
f"submission-{submission.id}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ImprovementModel(BaseModel):
feedbacks: Sequence[FeedbackModel] = Field(description="Improvement feedbacks")

class Config:
title = "Improvement"
title = "ImprovementModel"


# pylint: disable=too-many-locals
Expand Down Expand Up @@ -219,6 +219,7 @@ async def generate_suggestions_by_file(
chat_prompt=chat_prompt,
prompt_input=prompt_input,
pydantic_object=ImprovementModel,
use_function_calling=True,
tags=[
f"exercise-{exercise.id}",
f"submission-{submission.id}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async def generate_summary_by_file(
chat_prompt=chat_prompt,
prompt_input=prompt_input,
pydantic_object=FileDescription,
use_function_calling=True,
tags=[
f"exercise-{exercise.id}",
f"submission-{submission.id}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ async def split_grading_instructions_by_file(
chat_prompt=chat_prompt,
prompt_input=prompt_input,
pydantic_object=SplitGradingInstructions,
use_function_calling=True,
tags=[
f"exercise-{exercise.id}",
f"submission-{submission.id}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ async def split_problem_statement_by_file(
chat_prompt=chat_prompt,
prompt_input=prompt_input,
pydantic_object=SplitProblemStatement,
use_function_calling=True,
tags=[
f"exercise-{exercise.id}",
f"submission-{submission.id}",
Expand Down
Loading

0 comments on commit ce29d4a

Please sign in to comment.