Spaces:
Runtime error
Runtime error
Update tools/orchestrator.py
Browse files- tools/orchestrator.py +6 -0
tools/orchestrator.py
CHANGED
@@ -114,6 +114,12 @@ def orchestrate_and_respond(user_input: str, provider_name: str, model_display_n
|
|
114 |
yield "status", f"[Web: '{query[:60]}'...]"
|
115 |
results = search_and_scrape_duckduckgo(query, num_results=2)
|
116 |
context_str = "Web Content:\n" + "\n".join([f"Source {i+1} ({r.get('url','N/A')}):\n{r.get('content', r.get('error', 'N/A'))[:3000]}\n---" for i, r in enumerate(results)])
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
elif action_type == "answer_using_conversation_memory":
|
118 |
yield "status", "[Searching conversation memory...]"
|
119 |
mems = retrieve_memories_semantic(f"User query: {user_input}\nContext:\n{history_str_for_prompt[-1000:]}", k=2)
|
|
|
114 |
yield "status", f"[Web: '{query[:60]}'...]"
|
115 |
results = search_and_scrape_duckduckgo(query, num_results=2)
|
116 |
context_str = "Web Content:\n" + "\n".join([f"Source {i+1} ({r.get('url','N/A')}):\n{r.get('content', r.get('error', 'N/A'))[:3000]}\n---" for i, r in enumerate(results)])
|
117 |
+
elif action_type == "scrape_url_and_report" and WEB_SEARCH_ENABLED:
|
118 |
+
url = action_input.get("url")
|
119 |
+
if url:
|
120 |
+
yield "status", f"[Web: '{url[:60]}'...]"
|
121 |
+
result = scrape_url(url)
|
122 |
+
context_str = f"Web Content for {url}:\n{result.get('content', result.get('error', 'No content scraped.'))}"
|
123 |
elif action_type == "answer_using_conversation_memory":
|
124 |
yield "status", "[Searching conversation memory...]"
|
125 |
mems = retrieve_memories_semantic(f"User query: {user_input}\nContext:\n{history_str_for_prompt[-1000:]}", k=2)
|