Migrate from Anthropic.SDK to official Anthropic package (#1083)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
parent
20d726bfdf
commit
f9239b0fb7
1 changed files with 5 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using Anthropic.SDK;
|
||||
using Anthropic;
|
||||
using Microsoft.Extensions.AI;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
|
@ -41,8 +41,8 @@ foreach (var tool in tools)
|
|||
Console.WriteLine($"Connected to server with tools: {tool.Name}");
|
||||
}
|
||||
|
||||
using var anthropicClient = new AnthropicClient(new APIAuthentication(builder.Configuration["ANTHROPIC_API_KEY"]))
|
||||
.Messages
|
||||
using var anthropicClient = new AnthropicClient(new() { APIKey = builder.Configuration["ANTHROPIC_API_KEY"] })
|
||||
.AsIChatClient("claude-haiku-4-5-20251001")
|
||||
.AsBuilder()
|
||||
.UseFunctionInvocation()
|
||||
.Build();
|
||||
|
|
|
|||
Loading…
Reference in a new issue