Refactor and update structure #20

Merged
Berack96 merged 22 commits from 16-refactoring-e-sanity-check into main 2025-10-08 16:21:10 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit ac356c3753 - Show all commits

View File

@@ -90,7 +90,7 @@ class AppModels(Enum):
copilot-pull-request-reviewer[bot] commented 2025-10-05 22:06:00 +02:00 (Migrated from github.com)
Review

Using mutable default argument 'tools: list[Toolkit] = []' can lead to unexpected behavior. Use 'tools: list[Toolkit] | None = None' and handle None inside the method.

Using mutable default argument 'tools: list[Toolkit] = []' can lead to unexpected behavior. Use 'tools: list[Toolkit] | None = None' and handle None inside the method.
raise ValueError(f"Modello non supportato: {self}")
def get_agent(self, instructions: str, name: str = "", output: BaseModel | None = None, tools: list[Toolkit] = []) -> Agent:
def get_agent(self, instructions: str, name: str = "", output_schema: type[BaseModel] | None = None, tools: list[Toolkit] = []) -> Agent:
"""
Costruisce un agente con il modello e le istruzioni specificate.
Args:
@@ -106,5 +106,5 @@ class AppModels(Enum):
retries=2,
tools=tools,
delay_between_retries=5, # seconds
output_schema=output.__class__ if output else None # se si usa uno schema di output, lo si passa qui
output_schema=output_schema
)

View File

@@ -30,7 +30,7 @@ class Pipeline:
model = self.available_models[index]
self.predictor = model.get_agent(
PREDICTOR_INSTRUCTIONS,
output=PredictorOutput, # type: ignore
output_schema=PredictorOutput,
)
def choose_style(self, index: int):