Skip to content

Commit

Permalink
fix: crypto compare skills bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hyacinthus committed Feb 13, 2025
1 parent 53b20de commit 68a26cc
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 42 deletions.
1 change: 1 addition & 0 deletions skills/cryptocompare/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Base class for all CryptoCompare tools."""

from datetime import datetime, timedelta, timezone
from typing import Type

from pydantic import BaseModel, Field

Expand Down
13 changes: 6 additions & 7 deletions skills/cryptocompare/fetch_news.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
from skills.cryptocompare.api import FetchNewsInput, fetch_news
from skills.cryptocompare.base import CryptoCompareBaseTool

FETCH_NEWS_PROMPT = """
This tool fetches the latest cryptocurrency news articles for a specific token.
You can optionally specify a timestamp to get historical news, otherwise it uses the current time.
Returns articles in English with details like title, body, source, and publish time.
"""


class NewsArticle(BaseModel):
"""Model representing a news article."""
Expand Down Expand Up @@ -98,10 +104,3 @@ async def _arun(self, token: str) -> CryptoCompareFetchNewsOutput:

except Exception as e:
return CryptoCompareFetchNewsOutput(error=str(e))


FETCH_NEWS_PROMPT = """
This tool fetches the latest cryptocurrency news articles for a specific token.
You can optionally specify a timestamp to get historical news, otherwise it uses the current time.
Returns articles in English with details like title, body, source, and publish time.
"""
13 changes: 6 additions & 7 deletions skills/cryptocompare/fetch_price.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from skills.cryptocompare.api import FetchPriceInput, fetch_price
from skills.cryptocompare.base import CryptoCompareBaseTool

FETCH_PRICE_PROMPT = """
This tool fetches real-time cryptocurrency price data with multi-currency support.
Provide a base currency (e.g., 'BTC', 'ETH') and a list of target currencies (e.g., ['USD', 'EUR', 'JPY']).
Returns current exchange rates for all requested currency pairs.
"""


class CryptoCompareFetchPriceOutput(BaseModel):
result: Dict[str, Any]
Expand Down Expand Up @@ -34,10 +40,3 @@ async def _arun(
return CryptoCompareFetchPriceOutput(result=result)
except Exception as e:
return CryptoCompareFetchPriceOutput(result={}, error=str(e))


FETCH_PRICE_PROMPT = """
This tool fetches real-time cryptocurrency price data with multi-currency support.
Provide a base currency (e.g., 'BTC', 'ETH') and a list of target currencies (e.g., ['USD', 'EUR', 'JPY']).
Returns current exchange rates for all requested currency pairs.
"""
13 changes: 6 additions & 7 deletions skills/cryptocompare/fetch_top_exchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from skills.cryptocompare.api import FetchTopExchangesInput, fetch_top_exchanges
from skills.cryptocompare.base import CryptoCompareBaseTool

FETCH_TOP_EXCHANGES_PROMPT = """
This tool fetches the top cryptocurrency exchanges for a specific trading pair.
Specify base and quote currencies (e.g., 'BTC'/'USD') to get exchange rankings.
Returns key information such as 24h trading volume and market share.
"""


class CryptoCompareFetchTopExchangesOutput(BaseModel):
result: Dict[str, Any]
Expand Down Expand Up @@ -34,10 +40,3 @@ async def _arun(
return CryptoCompareFetchTopExchangesOutput(result=result)
except Exception as e:
return CryptoCompareFetchTopExchangesOutput(result={}, error=str(e))


FETCH_TOP_EXCHANGES_PROMPT = """
This tool fetches the top cryptocurrency exchanges for a specific trading pair.
Specify base and quote currencies (e.g., 'BTC'/'USD') to get exchange rankings.
Returns key information such as 24h trading volume and market share.
"""
13 changes: 6 additions & 7 deletions skills/cryptocompare/fetch_top_market_cap.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from skills.cryptocompare.api import FetchTopMarketCapInput, fetch_top_market_cap
from skills.cryptocompare.base import CryptoCompareBaseTool

FETCH_TOP_MARKET_CAP_PROMPT = """
This tool retrieves the top cryptocurrencies ranked by market capitalization.
Customize results with limit and quote currency parameters.
Returns detailed information including current price, market cap, 24h volume, and circulating supply.
"""


class CryptoCompareFetchTopMarketCapOutput(BaseModel):
result: Dict[str, Any]
Expand All @@ -31,10 +37,3 @@ async def _arun(self, to_symbol: str) -> CryptoCompareFetchTopMarketCapOutput:
return CryptoCompareFetchTopMarketCapOutput(result=result)
except Exception as e:
return CryptoCompareFetchTopMarketCapOutput(result={}, error=str(e))


FETCH_TOP_MARKET_CAP_PROMPT = """
This tool retrieves the top cryptocurrencies ranked by market capitalization.
Customize results with limit and quote currency parameters.
Returns detailed information including current price, market cap, 24h volume, and circulating supply.
"""
13 changes: 6 additions & 7 deletions skills/cryptocompare/fetch_top_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from skills.cryptocompare.api import FetchTopVolumeInput, fetch_top_volume
from skills.cryptocompare.base import CryptoCompareBaseTool

FETCH_TOP_VOLUME_PROMPT = """
This tool retrieves cryptocurrencies ranked by their total trading volume.
Customize the view with limit and quote currency parameters.
Returns comprehensive volume data including 24h trading volume and volume distribution.
"""


class CryptoCompareFetchTopVolumeOutput(BaseModel):
result: Dict[str, Any]
Expand All @@ -31,10 +37,3 @@ async def _arun(self, to_symbol: str) -> CryptoCompareFetchTopVolumeOutput:
return CryptoCompareFetchTopVolumeOutput(result=result)
except Exception as e:
return CryptoCompareFetchTopVolumeOutput(result={}, error=str(e))


FETCH_TOP_VOLUME_PROMPT = """
This tool retrieves cryptocurrencies ranked by their total trading volume.
Customize the view with limit and quote currency parameters.
Returns comprehensive volume data including 24h trading volume and volume distribution.
"""
13 changes: 6 additions & 7 deletions skills/cryptocompare/fetch_trading_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
from skills.cryptocompare.api import FetchTradingSignalsInput, fetch_trading_signals
from skills.cryptocompare.base import CryptoCompareBaseTool

FETCH_TRADING_SIGNALS_PROMPT = """
This tool retrieves advanced trading signals from IntoTheBlock analytics for a specific cryptocurrency.
Provide a cryptocurrency symbol (e.g., 'BTC') to get detailed market indicators.
Returns key metrics like network growth, large transaction patterns, holder composition, and market momentum.
"""


class CryptoCompareFetchTradingSignalsOutput(BaseModel):
result: Dict[str, Any]
Expand All @@ -30,10 +36,3 @@ async def _arun(self, from_symbol: str) -> CryptoCompareFetchTradingSignalsOutpu
return CryptoCompareFetchTradingSignalsOutput(result=result)
except Exception as e:
return CryptoCompareFetchTradingSignalsOutput(result={}, error=str(e))


FETCH_TRADING_SIGNALS_PROMPT = """
This tool retrieves advanced trading signals from IntoTheBlock analytics for a specific cryptocurrency.
Provide a cryptocurrency symbol (e.g., 'BTC') to get detailed market indicators.
Returns key metrics like network growth, large transaction patterns, holder composition, and market momentum.
"""

0 comments on commit 68a26cc

Please sign in to comment.