Better Prompt (#45)

* Enhance report generation and team leader prompts with conditional output rules for empty sections.

* Update .gitignore and configuration for model adjustments; refine query classification prompt

* Enforce max response length in prompts

* Documentazione tool essenziale per il loro utilizzo da parte degli LLM.

* istruzioni chiare sui tool disponibili nei promt degli agenti

* corretto incongruenze nel report generation prompt

* convertito i promt in file markdown
This commit was merged in pull request #45.
This commit is contained in:
Simo
2025-10-29 15:45:05 +01:00
committed by GitHub
parent 6d0b816033
commit 4ba44abb19
23 changed files with 1199 additions and 221 deletions

View File

@@ -39,38 +39,91 @@ class MarketAPIsTool(MarketWrapper, Toolkit):
)
def get_product(self, asset_id: str) -> ProductInfo:
return self.handler.try_call(lambda w: w.get_product(asset_id))
def get_products(self, asset_ids: list[str]) -> list[ProductInfo]:
return self.handler.try_call(lambda w: w.get_products(asset_ids))
def get_historical_prices(self, asset_id: str, limit: int = 100) -> list[Price]:
return self.handler.try_call(lambda w: w.get_historical_prices(asset_id, limit))
"""
Gets product information for a *single* asset from the *first available* provider.
This method sequentially queries multiple market data sources and returns
data from the first one that responds successfully.
Use this for a fast, specific lookup of one asset.
Args:
asset_id (str): The ID of the asset to retrieve information for.
Returns:
ProductInfo: An object containing the product information.
"""
return self.handler.try_call(lambda w: w.get_product(asset_id))
def get_products(self, asset_ids: list[str]) -> list[ProductInfo]:
"""
Gets product information for a *list* of assets from the *first available* provider.
This method sequentially queries multiple market data sources and returns
data from the first one that responds successfully.
Use this for a fast lookup of multiple assets.
Args:
asset_ids (list[str]): The list of asset IDs to retrieve information for.
Returns:
list[ProductInfo]: A list of objects containing product information.
"""
return self.handler.try_call(lambda w: w.get_products(asset_ids))
def get_historical_prices(self, asset_id: str, limit: int = 100) -> list[Price]:
"""
Gets historical price data for a *single* asset from the *first available* provider.
This method sequentially queries multiple market data sources and returns
data from the first one that responds successfully.
Use this for a fast lookup of price history.
Args:
asset_id (str): The asset ID to retrieve price data for.
limit (int): The maximum number of price data points to return. Defaults to 100.
Returns:
list[Price]: A list of Price objects representing historical data.
"""
return self.handler.try_call(lambda w: w.get_historical_prices(asset_id, limit))
def get_products_aggregated(self, asset_ids: list[str]) -> list[ProductInfo]:
"""
Restituisce i dati aggregati per una lista di asset_id.\n
Attenzione che si usano tutte le fonti, quindi potrebbe usare molte chiamate API (che potrebbero essere a pagamento).
Gets product information for multiple assets from *all available providers* and *aggregates* the results.
This method queries all configured sources and then merges the data into a single,
comprehensive list. Use this for a complete report.
Warning: This may use a large number of API calls.
Args:
asset_ids (list[str]): Lista di asset_id da cercare.
asset_ids (list[str]): The list of asset IDs to retrieve information for.
Returns:
list[ProductInfo]: Lista di ProductInfo aggregati.
list[ProductInfo]: A single, aggregated list of ProductInfo objects from all sources.
Raises:
Exception: If all wrappers fail to provide results.
Exception: If all providers fail to return results.
"""
all_products = self.handler.try_call_all(lambda w: w.get_products(asset_ids))
return ProductInfo.aggregate(all_products)
def get_historical_prices_aggregated(self, asset_id: str = "BTC", limit: int = 100) -> list[Price]:
"""
Restituisce i dati storici aggregati per un asset_id. Usa i dati di tutte le fonti disponibili e li aggrega.\n
Attenzione che si usano tutte le fonti, quindi potrebbe usare molte chiamate API (che potrebbero essere a pagamento).
Gets historical price data for a single asset from *all available providers* and *aggregates* the results.
This method queries all configured sources and then merges the data into a single,
comprehensive list of price points. Use this for a complete historical analysis.
Warning: This may use a large number of API calls.
Args:
asset_id (str): Asset ID da cercare.
limit (int): Numero massimo di dati storici da restituire.
asset_id (str): The asset ID to retrieve price data for. Defaults to "BTC".
limit (int): The maximum number of price data points to retrieve *from each* provider. Defaults to 100.
Returns:
list[Price]: Lista di Price aggregati.
list[Price]: A single, aggregated list of Price objects from all sources.
Raises:
Exception: If all wrappers fail to provide results.
Exception: If all providers fail to return results.
"""
all_prices = self.handler.try_call_all(lambda w: w.get_historical_prices(asset_id, limit))
return Price.aggregate(all_prices)