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 AGS ComponentFactory spec to add provider class #4388

Open
Tracked by #4006
victordibia opened this issue Nov 26, 2024 · 1 comment
Open
Tracked by #4006

Improve AGS ComponentFactory spec to add provider class #4388

victordibia opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
needs-design A design needs to be created and agreed upo proj-studio Related to AutoGen Studio.
Milestone

Comments

@victordibia
Copy link
Collaborator

victordibia commented Nov 26, 2024

AGS component spec currently has a broad component_type attribute that is used to determine the class needed to load the spec.

{
      "component_type": "agent",
      "name": "assistant_agent",
      "agent_type": "AssistantAgent",
      "system_message": "You are a helpful assistant. Solve tasks carefully.",
      "model_client": {
        "component_type": "model",
        "model": "gpt-4o-mini",
        "model_type": "OpenAIChatCompletionClient"
      }
    }

The limitation here is that component_factory needs to include logic for importing the right class needed to instantiate runtime objects for the component.

This could simplify the process of supporting new component types - i.e. component_factory will automatically attempt to load the class using the args provided.
It would perhaps be useful to expand the spec such that information about how to load the component is self contained in the spec.

{
    "component_provider": {
        "python": "autogen_agentchat.agents.AssistantAgent"
    },
    "name": "assistant_agent",
    "agent_type": "AssistantAgent",
    "system_message": "You are a helpful assistant. Solve tasks carefully.",
    "model_client": {
         "component_provider": {
        "python": "autogen_ext.models.OpenAIChatCompletionClient"
    },
        "model": "gpt-4o-mini",
        "model_type": "OpenAIChatCompletionClient"
    }
}
 

Design Issues

Some components needs custom logic to map from declarative spec to runtime instances e.g.,

  • parsing the representation of combinations of termination conditions
  • adding default behaviours e.g., default system messages if none provided etc

In these cases, the benefit of an expanded spec is reduced (adds bloat to the spec) and perhaps can only be used for some validation (e.g., verifying that the intended class exists etc).

Discussions welcome.

@victordibia victordibia added needs-design A design needs to be created and agreed upo and removed needs-triage labels Nov 26, 2024
@victordibia victordibia self-assigned this Nov 26, 2024
@victordibia victordibia added the proj-studio Related to AutoGen Studio. label Nov 26, 2024
@victordibia victordibia added this to the 0.4.1 milestone Nov 26, 2024
@jackgerrits
Copy link
Member

Essentially the same way we want to handle model client provider loading, I like it! #3624

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-design A design needs to be created and agreed upo proj-studio Related to AutoGen Studio.
Projects
None yet
Development

No branches or pull requests

2 participants