Skip to content

Conversation

@santoshkumarradha
Copy link
Member

Improves the AgentRouter by implementing getattr to automatically delegate any unknown attribute or method access to the attached agent. This eliminates the need for explicit delegation methods for agent functionalities like ai(), call(), memory, note(), and discover().

This change simplifies the AgentRouter's interface and makes it more transparently proxy agent methods. Added tests to verify the automatic delegation for various agent methods and property access, as well as error handling when no agent is attached.

Summary

Testing

  • ./scripts/test-all.sh
  • Additional verification (please describe):

Checklist

  • I updated documentation where applicable.
  • I added or updated tests (or none were needed).
  • I updated CHANGELOG.md (or this change does not warrant a changelog entry).

Screenshots (if UI-related)

Related issues

Improves the AgentRouter by implementing __getattr__ to automatically delegate any unknown attribute or method access to the attached agent. This eliminates the need for explicit delegation methods for agent functionalities like `ai()`, `call()`, `memory`, `note()`, and `discover()`.

This change simplifies the AgentRouter's interface and makes it more transparently proxy agent methods. Added tests to verify the automatic delegation for various agent methods and property access, as well as error handling when no agent is attached.
@santoshkumarradha
Copy link
Member Author

Why 🥺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants