copilot fixes
This commit is contained in:
@@ -45,12 +45,14 @@ class PipelineInputs:
|
|||||||
"""
|
"""
|
||||||
Sceglie il modello LLM da usare per il Team Leader.
|
Sceglie il modello LLM da usare per il Team Leader.
|
||||||
"""
|
"""
|
||||||
|
assert index >= 0 and index < len(self.configs.models.all_models), "Index out of range for models list."
|
||||||
self.team_leader_model = self.configs.models.all_models[index]
|
self.team_leader_model = self.configs.models.all_models[index]
|
||||||
|
|
||||||
def choose_team(self, index: int):
|
def choose_team(self, index: int):
|
||||||
"""
|
"""
|
||||||
Sceglie il modello LLM da usare per il Team.
|
Sceglie il modello LLM da usare per il Team.
|
||||||
"""
|
"""
|
||||||
|
assert index >= 0 and index < len(self.configs.models.all_models), "Index out of range for models list."
|
||||||
self.team_model = self.configs.models.all_models[index]
|
self.team_model = self.configs.models.all_models[index]
|
||||||
|
|
||||||
def choose_strategy(self, index: int):
|
def choose_strategy(self, index: int):
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ class Pipeline:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, inputs: PipelineInputs):
|
def __init__(self, inputs: PipelineInputs):
|
||||||
|
"""
|
||||||
|
Inizializza la pipeline con gli input forniti.
|
||||||
|
Args:
|
||||||
|
inputs: istanza di PipelineInputs contenente le configurazioni e i parametri della pipeline.
|
||||||
|
"""
|
||||||
self.inputs = inputs
|
self.inputs = inputs
|
||||||
|
|
||||||
def interact(self, listeners: list[tuple[PipelineEvent, Callable[[Any], None]]] = []) -> str:
|
def interact(self, listeners: list[tuple[PipelineEvent, Callable[[Any], None]]] = []) -> str:
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Task(TypedDict):
|
|||||||
class PlanMemoryTool(Toolkit):
|
class PlanMemoryTool(Toolkit):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.tasks: list[Task] = []
|
self.tasks: list[Task] = []
|
||||||
Toolkit.__init__(self, # type: ignore
|
Toolkit.__init__(self, # type: ignore[call-arg]
|
||||||
instructions="This tool manages an execution plan. Add tasks, get the next pending task, update a task's status (completed, failed) and result, or list all tasks.",
|
instructions="This tool manages an execution plan. Add tasks, get the next pending task, update a task's status (completed, failed) and result, or list all tasks.",
|
||||||
tools=[
|
tools=[
|
||||||
self.add_tasks,
|
self.add_tasks,
|
||||||
|
|||||||
@@ -14,5 +14,5 @@ GOAL: check if the query is crypto-related
|
|||||||
|
|
||||||
3) Ouput the result:
|
3) Ouput the result:
|
||||||
- if is crypto related then output the query
|
- if is crypto related then output the query
|
||||||
- if is not crypto related, then output why is not releated in a brief message
|
- if is not crypto related, then output why is not related in a brief message
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class TestQueryCheckAgent:
|
|||||||
self.agent = self.model.get_agent(QUERY_CHECK_INSTRUCTIONS, output_schema=QueryOutputs)
|
self.agent = self.model.get_agent(QUERY_CHECK_INSTRUCTIONS, output_schema=QueryOutputs)
|
||||||
|
|
||||||
def test_query_not_ok(self):
|
def test_query_not_ok(self):
|
||||||
response = self.agent.run("Is the sky blue?") #type: ignore
|
response = self.agent.run("Is the sky blue?") # type: ignore
|
||||||
assert response is not None
|
assert response is not None
|
||||||
assert response.content is not None
|
assert response.content is not None
|
||||||
content = response.content
|
content = response.content
|
||||||
@@ -20,7 +20,7 @@ class TestQueryCheckAgent:
|
|||||||
assert content.is_crypto == False
|
assert content.is_crypto == False
|
||||||
|
|
||||||
def test_query_not_ok2(self):
|
def test_query_not_ok2(self):
|
||||||
response = self.agent.run("What is the capital of France?") #type: ignore
|
response = self.agent.run("What is the capital of France?") # type: ignore
|
||||||
assert response is not None
|
assert response is not None
|
||||||
assert response.content is not None
|
assert response.content is not None
|
||||||
content = response.content
|
content = response.content
|
||||||
@@ -28,7 +28,7 @@ class TestQueryCheckAgent:
|
|||||||
assert content.is_crypto == False
|
assert content.is_crypto == False
|
||||||
|
|
||||||
def test_query_ok(self):
|
def test_query_ok(self):
|
||||||
response = self.agent.run("Bitcoin") #type: ignore
|
response = self.agent.run("Bitcoin") # type: ignore
|
||||||
assert response is not None
|
assert response is not None
|
||||||
assert response.content is not None
|
assert response.content is not None
|
||||||
content = response.content
|
content = response.content
|
||||||
@@ -36,7 +36,7 @@ class TestQueryCheckAgent:
|
|||||||
assert content.is_crypto == True
|
assert content.is_crypto == True
|
||||||
|
|
||||||
def test_query_ok2(self):
|
def test_query_ok2(self):
|
||||||
response = self.agent.run("Ha senso investire in Ethereum?") #type: ignore
|
response = self.agent.run("Ha senso investire in Ethereum?") # type: ignore
|
||||||
assert response is not None
|
assert response is not None
|
||||||
assert response.content is not None
|
assert response.content is not None
|
||||||
content = response.content
|
content = response.content
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class TestReportGenerationAgent:
|
|||||||
No significant regulatory news has been reported and the social media sentiment remains unknown.
|
No significant regulatory news has been reported and the social media sentiment remains unknown.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
response = self.agent.run(sample_data) #type: ignore
|
response = self.agent.run(sample_data) # type: ignore
|
||||||
assert response is not None
|
assert response is not None
|
||||||
assert response.content is not None
|
assert response.content is not None
|
||||||
content = response.content
|
content = response.content
|
||||||
|
|||||||
Reference in New Issue
Block a user