+ Creato scheletro dell'app con agenti mock per test.
* Modificato pyproject.toml con versioni aggiornate di agno (aggiunto file requirements.txt per compatibilità eventuale con hugging face). # Consiglio di spostare il contenuto di src direttamente nella directory base per tenere compatibilità con hugging face in caso si voglia sfruttare in futuro.
This commit is contained in:
37
src/app.py
37
src/app.py
@@ -1,8 +1,35 @@
|
||||
import agno
|
||||
import gradio
|
||||
import dotenv
|
||||
import requests
|
||||
import gradio as gr
|
||||
from app.tool import ToolAgent
|
||||
|
||||
tool_agent = ToolAgent()
|
||||
|
||||
def analyze_request(user_input, provider, style):
|
||||
try:
|
||||
return tool_agent.interact(user_input, provider=provider, style=style)
|
||||
except Exception as e:
|
||||
return f"❌ Errore: {str(e)}"
|
||||
|
||||
with gr.Blocks() as demo:
|
||||
gr.Markdown("# 🤖 Agente di Analisi e Consulenza Crypto")
|
||||
|
||||
with gr.Row():
|
||||
provider = gr.Dropdown(
|
||||
choices=["mock", "openai", "anthropic", "google", "deepseek"],
|
||||
value="mock",
|
||||
label="Modello da usare"
|
||||
)
|
||||
style = gr.Dropdown(
|
||||
choices=["conservative", "aggressive"],
|
||||
value="conservative",
|
||||
label="Stile di investimento"
|
||||
)
|
||||
|
||||
user_input = gr.Textbox(label="Richiesta utente")
|
||||
output = gr.Textbox(label="Risultato analisi", lines=12)
|
||||
|
||||
analyze_btn = gr.Button("🔎 Analizza")
|
||||
analyze_btn.click(fn=analyze_request, inputs=[user_input, provider, style], outputs=output)
|
||||
|
||||
if __name__ == "__main__":
|
||||
print("Hello World!")
|
||||
demo.launch()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user