Skip to content
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

fix linting #366

Merged
merged 3 commits into from
Dec 2, 2024
Merged
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
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")

Loading