mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-07-22 01:10:07 +00:00
fix : lang error
This commit is contained in:
parent
09ce9a882a
commit
06e6b2798b
@ -166,6 +166,7 @@ class BrowserAgent(Agent):
|
|||||||
You previously took these notes:
|
You previously took these notes:
|
||||||
{notes}
|
{notes}
|
||||||
Do not Step-by-Step explanation. Write Notes or Error as a long paragraph followed by your action.
|
Do not Step-by-Step explanation. Write Notes or Error as a long paragraph followed by your action.
|
||||||
|
Do not go to tutorials or help pages.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def llm_decide(self, prompt: str, show_reasoning: bool = False) -> Tuple[str, str]:
|
def llm_decide(self, prompt: str, show_reasoning: bool = False) -> Tuple[str, str]:
|
||||||
|
@ -430,7 +430,8 @@ class AgentRouter:
|
|||||||
Returns:
|
Returns:
|
||||||
Agent: The selected agent
|
Agent: The selected agent
|
||||||
"""
|
"""
|
||||||
if len(self.agents) == 0:
|
assert len(self.agents) > 0, "No agents available."
|
||||||
|
if len(self.agents) == 1:
|
||||||
return self.agents[0]
|
return self.agents[0]
|
||||||
lang = self.lang_analysis.detect_language(text)
|
lang = self.lang_analysis.detect_language(text)
|
||||||
text = self.find_first_sentence(text)
|
text = self.find_first_sentence(text)
|
||||||
@ -449,7 +450,8 @@ class AgentRouter:
|
|||||||
raise e
|
raise e
|
||||||
for agent in self.agents:
|
for agent in self.agents:
|
||||||
if best_agent == agent.role["en"]:
|
if best_agent == agent.role["en"]:
|
||||||
pretty_print(f"Selected agent: {agent.agent_name} (roles: {agent.role[lang]})", color="warning")
|
role_name = agent.role[lang] if lang in agent.role else agent.role["en"]
|
||||||
|
pretty_print(f"Selected agent: {agent.agent_name} (roles: {role_name})", color="warning")
|
||||||
return agent
|
return agent
|
||||||
pretty_print(f"Error choosing agent.", color="failure")
|
pretty_print(f"Error choosing agent.", color="failure")
|
||||||
self.logger.error("No agent selected.")
|
self.logger.error("No agent selected.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user