Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,6 +51,9 @@ def get_stock_price(stock: str) -> str:
|
|
| 51 |
# Perform the search
|
| 52 |
search_results = search_tool(f"current stock price of {stock}")
|
| 53 |
|
|
|
|
|
|
|
|
|
|
| 54 |
# Check if results exist and return the first result
|
| 55 |
if isinstance(search_results, list) and len(search_results) > 0:
|
| 56 |
return f"The current price for {stock} is: {search_results[0]}"
|
|
@@ -61,8 +64,6 @@ def get_stock_price(stock: str) -> str:
|
|
| 61 |
return f"Error fetching price for stock '{stock}': {str(e)}"
|
| 62 |
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
|
| 67 |
final_answer = FinalAnswerTool()
|
| 68 |
|
|
|
|
| 51 |
# Perform the search
|
| 52 |
search_results = search_tool(f"current stock price of {stock}")
|
| 53 |
|
| 54 |
+
# Debugging: Print results to see what is returned
|
| 55 |
+
print(f"DEBUG: search results -> {search_results}")
|
| 56 |
+
|
| 57 |
# Check if results exist and return the first result
|
| 58 |
if isinstance(search_results, list) and len(search_results) > 0:
|
| 59 |
return f"The current price for {stock} is: {search_results[0]}"
|
|
|
|
| 64 |
return f"Error fetching price for stock '{stock}': {str(e)}"
|
| 65 |
|
| 66 |
|
|
|
|
|
|
|
| 67 |
|
| 68 |
final_answer = FinalAnswerTool()
|
| 69 |
|