Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve factory pattern for agent workflows #436

Open
jenna-winkler opened this issue Feb 28, 2025 · 1 comment
Open

Improve factory pattern for agent workflows #436

jenna-winkler opened this issue Feb 28, 2025 · 1 comment
Assignees
Labels
python Python related functionality

Comments

@jenna-winkler
Copy link
Contributor

Description

The current factory method for agent workflows in Python lacks clarity in naming and structure. In the current implementation, agents are created and configured using AgentFactoryInput, which is passed to the add_agent method of the AgentWorkflow. A few concerns with this:

  1. The class AgentFactoryInput is misleading because it suggests it is responsible for creating agents when it only holds the necessary data to configure an agent

  2. The add_agent method both creates and adds agents to the workflow which conflates two different responsibilities

  3. The current implementation is a 1:1 match with TypeScript - we need to make it more Pythonic

Possible solutions

  1. Rename AgentFactoryInput to AgentConfig ?
  2. Separate add_agent method out to 2 methods: add + create
@jenna-winkler jenna-winkler added the python Python related functionality label Feb 28, 2025
@ajbozarth
Copy link
Member

See the fix in #476
I've also reopened #385 to make those updates to the other prublic APIs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python related functionality
Projects
None yet
Development

No branches or pull requests

4 participants