Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions neuro_san/internals/graph/registry/agent_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def register(self, agent_spec: Dict[str, Any]):

if name in self.agent_spec_map:
message: str = f"""
The agent named "{name}" appears to have a duplicate entry in its hocon file.
The agent named "{name}" appears to have a duplicate entry in its hocon file for {self.name}.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the agent name to the exception message as requested by @ofrancon .
Here and 2 other places below.

Agent names must be unique within the scope of a single hocon file.

Some things to try:
Expand Down Expand Up @@ -135,8 +135,8 @@ def find_front_man(self) -> str:
valid_front_men.remove(front_man)

if len(valid_front_men) == 0:
raise ValueError("""
No front man found.
raise ValueError(f"""
No front man found for the {self.name} agent network.
Here are some pre-conditions for an agent in your network to be a potential front man:
1) The agent's "function" does not have any "parameters" defined OR
2) The agent is the first listed among the "tools" of your agent hocon file
Expand All @@ -147,7 +147,8 @@ def find_front_man(self) -> str:
""")

if len(valid_front_men) > 1:
raise ValueError(f"Found > 1 front man for chat. Possibilities: {valid_front_men}")
raise ValueError(f"Found > 1 front man for chat for the {self.name} network." +
f" Possibilities: {valid_front_men}")

front_man: str = valid_front_men[0]

Expand Down