Skip to content

Commit

Permalink
Merge branch 'develop' into feature/modeling/reference
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonWehrhahn authored Dec 3, 2024
2 parents 2a169b8 + bbb2bb0 commit b6af29a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
3 changes: 1 addition & 2 deletions modules/text/module_text_llm/module_text_llm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import dotenv

# Load environment variables from .env file (for local development)
dotenv.load_dotenv(override=True)
dotenv.load_dotenv(override=True)
Original file line number Diff line number Diff line change
@@ -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.")
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
class BasicApproachConfig(ApproachConfig):
type: Literal['basic'] = 'basic'
generate_suggestions_prompt: GenerateSuggestionsPrompt = Field(default=GenerateSuggestionsPrompt())

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -94,4 +93,4 @@ async def generate_suggestions(exercise: Exercise, submission: Submission, confi
meta={}
))

return feedbacks
return feedbacks
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -62,4 +61,4 @@ class AssessmentModel(BaseModel):
"""Collection of feedbacks making up an assessment"""

feedbacks: List[FeedbackModel] = Field(description="Assessment feedbacks")

0 comments on commit b6af29a

Please sign in to comment.