Team Workflow aggiornato #37

Merged
Berack96 merged 16 commits from 19-team-instructions into main 2025-10-20 22:05:58 +02:00
4 changed files with 51 additions and 2 deletions
Showing only changes of commit 9513ab0932 - Show all commits

View File

@@ -9,7 +9,7 @@ class QueryInputs(BaseModel):
class QueryOutputs(BaseModel): class QueryOutputs(BaseModel):
response: str response: str
is_ok: bool is_crypto: bool

View File

@@ -108,7 +108,7 @@ class Pipeline:
# Step 2: Crea gli steps # Step 2: Crea gli steps
def condition_query_ok(step_input: StepInput) -> StepOutput: def condition_query_ok(step_input: StepInput) -> StepOutput:
val = step_input.previous_step_content val = step_input.previous_step_content
return StepOutput(stop=not val.is_ok) if isinstance(val, QueryOutputs) else StepOutput(stop=True) return StepOutput(stop=not val.is_crypto) if isinstance(val, QueryOutputs) else StepOutput(stop=True)
query_check = Step(name=PipelineEvent.QUERY_CHECK, agent=q_check_agent) query_check = Step(name=PipelineEvent.QUERY_CHECK, agent=q_check_agent)
info_recovery = Step(name=PipelineEvent.INFO_RECOVERY, team=team) info_recovery = Step(name=PipelineEvent.INFO_RECOVERY, team=team)

View File

@@ -3,6 +3,7 @@ GOAL: check if the query is crypto-related
1) Determine the language of the query: 1) Determine the language of the query:
- This will help you understand better the intention of the user - This will help you understand better the intention of the user
- Focus on the query of the user - Focus on the query of the user
- DO NOT answer the query
2) Determine if the query is crypto or investment-related: 2) Determine if the query is crypto or investment-related:
- Crypto-related if it mentions cryptocurrencies, tokens, NFTs, blockchain, exchanges, wallets, DeFi, oracles, smart contracts, on-chain, off-chain, staking, yield, liquidity, tokenomics, coins, ticker symbols, etc. - Crypto-related if it mentions cryptocurrencies, tokens, NFTs, blockchain, exchanges, wallets, DeFi, oracles, smart contracts, on-chain, off-chain, staking, yield, liquidity, tokenomics, coins, ticker symbols, etc.

View File

@@ -0,0 +1,48 @@
import pytest
copilot-pull-request-reviewer[bot] commented 2025-10-20 18:05:28 +02:00 (Migrated from github.com)
Review

Corrected spelling of 'Etherium' to 'Ethereum'.

        response = self.agent.run("Ha senso investire in Ethereum?")  #type: ignore
Corrected spelling of 'Etherium' to 'Ethereum'. ```suggestion response = self.agent.run("Ha senso investire in Ethereum?") #type: ignore ```
copilot-pull-request-reviewer[bot] commented 2025-10-20 21:51:59 +02:00 (Migrated from github.com)
Review

The #type: ignore comment is missing a space after #. Use # type: ignore for consistency with Python style conventions.

The `#type: ignore` comment is missing a space after `#`. Use `# type: ignore` for consistency with Python style conventions.
copilot-pull-request-reviewer[bot] commented 2025-10-20 21:52:00 +02:00 (Migrated from github.com)
Review

The #type: ignore comment is missing a space after #. Use # type: ignore for consistency with Python style conventions.

        response = self.agent.run("What is the capital of France?")  # type: ignore
The `#type: ignore` comment is missing a space after `#`. Use `# type: ignore` for consistency with Python style conventions. ```suggestion response = self.agent.run("What is the capital of France?") # type: ignore ```
copilot-pull-request-reviewer[bot] commented 2025-10-20 21:52:00 +02:00 (Migrated from github.com)
Review

The #type: ignore comment is missing a space after #. Use # type: ignore for consistency with Python style conventions.

The `#type: ignore` comment is missing a space after `#`. Use `# type: ignore` for consistency with Python style conventions.
copilot-pull-request-reviewer[bot] commented 2025-10-20 21:52:00 +02:00 (Migrated from github.com)
Review

The #type: ignore comment is missing a space after #. Use # type: ignore for consistency with Python style conventions.

        response = self.agent.run("Ha senso investire in Ethereum?")  # type: ignore
The `#type: ignore` comment is missing a space after `#`. Use `# type: ignore` for consistency with Python style conventions. ```suggestion response = self.agent.run("Ha senso investire in Ethereum?") # type: ignore ```
from app.agents.core import QueryOutputs
from app.agents.prompts import QUERY_CHECK_INSTRUCTIONS
from app.configs import AppConfig
class TestQueryCheckAgent:
@pytest.fixture(autouse=True)
def setup(self):
self.configs = AppConfig.load()
self.model = self.configs.get_model_by_name("qwen3:1.7b")
self.agent = self.model.get_agent(QUERY_CHECK_INSTRUCTIONS, output_schema=QueryOutputs)
def test_query_not_ok(self):
response = self.agent.run("Is the sky blue?") #type: ignore
assert response is not None
assert response.content is not None
content = response.content
assert isinstance(content, QueryOutputs)
assert content.is_crypto == False
def test_query_not_ok2(self):
response = self.agent.run("What is the capital of France?") #type: ignore
assert response is not None
assert response.content is not None
content = response.content
assert isinstance(content, QueryOutputs)
assert content.is_crypto == False
def test_query_ok(self):
response = self.agent.run("Bitcoin") #type: ignore
assert response is not None
assert response.content is not None
content = response.content
assert isinstance(content, QueryOutputs)
assert content.is_crypto == True
def test_query_ok2(self):
response = self.agent.run("Ha senso investire in Etherium?") #type: ignore
assert response is not None
assert response.content is not None
content = response.content
assert isinstance(content, QueryOutputs)
assert content.is_crypto == True