Table of Contents

Class AnthropicClientAgent

Namespace
AutoGen.Anthropic
Assembly
AutoGen.Anthropic.dll
public class AnthropicClientAgent : IStreamingAgent, IAgent, IAgentMetaInformation
Inheritance
AnthropicClientAgent
Implements
Inherited Members
Extension Methods

Constructors

AnthropicClientAgent(AnthropicClient, string, string, string, decimal, int, Tool[]?, ToolChoice?)

public AnthropicClientAgent(AnthropicClient anthropicClient, string name, string modelName, string systemMessage = "You are a helpful AI assistant", decimal temperature = 0.7, int maxTokens = 1024, Tool[]? tools = null, ToolChoice? toolChoice = null)

Parameters

anthropicClient AnthropicClient
name string
modelName string
systemMessage string
temperature decimal
maxTokens int
tools Tool[]
toolChoice ToolChoice

Properties

Name

public string Name { get; }

Property Value

string

Methods

GenerateReplyAsync(IEnumerable<IMessage>, GenerateReplyOptions?, CancellationToken)

Generate reply

public Task<IMessage> GenerateReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? options = null, CancellationToken cancellationToken = default)

Parameters

messages IEnumerable<IMessage>

conversation history

options GenerateReplyOptions

completion option. If provided, it should override existing option if there's any

cancellationToken CancellationToken

Returns

Task<IMessage>

GenerateStreamingReplyAsync(IEnumerable<IMessage>, GenerateReplyOptions?, CancellationToken)

public IAsyncEnumerable<IMessage> GenerateStreamingReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? options = null, CancellationToken cancellationToken = default)

Parameters

messages IEnumerable<IMessage>
options GenerateReplyOptions
cancellationToken CancellationToken

Returns

IAsyncEnumerable<IMessage>