Skip to content

Python: Bug: Declarative agent creation doesn't pass args through #12770

@sun-ming-fujitsu

Description

@sun-ming-fujitsu

Describe the bug
If a AzureChatPromptExecutionSettings object is passed to AgentRegistry.create_from_yaml, the settings don't work.

To Reproduce
Steps to reproduce the behavior:

  1. Create AzureChatPromptExecutionSettings and set the response format

    class StructuredResult(BaselModel):
    ...

    settings = AzureChatPromtExecutionSettings()
    settings.response_format = StructuredResult

  2. Pass the settings to AgentRegistry.create_from_yaml

agent: ChatCompletionAgent = await AgentRegistry.create_from_yaml(AGENT_YAML, kenel=kernel, plugins=agent_instances, service=AzureChatCompletion(api=api, endpoint=endpoint, deployment_name=deployment_name), settings=settings)

Expected behavior
The results of agent should be as StructuredResult, but not.

Platform

  • Language: [Python]
  • Source: [version 1.34.0]
  • AI model: [gpt-4o-global-2024-08-06]
  • IDE: [VS Code]
  • OS: [Windows]

Additional context
The AzureChatPromtExecutionSettings works when passing it to ChatCompletionAgent as follows.

agent = ChatCompletionAgent(service=AzureChatCompletion(api=api, endpoint=endpoint, deployment_name=deployment_name) , name="..." , kernel=kernel, instructions="...", plugins=[...], arguments=KernelArguments(settings=settings))

Metadata

Metadata

Assignees

Labels

agentsbugSomething isn't workingpythonPull requests for the Python Semantic Kernel

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions