Skip to content

AnthropicModel

Namespace: E2E

public sealed class AnthropicModel : IAgentModel, IDisposable

Anthropic Messages API client. The system prompt and the newest message carry cache breakpoints, as upstream marks them, so each turn of a tool loop reads the previous turn’s prefix from the cache.

Inheritance: object

Implements: IAgentModel, IDisposable

View source

AnthropicModel(AnthropicModelOptions, HttpClient?)

Section titled “AnthropicModel(AnthropicModelOptions, HttpClient?)”
public AnthropicModel(AnthropicModelOptions options, HttpClient? httpClient = null)

Parameters

Name Type Description
options AnthropicModelOptions
httpClient HttpClient

View source

public string Name { get; }

Provider and model id, printed in the run summary. Changing it does not miss the replay cache.

Value: string

View source

CompleteAsync(ModelRequest, CancellationToken)

Section titled “CompleteAsync(ModelRequest, CancellationToken)”
public Task<ModelResponse> CompleteAsync(ModelRequest request, CancellationToken cancellationToken)

Parameters

Name Type Description
request ModelRequest
cancellationToken CancellationToken

Returns: Task<ModelResponse>

View source

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View source