Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -707,7 +707,7 @@ def get_linkup_news(symbols):
|
|
| 707 |
return "No symbols provided for Linkup research."
|
| 708 |
|
| 709 |
symbol_string = ", ".join(symbols) # Create string like "BTC, ETH, SOL"
|
| 710 |
-
query = f"Provide the latest news, expert opinions, rumors, and market trends
|
| 711 |
|
| 712 |
try:
|
| 713 |
response = lclient.search(
|
|
@@ -716,17 +716,9 @@ def get_linkup_news(symbols):
|
|
| 716 |
output_type="searchResults", # Get structured results if possible, or 'answer' for summary
|
| 717 |
include_images=False,
|
| 718 |
)
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
elif hasattr(response, 'answer'): # Example if output_type='answer'
|
| 723 |
-
return response.answer
|
| 724 |
-
elif hasattr(response, 'results'): # Example if output_type='searchResults'
|
| 725 |
-
# Simple concatenation of results
|
| 726 |
-
return "\n".join([f"- {r.get('title', '')}: {r.get('text', '')[:200]}..." for r in response.results[:5]]) # Show top 5 results summary
|
| 727 |
-
else:
|
| 728 |
-
# Fallback to string representation
|
| 729 |
-
return str(response)
|
| 730 |
|
| 731 |
except Exception as e:
|
| 732 |
logger.error(f"Linkup API search failed: {e}", exc_info=True)
|
|
|
|
| 707 |
return "No symbols provided for Linkup research."
|
| 708 |
|
| 709 |
symbol_string = ", ".join(symbols) # Create string like "BTC, ETH, SOL"
|
| 710 |
+
query = f"Provide the latest crypto news, expert opinions, rumors, and market trends and also tell more about these cryptocurrencies: {symbol_string}."
|
| 711 |
|
| 712 |
try:
|
| 713 |
response = lclient.search(
|
|
|
|
| 716 |
output_type="searchResults", # Get structured results if possible, or 'answer' for summary
|
| 717 |
include_images=False,
|
| 718 |
)
|
| 719 |
+
|
| 720 |
+
|
| 721 |
+
return str(response)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 722 |
|
| 723 |
except Exception as e:
|
| 724 |
logger.error(f"Linkup API search failed: {e}", exc_info=True)
|