* Fix degli import

+ Aggiunta cancellazione casella di input all'invio della richiesta dell'utente
This commit is contained in:
trojanhorse47
2025-10-02 11:05:05 +02:00
parent 6e1c11f6aa
commit ba44f6e902
11 changed files with 27 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ if __name__ == "__main__":
response = chat.send_message(message)
history.append({"role": "user", "content": message})
history.append({"role": "assistant", "content": response})
return history, history
return history, history, ""
def save_current_chat():
chat.save_chat("chat.json")
@@ -69,7 +69,7 @@ if __name__ == "__main__":
load_btn = gr.Button("📂 Carica Chat")
# Invio messaggio
msg.submit(respond, inputs=[msg, chatbot], outputs=[chatbot, chatbot])
msg.submit(respond, inputs=[msg, chatbot], outputs=[chatbot, chatbot, msg])
# Reset
clear_btn.click(reset_chat, inputs=None, outputs=[chatbot, chatbot])
# Salvataggio
@@ -78,5 +78,5 @@ if __name__ == "__main__":
load_btn.click(load_previous_chat, inputs=None, outputs=[chatbot, chatbot])
server, port = ("127.0.0.1", 8000)
log_info(f"Starting UPO AppAI Chat on http://{server}:{port}")
log_info(f"Starting UPO AppAI Chat on http://{server}:{port}") # noqa
demo.launch(server_name=server, server_port=port, quiet=True)

View File

@@ -4,8 +4,8 @@ from agno.models.message import Message
from agno.run.agent import RunOutput, RunOutputEvent
from pydantic import BaseModel
from src.app.toolkits.market_toolkit import MarketToolkit
from src.app.markets.base import ProductInfo # modello dati già definito nel tuo progetto
from app.toolkits.market_toolkit import MarketToolkit
from app.markets.base import ProductInfo # modello dati già definito nel tuo progetto
class MarketAgent(Agent):

View File

@@ -1,7 +1,7 @@
import os
import json
from typing import List, Dict
from src.app.pipeline import Pipeline
from pipeline import Pipeline
SAVE_DIR = os.path.join(os.path.dirname(__file__), "..", "saves")
os.makedirs(SAVE_DIR, exist_ok=True)

View File

@@ -2,8 +2,8 @@ import os
from typing import Optional
from datetime import datetime, timedelta
from binance.client import Client
from .base import ProductInfo, BaseWrapper, Price
from .error_handler import retry_on_failure, handle_api_errors, MarketAPIError
from base import ProductInfo, BaseWrapper, Price
from error_handler import retry_on_failure, handle_api_errors, MarketAPIError
class BinanceWrapper(BaseWrapper):

View File

@@ -8,8 +8,8 @@ con l'architettura del modulo markets.
from typing import Optional, Dict, Any
from datetime import datetime, timedelta
from binance.client import Client
from .base import BaseWrapper, ProductInfo, Price
from .error_handler import retry_on_failure, handle_api_errors, MarketAPIError
from base import BaseWrapper, ProductInfo, Price
from error_handler import retry_on_failure, handle_api_errors, MarketAPIError
class PublicBinanceAgent(BaseWrapper):

View File

@@ -2,8 +2,8 @@ import os
from typing import Optional
from datetime import datetime, timedelta
from coinbase.rest import RESTClient
from .base import ProductInfo, BaseWrapper, Price
from .error_handler import retry_on_failure, handle_api_errors, MarketAPIError, RateLimitError
from base import ProductInfo, BaseWrapper, Price
from error_handler import retry_on_failure, handle_api_errors, MarketAPIError, RateLimitError
class CoinBaseWrapper(BaseWrapper):
"""

View File

@@ -1,8 +1,8 @@
import os
import requests
from typing import Optional, Dict, Any
from .base import ProductInfo, BaseWrapper, Price
from .error_handler import retry_on_failure, handle_api_errors, MarketAPIError
from base import ProductInfo, BaseWrapper, Price
from error_handler import retry_on_failure, handle_api_errors, MarketAPIError
BASE_URL = "https://min-api.cryptocompare.com"

View File

@@ -1,11 +1,11 @@
from agno.run.agent import RunOutput
from agno.team import Team
from src.app.agents.market_agent import MarketAgent
from src.app.agents.news_agent import NewsAgent
from src.app.agents.social_agent import SocialAgent
from src.app.models import AppModels
from src.app.predictor import PredictorInput, PredictorOutput, PredictorStyle, PREDICTOR_INSTRUCTIONS
from agents.market_agent import MarketAgent
from agents.news_agent import NewsAgent
from agents.social_agent import SocialAgent
from models import AppModels
from predictor import PredictorInput, PredictorOutput, PredictorStyle, PREDICTOR_INSTRUCTIONS
class Pipeline:

View File

@@ -2,7 +2,7 @@ from enum import Enum
from pydantic import BaseModel, Field
from src.app.markets.base import ProductInfo
from markets.base import ProductInfo
class PredictorStyle(Enum):

View File

@@ -1,6 +1,6 @@
from agno.tools import Toolkit
from src.app.markets import MarketAPIs
from app.markets import MarketAPIs
# TODO (?) in futuro fare in modo che la LLM faccia da sé per il mercato