feat : task complexity routing
This commit is contained in:
@@ -210,6 +210,7 @@ class BrowserAgent(Agent):
|
||||
You: "search: Recent space missions news, {self.date}"
|
||||
|
||||
Do not explain, do not write anything beside the search query.
|
||||
If the query does not make any sense for a web search explain why and say REQUEST_EXIT
|
||||
"""
|
||||
|
||||
def process(self, user_prompt, speech_module) -> str:
|
||||
@@ -218,6 +219,9 @@ class BrowserAgent(Agent):
|
||||
animate_thinking(f"Thinking...", color="status")
|
||||
self.memory.push('user', self.search_prompt(user_prompt))
|
||||
ai_prompt, _ = self.llm_request()
|
||||
if "REQUEST_EXIT" in ai_prompt:
|
||||
# request make no sense, maybe wrong agent was allocated?
|
||||
return ai_prompt, ""
|
||||
animate_thinking(f"Searching...", color="status")
|
||||
search_result_raw = self.tools["web_search"].execute([ai_prompt], False)
|
||||
search_result = self.jsonify_search_results(search_result_raw)[:7] # until futher improvement
|
||||
|
||||
Reference in New Issue
Block a user