Skip to content

Python: [Issue]: Do we have any Python samples showing how to use agents as tools with Azure AI V2 (azure-ai-projects 2.x)? #3101

@AjitPadhi-Microsoft

Description

@AjitPadhi-Microsoft

Language

Python

Type of Issue

Question

Microsoft.Agents.AI

No response

Microsoft.Agents.AI.Abstractions

No response

Microsoft.Agents.AI.OpenAI

No response

Microsoft.Agents.AI.AzureAI

No response

Microsoft.Agents.AI.Anthropic

No response

Microsoft.Agents.AI.Hosting

No response

Microsoft.Agents.AI.Workflows

No response

Other .NET Packages

No response

agent-framework-core

1.0.0b251120

agent-framework-azure-ai

No response

agent-framework-anthropic

No response

agent-framework-azurefunctions

No response

Other Python Packages

No response

Description

Do we have any Python samples showing how to use agents as tools like AzureAISearchAgentTool, FunctionTool with Azure AI V2 (azure-ai-projects 2.x)?

Code Sample

async with ChatAgent(
                    chat_client=AzureAIClient(
                        project_client=client,
                        agent_name=chat_agent_name,
                        use_latest_version=True,
                    ),
                    model=model_deployment_name,
                    tools=[
                        ChatAgent(
                            chat_client=AzureAIClient(
                                project_client=client,
                                agent_name=policy_agent_name,
                                use_latest_version=True,
                            ),
                            model=model_deployment_name,
                        ).as_tool(name="policy_agent"),
                        ChatAgent(
                            chat_client=AzureAIClient(
                                project_client=client,
                                agent_name=product_agent_name,
                                use_latest_version=True,
                            ),
                            model=model_deployment_name,
                        ).as_tool(name="product_agent"),
                    ],
                    # add agent here for tools
                    tool_choice="auto",
                ) as chat_agent:

Additional Context

No response

Metadata

Metadata

Assignees

Labels

pythonquestionFurther information is requestedsamplesIssue relates to the samplesv1.0Features being tracked for the version 1.0 GA

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions