diff --git a/modules/text/module_text_llm/module_text_llm/__init__.py b/modules/text/module_text_llm/module_text_llm/__init__.py index 2f04ff66..31c8c578 100644 --- a/modules/text/module_text_llm/module_text_llm/__init__.py +++ b/modules/text/module_text_llm/module_text_llm/__init__.py @@ -1,4 +1,3 @@ import dotenv -# Load environment variables from .env file (for local development) -dotenv.load_dotenv(override=True) \ No newline at end of file +dotenv.load_dotenv(override=True) diff --git a/modules/text/module_text_llm/module_text_llm/approach_controller.py b/modules/text/module_text_llm/module_text_llm/approach_controller.py index 25329b8e..69a5cc69 100644 --- a/modules/text/module_text_llm/module_text_llm/approach_controller.py +++ b/modules/text/module_text_llm/module_text_llm/approach_controller.py @@ -1,16 +1,15 @@ - from typing import List from athena.text import Exercise, Submission, Feedback from module_text_llm.basic_approach import BasicApproachConfig -from module_text_llm.chain_of_thought_approach import ChainOfThoughtConfig +from module_text_llm.chain_of_thought_approach import ChainOfThoughtConfig from module_text_llm.approach_config import ApproachConfig from module_text_llm.basic_approach.generate_suggestions import generate_suggestions as generate_suggestions_basic from module_text_llm.chain_of_thought_approach.generate_suggestions import generate_suggestions as generate_cot_suggestions async def generate_suggestions(exercise: Exercise, submission: Submission, config: ApproachConfig, debug: bool) -> List[Feedback]: - if(isinstance(config, BasicApproachConfig)): + if isinstance(config, BasicApproachConfig): return await generate_suggestions_basic(exercise, submission, config, debug) - elif(isinstance(config, ChainOfThoughtConfig)): + if isinstance(config, ChainOfThoughtConfig): return await generate_cot_suggestions(exercise, submission, config, debug) - + raise ValueError("Unsupported config type provided.") diff --git a/modules/text/module_text_llm/module_text_llm/basic_approach/__init__.py b/modules/text/module_text_llm/module_text_llm/basic_approach/__init__.py index 37a674e7..cc8c8e56 100644 --- a/modules/text/module_text_llm/module_text_llm/basic_approach/__init__.py +++ b/modules/text/module_text_llm/module_text_llm/basic_approach/__init__.py @@ -8,4 +8,4 @@ class BasicApproachConfig(ApproachConfig): type: Literal['basic'] = 'basic' generate_suggestions_prompt: GenerateSuggestionsPrompt = Field(default=GenerateSuggestionsPrompt()) - + \ No newline at end of file diff --git a/modules/text/module_text_llm/module_text_llm/basic_approach/generate_suggestions.py b/modules/text/module_text_llm/module_text_llm/basic_approach/generate_suggestions.py index b9e8694c..6cdf5b36 100644 --- a/modules/text/module_text_llm/module_text_llm/basic_approach/generate_suggestions.py +++ b/modules/text/module_text_llm/module_text_llm/basic_approach/generate_suggestions.py @@ -8,7 +8,6 @@ check_prompt_length_and_omit_features_if_necessary, num_tokens_from_prompt, ) -from athena.text import Exercise, Submission, Feedback from llm_core.utils.predict_and_parse import predict_and_parse from module_text_llm.config import BasicApproachConfig @@ -94,4 +93,4 @@ async def generate_suggestions(exercise: Exercise, submission: Submission, confi meta={} )) - return feedbacks \ No newline at end of file + return feedbacks diff --git a/modules/text/module_text_llm/module_text_llm/basic_approach/prompt_generate_suggestions.py b/modules/text/module_text_llm/module_text_llm/basic_approach/prompt_generate_suggestions.py index 4b23137d..d3d195b4 100644 --- a/modules/text/module_text_llm/module_text_llm/basic_approach/prompt_generate_suggestions.py +++ b/modules/text/module_text_llm/module_text_llm/basic_approach/prompt_generate_suggestions.py @@ -1,6 +1,5 @@ from pydantic import Field, BaseModel from typing import List, Optional -from pydantic import BaseModel, Field system_message = """\ You are an AI tutor for text assessment at a prestigious university. @@ -62,4 +61,4 @@ class AssessmentModel(BaseModel): """Collection of feedbacks making up an assessment""" feedbacks: List[FeedbackModel] = Field(description="Assessment feedbacks") - + \ No newline at end of file