Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,13 +35,13 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_stock_price(stock: str) -> str:
|
| 38 |
-
"""A tool that fetches the current stock price
|
| 39 |
Args:
|
| 40 |
stock: A string representing a valid stock name or stock code (e.g., 'DIALOG' or '7277').
|
| 41 |
"""
|
| 42 |
try:
|
| 43 |
# Create stock object
|
| 44 |
-
stk = DuckDuckGoSearchTool(f'What is the current price of {stock}?')
|
| 45 |
return f"The current price for {stock} is {stk}"
|
| 46 |
except Exception as e:
|
| 47 |
return f"Error fetching price for stock '{stock}': {str(e)}"
|
|
|
|
| 35 |
|
| 36 |
@tool
|
| 37 |
def get_stock_price(stock: str) -> str:
|
| 38 |
+
"""A tool that fetches the current stock price from web search.
|
| 39 |
Args:
|
| 40 |
stock: A string representing a valid stock name or stock code (e.g., 'DIALOG' or '7277').
|
| 41 |
"""
|
| 42 |
try:
|
| 43 |
# Create stock object
|
| 44 |
+
stk = DuckDuckGoSearchTool(queries=f'What is the current price of {stock}?')
|
| 45 |
return f"The current price for {stock} is {stk}"
|
| 46 |
except Exception as e:
|
| 47 |
return f"Error fetching price for stock '{stock}': {str(e)}"
|