Skip to content

Fix Agent construction sample consistency #4505

@westey-m

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

.NETagentsIssues related to single agentsdocumentationImprovements or additions to documentationsamplesIssue relates to the samplesv1.0Features being tracked for the version 1.0 GA

Type

Projects

Status

Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions