mirror of
https://github.com/tcsenpai/agenticSeek.git
synced 2025-07-21 17:00:17 +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:
|
||||
{notes}
|
||||
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]:
|
||||
|
@ -430,7 +430,8 @@ class AgentRouter:
|
||||
Returns:
|
||||
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]
|
||||
lang = self.lang_analysis.detect_language(text)
|
||||
text = self.find_first_sentence(text)
|
||||
@ -449,7 +450,8 @@ class AgentRouter:
|
||||
raise e
|
||||
for agent in self.agents:
|
||||
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
|
||||
pretty_print(f"Error choosing agent.", color="failure")
|
||||
self.logger.error("No agent selected.")
|
||||
|
Loading…
x
Reference in New Issue
Block a user