3 market api (#8)

* Creazione branch tool, refactor degli import e soppressione dei warning

* Update pytest configuration and dependencies in pyproject.toml

* Add news API integration and related configurations

- Update .env.example to include NEWS_API_KEY configuration
- Add newsapi-python dependency in pyproject.toml
- Implement NewsAPI class for fetching news articles
- Create Article model for structured news data
- Add tests for NewsAPI functionality in test_news_api.py
- Update pytest configuration to include news marker

* Add news API functionality and update tests for article retrieval

* ToDo:
1. Aggiungere un aggregator per i dati recuperati dai provider.
2. Lavorare effettivamente all'issue

Done:
1. creati test per i provider
2. creato market_providers_api_demo.py per mostrare i dati recuperati dalle api dei providers
3. aggiornato i provider
4. creato il provider binance sia pubblico che con chiave
5. creato error_handler.py per gestire decoratori e utilità: retry automatico, gestione timeout...

* Refactor news API integration to use NewsApiWrapper and GnewsWrapper; add tests for Gnews API functionality

* Add CryptoPanic API integration and related tests; update .env.example and test configurations

* Implement WrapperHandler for managing multiple news API wrappers; add tests for wrapper functionality

* Enhance WrapperHandler
- docstrings
- add try_call_all method
- update tests

* pre merge con phil

* Add DuckDuckGo and Google News wrappers; refactor CryptoPanic and NewsAPI

- Implemented DuckDuckGoWrapper for news retrieval using DuckDuckGo tools.
- Added GoogleNewsWrapper for accessing Google News RSS feed.
- Refactored CryptoPanicWrapper to unify get_top_headlines and get_latest_news methods.
- Updated NewsApiWrapper to simplify top headlines retrieval.
- Added tests for DuckDuckGo and Google News wrappers.
- Enhanced documentation for CryptoPanicWrapper and NewsApiWrapper.
- Created base module for social media integrations.

* - Refactor struttura progetto: divisione tra agent e toolkit

* Refactor try_call_all method to return a dictionary of results; update tests for success and partial failures

* Fix class and test method names for DuckDuckGoWrapper

* Add Reddit API wrapper and related tests; update environment configuration

* pre merge con giacomo

* Fix import statements

* Fixes
- separated tests
- fix tests
- fix bugs reintroduced my previous merge

* Refactor market API wrappers to streamline product and price retrieval methods

* Add BinanceWrapper to market API exports

* Finito ISSUE 3

* Final review
- rm PublicBinanceAgent & updated demo
- moved in the correct folder some tests
- fix binance bug

---------

Co-authored-by: trojanhorse47 <cosmomemory@hotmail.it>
Co-authored-by: Berack96 <giacomobertolazzi7@gmail.com>
Co-authored-by: Giacomo Bertolazzi <31776951+Berack96@users.noreply.github.com>
This commit was merged in pull request #8.
This commit is contained in:
Simo
2025-10-01 15:51:25 +02:00
committed by GitHub
parent 4615ebe63e
commit dc9dc98298
50 changed files with 2673 additions and 671 deletions

View File

@@ -1,7 +1,7 @@
import gradio as gr
from dotenv import load_dotenv
from app.tool import ToolAgent
from app.pipeline import Pipeline
from agno.utils.log import log_info
########################################
@@ -16,31 +16,31 @@ if __name__ == "__main__":
load_dotenv()
######################################
tool_agent = ToolAgent()
pipeline = Pipeline()
with gr.Blocks() as demo:
gr.Markdown("# 🤖 Agente di Analisi e Consulenza Crypto")
with gr.Row():
provider = gr.Dropdown(
choices=tool_agent.list_providers(),
choices=pipeline.list_providers(),
type="index",
label="Modello da usare"
)
provider.change(fn=tool_agent.choose_provider, inputs=provider, outputs=None)
provider.change(fn=pipeline.choose_provider, inputs=provider, outputs=None)
style = gr.Dropdown(
choices=tool_agent.list_styles(),
choices=pipeline.list_styles(),
type="index",
label="Stile di investimento"
)
style.change(fn=tool_agent.choose_style, inputs=style, outputs=None)
style.change(fn=pipeline.choose_style, inputs=style, outputs=None)
user_input = gr.Textbox(label="Richiesta utente")
output = gr.Textbox(label="Risultato analisi", lines=12)
analyze_btn = gr.Button("🔎 Analizza")
analyze_btn.click(fn=tool_agent.interact, inputs=[user_input], outputs=output)
analyze_btn.click(fn=pipeline.interact, inputs=[user_input], outputs=output)
server, port = ("0.0.0.0", 8000)
log_info(f"Starting UPO AppAI on http://{server}:{port}")