Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,15 @@ def get_btc_price() -> str:
|
|
| 18 |
|
| 19 |
@tool
|
| 20 |
def get_btc_data(query: str) -> str:
|
| 21 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
url = f"https://api.coingecko.com/api/v3/coins/bitcoin?localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false"
|
| 23 |
response = requests.get(url)
|
| 24 |
if response.status_code != 200:
|
|
@@ -58,4 +66,4 @@ agent = CodeAgent(
|
|
| 58 |
)
|
| 59 |
|
| 60 |
# Launch the Gradio interface
|
| 61 |
-
GradioUI(agent).launch()
|
|
|
|
| 18 |
|
| 19 |
@tool
|
| 20 |
def get_btc_data(query: str) -> str:
|
| 21 |
+
"""
|
| 22 |
+
Fetches Bitcoin data using the CoinGecko API.
|
| 23 |
+
|
| 24 |
+
Args:
|
| 25 |
+
query (str): The type of data to fetch (e.g., "price", "market_cap", "circulating_supply").
|
| 26 |
+
|
| 27 |
+
Returns:
|
| 28 |
+
str: The requested Bitcoin data.
|
| 29 |
+
"""
|
| 30 |
url = f"https://api.coingecko.com/api/v3/coins/bitcoin?localization=false&tickers=false&market_data=true&community_data=false&developer_data=false&sparkline=false"
|
| 31 |
response = requests.get(url)
|
| 32 |
if response.status_code != 200:
|
|
|
|
| 66 |
)
|
| 67 |
|
| 68 |
# Launch the Gradio interface
|
| 69 |
+
GradioUI(agent).launch()
|