Skip to content

In the section Add the app code - The ChatClientBuilder requires are constructor parameter #45516

@anuraj

Description

@anuraj

Type of issue

Typo

Description

Current code is like this

IChatClient client =
    new ChatClientBuilder()
        .UseFunctionInvocation()
        .Use(
            new AzureOpenAIClient(new Uri(endpoint),
            new DefaultAzureCredential())
                .AsChatClient(deployment));

But it won't compile. We need to use something like this.

IChatClient chatClient =
    new AzureOpenAIClient(new Uri(endpoint), new DefaultAzureCredential())
        .AsChatClient(deployment);

IChatClient client = new ChatClientBuilder(chatClient)
        .UseFunctionInvocation()
        .Build();

Page URL

https://learn.microsoft.com/en-us/dotnet/ai/quickstarts/use-function-calling?tabs=azd

Content source URL

https://github.com/dotnet/docs/blob/main/docs/ai/quickstarts/use-function-calling.md

Document Version Independent Id

7228f348-6649-a87d-bae5-4a70817c03bb

Platform Id

5a517f05-b64b-c471-b99d-72253c213be1

Article author

@fboucher

Metadata

  • ID: 27e2bbca-36b0-3883-11f7-321c044ee29a
  • PlatformId: 5a517f05-b64b-c471-b99d-72253c213be1
  • Service: dotnet
  • Sub-service: intelligent-apps

Related Issues

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions