mujtabarizvi commited on
Commit
3acc4ba
·
verified ·
1 Parent(s): 38f7e34

Removed broken crypto pricing tool

Browse files
Files changed (1) hide show
  1. app.py +1 -24
app.py CHANGED
@@ -7,29 +7,6 @@ from tools.final_answer import FinalAnswerTool
7
 
8
  from Gradio_UI import GradioUI
9
 
10
- # Below is a tool that gets live crypto pricing.
11
- @tool
12
- def get_crypto_price(symbol: str) -> str:
13
- """Get cryptocurrency price with basic error handling
14
- Args:
15
- symbol: The cryptocurrency symbol (e.g., 'BTC', 'ETH', 'SOL')
16
- """
17
- try:
18
- symbol = symbol.upper()
19
- response = requests.get(
20
- f"https://api.coingecko.com/api/v3/simple/price?ids={symbol.lower()}&vs_currencies=usd",
21
- timeout=3
22
- )
23
- data = response.json()
24
-
25
- if symbol.lower() in data and 'usd' in data[symbol.lower()]:
26
- return f"Current {symbol} price: ${data[symbol.lower()]['usd']:,.2f}"
27
-
28
- return f"Could not find price for {symbol} (try BTC/ETH/SOL)"
29
-
30
- except Exception:
31
- return f"Price check service unavailable for {symbol}"
32
-
33
  @tool
34
  def get_current_time_in_timezone(timezone: str) -> str:
35
  """A tool that fetches the current local time in a specified timezone.
@@ -67,7 +44,7 @@ with open("prompts.yaml", 'r') as stream:
67
 
68
  agent = CodeAgent(
69
  model=model,
70
- tools=[final_answer, get_crypto_price], ## add your tools here (don't remove final answer)
71
  max_steps=6,
72
  verbosity_level=1,
73
  grammar=None,
 
7
 
8
  from Gradio_UI import GradioUI
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  @tool
11
  def get_current_time_in_timezone(timezone: str) -> str:
12
  """A tool that fetches the current local time in a specified timezone.
 
44
 
45
  agent = CodeAgent(
46
  model=model,
47
+ tools=[final_answer], ## add your tools here (don't remove final answer)
48
  max_steps=6,
49
  verbosity_level=1,
50
  grammar=None,