Skip to main content
net8.0.NETStandard2.0

Semantic Kernel connectors for Anthropic generation platforms. Contains generation services.

Published
Oct 29, 2024
2y ago
Total Downloads
30.7K
30,724

Install

dotnet add package Lost.SemanticKernel.Connectors.Anthropic --version 1.25.0-alpha3
ProductVersions
.NET
net8.0
.NET Standard
netstandard2.0

README

Computer Tool Use

Example

var chatHistory = new ChatHistory();
chatHistory.AddUserMessage("Get mouse coordinates, and tell me x+y as a single number, e.g. '1234'");

var sut = new AnthropicChatCompletionService("claude-3-5-sonnet-20241022", API_KEY, new(beta: ComputerUse_2024_10_22.Beta));

var kernel = new Kernel();
kernel.Plugins.Add(ComputerUse_2024_10_22.ComputerPlugin(new NoOpComputer() // plug your own
{
    CursorPosition = (120, 121),
}));

var response = await sut.GetChatMessageContentAsync(chatHistory, kernel: kernel,
                                                    executionSettings: new AnthropicPromptExecutionSettings()
                                                    {
                                                        MaxTokens = AnthropicPromptExecutionSettings.DefaultTextMaxTokens,
                                                        // invoke functions automatically
                                                        FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(),
                                                    });


Debug.Assert(response.Content?.EndsWith("241", StringComparison.InvariantCulture));

Semantic Kernel Overview

Changes from Previous Version

v1.22.0-alpha0v1.25.0-alpha3

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 2 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.