Upgrade Anthropic.SDK to 4.7.1 (#86)

Tweak AnthropicTools sample prompt
This commit is contained in:
Peder Holdgaard Pedersen 2025-03-16 04:07:45 +01:00 • committed by GitHub
commit 63b24a4036
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Anthropic.SDK" Version="4.4.3" /> <PackageReference Include="Anthropic.SDK" Version="4.7.1" />
<PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.0-preview.1.25080.5" /> <PackageReference Include="System.Linq.AsyncEnumerable" Version="10.0.0-preview.1.25080.5" />
</ItemGroup> </ItemGroup>

View file

@ -62,7 +62,7 @@ internal class Program
var messages = new List<Message> var messages = new List<Message>
{ {
new Message(RoleType.User, "Please call the echo tool with the string 'Hello MCP!' and give me the response as-is.") new Message(RoleType.User, "Please call the echo tool with the string 'Hello MCP!' and show me the echoed response.")
}; };
var parameters = new MessageParameters() var parameters = new MessageParameters()
@ -71,9 +71,9 @@ internal class Program
MaxTokens = 2048, MaxTokens = 2048,
Model = AnthropicModels.Claude35Haiku, Model = AnthropicModels.Claude35Haiku,
Stream = false, Stream = false,
Temperature = 1.0m, Temperature = 0.5m,
Tools = anthropicTools, Tools = anthropicTools,
System = [new SystemMessage("You will be helping the user test MCP server tool call functionality.")] System = [new SystemMessage("You will be helping the user test MCP server tool call functionality. Remember that the user cannot see your tool calls or tool results.")]
}; };
// If the server provides instructions, add them as the system prompt // If the server provides instructions, add them as the system prompt