mariangeliki commited on
Commit
d1b7459
·
verified ·
1 Parent(s): 8c5c24b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -2
app.py CHANGED
@@ -55,7 +55,7 @@ with open("prompts.yaml", 'r') as stream:
55
 
56
  agent = CodeAgent(
57
  model=model,
58
- tools=[final_answer], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
@@ -66,4 +66,16 @@ agent = CodeAgent(
66
  )
67
 
68
 
69
- GradioUI(agent).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  agent = CodeAgent(
57
  model=model,
58
+ tools=[final_answer,get_stock_price], ## add your tools here (don't remove final answer)
59
  max_steps=6,
60
  verbosity_level=1,
61
  grammar=None,
 
66
  )
67
 
68
 
69
+ GradioUI(agent).launch()
70
+
71
+ import yfinance as yf
72
+
73
+ @tool
74
+ def get_stock_price(symbol: str) -> str:
75
+ """Returns today's closing price of the stock"""
76
+ try:
77
+ stock =yf.Ticker(symbol)
78
+ data = stock.history(period="1d")
79
+ return(get_stock_price)
80
+
81
+