Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix Agent construction sample consistency #4505

Description

@westey-m

Currently, we have two ways of constructing agents in samples:

// way 1
new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
    .GetChatClient(deploymentName)
    .AsIChatClient()
    .AsAIAgent("You are a helpful assistant");

// way 2
new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
    .GetChatClient(deploymentName)
    .AsAIAgent("You are a helpful assistant");

Which way is used has implications for the required dependencies, since the relevant extension methods live in different package.
To make things simpler for users, we should consistently follow pattern 2, since it reduces the number of lines of code and reduces the number of required dependencies as well.

Metadata

Metadata

Assignees

Labels

.NETUsage: [Issues, PRs], Target: .NetagentsUsage: [Issues, PRs], Target: Single agentdocumentationUsage: [Issues, PRs], Target: documentation in the code base and learn docs

Type

Fields

No fields configured for Task.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions