Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,13 +26,15 @@ web_agent = Agent(
|
|
26 |
markdown=True # Format the output in Markdown
|
27 |
)
|
28 |
|
29 |
-
# Function to fetch the latest AI news
|
30 |
def fetch_latest_ai_news():
|
31 |
# Simulating some processing delay
|
32 |
time.sleep(3)
|
33 |
|
34 |
query = "Find the latest news about Artificial Intelligence and summarize it."
|
35 |
-
|
|
|
|
|
36 |
|
37 |
raw_response = str(response) # Simulating raw data for terminal-like output
|
38 |
processed_response = response.get('response', 'No summary available.') # Cleaned summary
|
|
|
26 |
markdown=True # Format the output in Markdown
|
27 |
)
|
28 |
|
29 |
+
# Function to fetch the latest AI news using the correct method
|
30 |
def fetch_latest_ai_news():
|
31 |
# Simulating some processing delay
|
32 |
time.sleep(3)
|
33 |
|
34 |
query = "Find the latest news about Artificial Intelligence and summarize it."
|
35 |
+
|
36 |
+
# Use the correct method on the Agent, likely 'run' or 'execute' instead of 'ask'
|
37 |
+
response = web_agent.execute(query) # Using 'execute' or any other valid method
|
38 |
|
39 |
raw_response = str(response) # Simulating raw data for terminal-like output
|
40 |
processed_response = response.get('response', 'No summary available.') # Cleaned summary
|