Update chat interface #70

Merged
trojanhorse47 merged 9 commits from 47-update-chat-interface into main 2025-10-31 14:24:39 +01:00
3 changed files with 10 additions and 7 deletions
Showing only changes of commit 0a0033c47b - Show all commits

View File

@@ -1,3 +1,6 @@
from typing import Any, Callable
# Registro centrale popolato da tutti i file Toolkit all'avvio.
ACTION_DESCRIPTIONS: dict[str, str] = {}
Berack96 commented 2025-10-30 22:33:07 +01:00 (Migrated from github.com)
Review

Sarebbe più corretto metterlo dentro il file core.py dato che ci sono tutte le interazioni core con la pipeline.

O ancor meglio che sia un decorator da mettere su ogni funzione di cui si vuole avere una descrizione e che aggiorna il registro, che sia dentro la classe RunMessage o che sia libero

@register_user_interaction("Recupero informazioni del mercato")
def funzione_di_ricerca():
Sarebbe più corretto metterlo dentro il file core.py dato che ci sono tutte le interazioni **core** con la pipeline. O ancor meglio che sia un decorator da mettere su ogni funzione di cui si vuole avere una descrizione e che aggiorna il registro, che sia dentro la classe RunMessage o che sia libero ```python @register_user_interaction("Recupero informazioni del mercato") def funzione_di_ricerca(): ```
trojanhorse47 commented 2025-10-30 23:18:12 +01:00 (Migrated from github.com)
Review

Stavo tentando di farne un decorator, ma sfruttando il decorator @tool di agno che però sminchiava il Toolkit. Alla fine ho fatto questo accrocchio che non mi soddisfa in pieno, ma non avevo più tempo e funziona.

Stavo tentando di farne un decorator, ma sfruttando il decorator @tool di agno che però sminchiava il Toolkit. Alla fine ho fatto questo accrocchio che non mi soddisfa in pieno, ma non avevo più tempo e funziona.
trojanhorse47 commented 2025-10-30 23:33:53 +01:00 (Migrated from github.com)
Review

Non chiudere ancora la pull request che domani provo a fare un decoratore custom così evitiamo quel registro che ho improvvisato

Non chiudere ancora la pull request che domani provo a fare un decoratore custom così evitiamo quel registro che ho improvvisato
@@ -9,7 +12,7 @@ def get_user_friendly_action(tool_name: str) -> str:
# Usa il dizionario ACTION_DESCRIPTIONS importato
return ACTION_DESCRIPTIONS.get(tool_name, f"⚙️ Eseguo l'operazione: {tool_name}...")
def friendly_action(description: str):
def friendly_action(description: str) -> Callable[..., Any]:
"""
Decoratore che registra automaticamente la descrizione "user-friendly"
di un metodo nel registro globale.
@@ -20,7 +23,7 @@ def friendly_action(description: str):
Restituisce la funzione originale non modificata.
"""
def decorator(func):
def decorator(func: Callable[..., Any]) -> Callable[..., Any]:
# Registra l'azione
tool_name = func.__name__
if tool_name in ACTION_DESCRIPTIONS:
@@ -31,4 +34,4 @@ def friendly_action(description: str):
# Restituisce la funzione originale
return func
return decorator
return decorator

View File

@@ -111,7 +111,6 @@ class PipelineInputs:
name="CryptoAnalysisTeam",
tools=[ReasoningTools(), PlanMemoryTool(), CryptoSymbolsTools()],
members=[market_agent, news_agent, social_agent],
stream_intermediate_steps=True
)
def get_agent_query_checker(self) -> Agent:
@@ -152,11 +151,11 @@ class RunMessage:
prefix (str, optional): Prefisso del messaggio. Defaults to ""
suffix (str, optional): Suffisso del messaggio. Defaults to ""
"""
self.current = None
self.steps_total = None
self.base_message = f"Running configurations: \n{prefix}{inputs}{suffix}\n\n"
self.emojis = ['🔳', '➡️', '']
self.placeholder = '<<<>>>'
self.current = 0
self.steps_total: list[tuple[str, int]] = []
self.set_steps(["Query Check", "Info Recovery", "Report Generation"])
def set_steps(self, steps: list[str]) -> 'RunMessage':

View File

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