"summary":"Class AnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public class AnthropicApiClient : IAnthropicApiClient Inheritance object AnthropicApiClient Implements IAnthropicApiClient Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicApiClient(string, HttpClient) Initializes a new instance of the AnthropicApiClient class. public AnthropicApiClient(string apiKey, HttpClient httpClient) Parameters apiKey string The API key to use for the client. httpClient HttpClient The HTTP client to use for the client. Exceptions ArgumentNullException Thrown when the API key or HTTP client is null. Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. public Task<AnthropicResult<MessageBatchResponse>> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task<AnthropicResult<MessageBatchResponse>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. public Task<AnthropicResult<TokenCountResponse>> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task<AnthropicResult<TokenCountResponse>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is TokenCountResponse. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. public Task<AnthropicResult<MessageResponse>> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task<AnthropicResult<MessageResponse>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T>. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. public IAsyncEnumerable<AnthropicEvent> CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable<AnthropicEvent> An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. public Task<AnthropicResult<MessageBatchResponse>> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task<AnthropicResult<MessageBatchResponse>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is MessageBatchResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. public Task<AnthropicResult<MessageBatchDeleteResponse>> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous
"summary":"Class AnthropicError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an error response from the Anthropic API. public class AnthropicError Inheritance object AnthropicError Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicError(Error) Initializes a new instance of the AnthropicError class. public AnthropicError(Error error) Parameters error Error The error as an Error object. Properties Error The error object. public Error Error { get; init; } Property Value Error Type The type of the error. public string Type { get; init; } Property Value string"
"summary":"Class AnthropicEvent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an event from the Anthropic API. public class AnthropicEvent Inheritance object AnthropicEvent Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicEvent(string, EventData) Initializes a new instance of the AnthropicEvent class. public AnthropicEvent(string type, EventData data) Parameters type string The type of the event. data EventData The data associated with the event. Properties Data The data associated with the event. public EventData Data { get; init; } Property Value EventData Type The type of the event. public string Type { get; init; } Property Value string"
"summary":"Class AnthropicFunction Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a function that can be provided as a tool. public class AnthropicFunction Inheritance object AnthropicFunction Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Instance Gets the instance on which the method is invoked. public object? Instance { get; } Property Value object Method Gets the method of the function. public MethodInfo Method { get; } Property Value MethodInfo"
"summary":"Class AnthropicHeaders Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents headers included in Anthropic API responses. public class AnthropicHeaders Inheritance object AnthropicHeaders Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicHeaders(HttpResponseHeaders) Initializes a new instance of the AnthropicHeaders class. public AnthropicHeaders(HttpResponseHeaders headers) Parameters headers HttpResponseHeaders The HTTP response headers. Properties RateLimitRequestsLimit Gets the rate limit requests limit. public int RateLimitRequestsLimit { get; init; } Property Value int RateLimitRequestsRemaining Gets the rate limit requests remaining. public int RateLimitRequestsRemaining { get; init; } Property Value int RateLimitRequestsReset Gets the time of the rate limit requests reset. public DateTimeOffset RateLimitRequestsReset { get; init; } Property Value DateTimeOffset RateLimitTokensLimit Gets the rate limit tokens limit. public int RateLimitTokensLimit { get; init; } Property Value int RateLimitTokensRemaining Gets the rate limit tokens remaining. public int RateLimitTokensRemaining { get; init; } Property Value int RateLimitTokensReset Gets the time of the rate limit tokens reset. public DateTimeOffset RateLimitTokensReset { get; init; } Property Value DateTimeOffset RequestId Gets the request ID. public string RequestId { get; init; } Property Value string RetryAfter Gets the retry after value. public int RetryAfter { get; init; } Property Value int"
"summary":"Class AnthropicModel Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an Anthropic model. public class AnthropicModel Inheritance object AnthropicModel Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties CreatedAt The created date of the model. [JsonPropertyName(\"created_at\")] public DateTimeOffset CreatedAt { get; init; } Property Value DateTimeOffset DisplayName The display name of the model. [JsonPropertyName(\"display_name\")] public string DisplayName { get; init; } Property Value string Id The id of the model. public string Id { get; init; } Property Value string Type The type of the model. public string Type { get; init; } Property Value string"
"summary":"Class AnthropicModels Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for the Anthropic models. public static class AnthropicModels Inheritance object AnthropicModels Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Claude35Haiku20241022 The Claude 3.5 Haiku model. public const string Claude35Haiku20241022 = \"claude-3-5-haiku-20241022\" Field Value string Claude35HaikuLatest The Claude 3.5 Haiku model. public const string Claude35HaikuLatest = \"claude-3-5-haiku-latest\" Field Value string Claude35Sonnet The Claude 3.5 Sonnet model. public const string Claude35Sonnet = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20240620 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20240620 = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20241022 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20241022 = \"claude-3-5-sonnet-20241022\" Field Value string Claude35SonnetLatest The Claude 3.5 Sonnet model. public const string Claude35SonnetLatest = \"claude-3-5-sonnet-latest\" Field Value string Claude3Haiku The Claude 3 Haiku model. public const string Claude3Haiku = \"claude-3-haiku-20240307\" Field Value string Claude3Haiku20240307 The Claude 3 Haiku model. public const string Claude3Haiku20240307 = \"claude-3-haiku-20240307\" Field Value string Claude3Opus The Claude 3 Opus model. public const string Claude3Opus = \"claude-3-opus-20240229\" Field Value string Claude3Opus20241022 The Claude 3 Opus model. public const string Claude3Opus20241022 = \"claude-3-opus-20240229\" Field Value string Claude3OpusLatest The Claude 3 Opus model. public const string Claude3OpusLatest = \"claude-3-opus-latest\" Field Value string Claude3Sonnet The Claude 3 Sonnet model. public const string Claude3Sonnet = \"claude-3-sonnet-20240229\" Field Value string Claude3Sonnet20240229 The Claude 3 Sonnet model. public const string Claude3Sonnet20240229 = \"claude-3-sonnet-20240229\" Field Value string"
"summary":"Class AnyToolChoice Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the any tool choice mode. public class AnyToolChoice : ToolChoice Inheritance object ToolChoice AnyToolChoice Inherited Members ToolChoice.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnyToolChoice() Initializes a new instance of the AnyToolChoice class. public AnyToolChoice()"
"summary":"Class ApiError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an api_error response from the Anthropic API. public class ApiError : Error Inheritance object Error ApiError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ApiError(string) Initializes a new instance of the ApiError class. public ApiError(string message) Parameters message string The error message."
"summary":"Class AuthenticationError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an authentication_error response from the Anthropic API. public class AuthenticationError : Error Inheritance object Error AuthenticationError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AuthenticationError(string) Initializes a new instance of the AuthenticationError class. public AuthenticationError(string message) Parameters message string The error message."
"summary":"Class AutoToolChoice Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the auto tool choice mode. public class AutoToolChoice : ToolChoice Inheritance object ToolChoice AutoToolChoice Inherited Members ToolChoice.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AutoToolChoice() Initializes a new instance of the AutoToolChoice class. public AutoToolChoice()"
"summary":"Class BaseMessageRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message request. public abstract class BaseMessageRequest Inheritance object BaseMessageRequest Derived MessageRequest StreamMessageRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors BaseMessageRequest(string, List<Message>, int, string?, Dictionary<string, object>?, decimal, int?, decimal?, ToolChoice?, List<Tool>?, bool, List<string>?, List<TextContent>?) Initializes a new instance of the BaseMessageRequest class. protected BaseMessageRequest(string model, List<Message> messages, int maxTokens, string? system, Dictionary<string, object>? metadata, decimal temperature, int? topK, decimal? topP, ToolChoice? toolChoice, List<Tool>? tools, bool stream, List<string>? stopSequences, List<TextContent>? systemMessages) Parameters model string The model ID to use for the request. messages List<Message> The messages to send to the model. maxTokens int The maximum number of tokens to generate. system string The system prompt to use for the request. metadata Dictionary<string, object> The metadata to include with the request. temperature decimal The temperature to use for the request. topK int? The top-K value to use for the request. topP decimal? The top-P value to use for the request. toolChoice ToolChoice The tool choice mode to use for the request. tools List<Tool> The tools to use for the request. stream bool A value indicating whether the message should be streamed. stopSequences List<string> The prompt stop sequences. systemMessages List<TextContent> The system messages to use for the request. Exceptions ArgumentNullException Thrown when the model or messages is null. ArgumentException Thrown when the messages contain no messages. ArgumentException Thrown when the max tokens is less than one. ArgumentException Thrown when the temperature is less than zero or greater than one. Properties MaxTokens Gets the maximum number of tokens to generate. [JsonPropertyName(\"max_tokens\")] public int MaxTokens { get; init; } Property Value int Messages Gets the messages to send to the model. public List<Message> Messages { get; init; } Property Value List<Message> Metadata Gets the metadata to include with the request. public Dictionary<string, object>? Metadata { get; init; } Property Value Dictionary<string, object> Model Gets the model ID to use for the request. public string Model { get; init; } Property Value string StopSequences Gets the prompt stop sequences. [JsonPropertyName(\"stop_sequences\")] public List<string> StopSequences { get; init; } Property Value List<string> Stream Gets a value indicating whether the message should be streamed. public bool Stream { get; init; } Property Value bool System Gets the system message that will be used as the system prompt if no system messages are provided. [JsonIgnore] public string? System { get; init; } Property Value string SystemMessages Gets the system messages to send to the model to be used as the system prompt. [JsonIgnore] public List<TextContent>? SystemMessages { get; init; } Property Value List<TextContent> SystemPrompt Gets the system prompt that will be used for the request. If will return the system messages if they are provided, otherwise it will return the system message. If neither are provided, it will return null. [JsonPropertyName(\"system\")] public List<TextContent>? SystemPrompt { get; } Property Value List<TextContent> Temperature Gets the temperature to use for the request. public decimal Temperature { get; init; } Property Value decimal ToolChoice Gets the tool choice mode to use for the request. [JsonPropertyName(\"tool_choice\")] public ToolChoice? ToolChoice { get; init; } Property Value ToolChoice Tools Gets the tools to use for the request. public List<Tool>? Tools { get; init; } Property Value List<Tool> TopK Gets the top-K value to use for the request. public int? TopK { get; init;
"summary": "ClassCacheControlTypeNamespaceAnthropicClient.ModelsAssemblyAnthropicClient.dllProvidesconstantsforcachecontroltypes.publicstaticclassCacheControlTypeInheritanceobjectCacheControlTypeInheritedMembersobject.Equals(object)object.Equals(object,object)object.GetHashCode()object.GetType()object.MemberwiseClone()object.ReferenceEquals(object,object)object.ToString()FieldsEphemeralThecachecontroltypeforanephemeralcache.publicconststringEphemeral=\"ephemeral\" Field Value string"
"summary":"Class CanceledMessageBatchResult Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result that was cancelled. public class CanceledMessageBatchResult : MessageBatchResult Inheritance object MessageBatchResult CanceledMessageBatchResult Inherited Members MessageBatchResult.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors CanceledMessageBatchResult() Initializes a new instance of the CanceledMessageBatchResult class. public CanceledMessageBatchResult()"
"summary":"Class Content Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents part of the content of a message. public abstract class Content Inheritance object Content Derived DocumentContent ImageContent TextContent ToolResultContent ToolUseContent Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors Content(string) Initializes a new instance of the Content class. protected Content(string type) Parameters type string The type of the content. Content(string, CacheControl) Initializes a new instance of the Content class. protected Content(string type, CacheControl cacheControl) Parameters type string The type of the content. cacheControl CacheControl The cache control to be used for the content. Properties CacheControl Gets the cache control to be used for the content. [JsonPropertyName(\"cache_control\")] public CacheControl? CacheControl { get; set; } Property Value CacheControl Type Gets the type of the content. public string Type { get; init; } Property Value string"
"summary":"Class ContentDelta Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a content delta. public abstract class ContentDelta Inheritance object ContentDelta Derived JsonDelta TextDelta Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ContentDelta(string) Initializes a new instance of the ContentDelta class. protected ContentDelta(string type) Parameters type string The type of the content delta. Properties Type Gets the type of the content delta. public string Type { get; init; } Property Value string"
"summary":"Class ContentDeltaEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a content_block_delta event. public class ContentDeltaEventData : EventData Inheritance object EventData ContentDeltaEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ContentDeltaEventData(int, ContentDelta) Initializes a new instance of the ContentDeltaEventData class. public ContentDeltaEventData(int index, ContentDelta delta) Parameters index int The index of the content block. delta ContentDelta The content delta. Properties Delta Gets the content delta. public ContentDelta Delta { get; init; } Property Value ContentDelta Index Gets the index of the content block. public int Index { get; init; } Property Value int"
"summary":"Class ContentDeltaType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for content delta types. public static class ContentDeltaType Inheritance object ContentDeltaType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields JsonDelta The input_json_delta. public const string JsonDelta = \"input_json_delta\" Field Value string TextDelta The text_delta. public const string TextDelta = \"text_delta\" Field Value string"
"summary":"Class ContentStartEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a content_block_start event. public class ContentStartEventData : EventData Inheritance object EventData ContentStartEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ContentStartEventData(int, Content) Initializes a new instance of the ContentStartEventData class. public ContentStartEventData(int index, Content contentBlock) Parameters index int The index of the content block. contentBlock Content The content block. Properties ContentBlock Gets the content block. [JsonPropertyName(\"content_block\")] public Content ContentBlock { get; init; } Property Value Content Index Gets the index of the content block. public int Index { get; init; } Property Value int"
"summary":"Class ContentStopEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a content_block_stop event. public class ContentStopEventData : EventData Inheritance object EventData ContentStopEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ContentStopEventData(int) Initializes a new instance of the ContentStopEventData class. public ContentStopEventData(int index) Parameters index int The index of the content block. Properties Index Gets the index of the content block. public int Index { get; init; } Property Value int"
"summary":"Class ContentType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the content type. public static class ContentType Inheritance object ContentType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Document Represents the document content type. public const string Document = \"document\" Field Value string Image Represents the image content type. public const string Image = \"image\" Field Value string Text Represents the text content type. public const string Text = \"text\" Field Value string ToolResult Represents the tool result content type. public const string ToolResult = \"tool_result\" Field Value string ToolUse Represents the tool use content type. public const string ToolUse = \"tool_use\" Field Value string"
"summary":"Class CountMessageTokensRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a request to count the number of tokens in a message. public class CountMessageTokensRequest Inheritance object CountMessageTokensRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors CountMessageTokensRequest(string, List<Message>, ToolChoice?, List<Tool>?, List<TextContent>?) Initializes a new instance of the CountMessageTokensRequest class. public CountMessageTokensRequest(string model, List<Message> messages, ToolChoice? toolChoice = null, List<Tool>? tools = null, List<TextContent>? systemPrompt = null) Parameters model string The model ID to use for the request. messages List<Message> The messages to count the number of tokens in. toolChoice ToolChoice The tool choice mode to use for the request. tools List<Tool> The tools to use for the request. systemPrompt List<TextContent> The system prompt to use for the request. Exceptions ArgumentNullException Thrown when model or messages is null. ArgumentException Thrown when messages is empty. Properties Messages Gets the messages to count the number of tokens in. public List<Message> Messages { get; init; } Property Value List<Message> Model Gets the model ID to be used for the request. public string Model { get; init; } Property Value string SystemPrompt Gets the system prompt to use for the request. [JsonPropertyName(\"system\")] public List<TextContent>? SystemPrompt { get; init; } Property Value List<TextContent> ToolChoice Gets the tool choice mode to use for the request. [JsonPropertyName(\"tool_choice\")] public ToolChoice? ToolChoice { get; init; } Property Value ToolChoice Tools Gets the tools to use for the request. public List<Tool>? Tools { get; init; } Property Value List<Tool>"
"summary":"Class DocumentContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents content from a document that is part of a message. public class DocumentContent : Content Inheritance object Content DocumentContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors DocumentContent(string, string) Initializes a new instance of the DocumentContent class. public DocumentContent(string mediaType, string data) Parameters mediaType string The media type of the document. data string The data of the document. Exceptions ArgumentNullException Thrown when the media type or data is null. DocumentContent(string, string, CacheControl) Initializes a new instance of the DocumentContent class. public DocumentContent(string mediaType, string data, CacheControl cacheControl) Parameters mediaType string The media type of the document. data string The data of the document. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the media type, data, or cache control is null. Properties Source Gets the source of the document. public DocumentSource Source { get; init; } Property Value DocumentSource"
"summary":"Class DocumentSource Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a document source. public class DocumentSource Inheritance object DocumentSource Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors DocumentSource(string, string) Initializes a new instance of the DocumentSource class. public DocumentSource(string mediaType, string data) Parameters mediaType string The media type of the document. data string The data of the document. Exceptions ArgumentException Thrown when the media type is invalid. ArgumentNullException Thrown when the media type or data is null. Properties Data Gets the data of the document. public string Data { get; init; } Property Value string MediaType Gets the media type of the document. [JsonPropertyName(\"media_type\")] public string MediaType { get; init; } Property Value string Type Gets the type of encoding of the document data. public string Type { get; init; } Property Value string"
"summary":"Class EphemeralCacheControl Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the cache control to be used for content. public class EphemeralCacheControl : CacheControl Inheritance object CacheControl EphemeralCacheControl Inherited Members CacheControl.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors EphemeralCacheControl() Initializes a new instance of the EphemeralCacheControl class. public EphemeralCacheControl()"
"summary":"Class Error Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an error. public abstract class Error Inheritance object Error Derived ApiError AuthenticationError InvalidRequestError NotFoundError OverloadedError PermissionError RateLimitError Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors Error(string) Initializes a new instance of the Error class. protected Error(string type) Parameters type string The type of the error. Properties Message Gets the message of the error. public string Message { get; init; } Property Value string Type Gets the type of the error. public string Type { get; init; } Property Value string"
"summary":"Class ErrorEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for an error event. public class ErrorEventData : EventData Inheritance object EventData ErrorEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ErrorEventData(Error) Initializes a new instance of the ErrorEventData class. public ErrorEventData(Error error) Parameters error Error The error. Properties Error Gets the error. public Error Error { get; init; } Property Value Error"
"summary":"Class ErrorType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the error type. public class ErrorType Inheritance object ErrorType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields ApiError Represents the api_error type. public const string ApiError = \"api_error\" Field Value string AuthenticationError Represents the authentication_error type. public const string AuthenticationError = \"authentication_error\" Field Value string InvalidRequestError Represents the invalid_request error type. public const string InvalidRequestError = \"invalid_request_error\" Field Value string NotFoundError Represents the not_found_error type. public const string NotFoundError = \"not_found_error\" Field Value string OverloadedError Represents the overloaded_error type. public const string OverloadedError = \"overloaded_error\" Field Value string PermissionError Represents the permission_error type. public const string PermissionError = \"permission_error\" Field Value string RateLimitError Represents the rate_limit_error type. public const string RateLimitError = \"rate_limit_error\" Field Value string"
"summary":"Class ErroredMessageBatchResult Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result that contains an error response. public class ErroredMessageBatchResult : MessageBatchResult Inheritance object MessageBatchResult ErroredMessageBatchResult Inherited Members MessageBatchResult.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ErroredMessageBatchResult() Initializes a new instance of the ErroredMessageBatchResult class. public ErroredMessageBatchResult() Properties Error Gets the error of the message batch result. public AnthropicError Error { get; init; } Property Value AnthropicError"
"summary":"Class EventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for an event. public abstract class EventData Inheritance object EventData Derived ContentDeltaEventData ContentStartEventData ContentStopEventData ErrorEventData MessageCompleteEventData MessageDeltaEventData MessageStartEventData MessageStopEventData PingEventData Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors EventData(string) Initializes a new instance of the EventData class. protected EventData(string type) Parameters type string The type of the event. Properties Type Gets the type of the event. public string Type { get; init; } Property Value string"
"summary":"Class EventType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for event types. public static class EventType Inheritance object EventType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields ContentBlockDelta Represents the content_block_delta event type. public const string ContentBlockDelta = \"content_block_delta\" Field Value string ContentBlockStart Represents the content_block_start event type. public const string ContentBlockStart = \"content_block_start\" Field Value string ContentBlockStop Represents the content_block_stop event type. public const string ContentBlockStop = \"content_block_stop\" Field Value string Error Represents the error event type. public const string Error = \"error\" Field Value string MessageComplete Represents the message_complete event type. public const string MessageComplete = \"message_complete\" Field Value string MessageDelta Represents the message_delta event type. public const string MessageDelta = \"message_delta\" Field Value string MessageStart Represents the message_start event type. public const string MessageStart = \"message_start\" Field Value string MessageStop Represents the message_stop event type. public const string MessageStop = \"message_stop\" Field Value string Ping Represents the ping event type. public const string Ping = \"ping\" Field Value string"
"summary":"Class ExpiredMessageBatchResult Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result that has expired. public class ExpiredMessageBatchResult : MessageBatchResult Inheritance object MessageBatchResult ExpiredMessageBatchResult Inherited Members MessageBatchResult.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ExpiredMessageBatchResult() Initializes a new instance of the ExpiredMessageBatchResult class. public ExpiredMessageBatchResult()"
"summary":"Class FunctionPropertyAttribute Namespace AnthropicClient.Models Assembly AnthropicClient.dll Attribute to describe a property of a type that is used as a function parameter. [AttributeUsage(AttributeTargets.Property|AttributeTargets.Field)] public class FunctionPropertyAttribute : Attribute Inheritance object Attribute FunctionPropertyAttribute Inherited Members Attribute.Equals(object) Attribute.GetCustomAttribute(Assembly, Type) Attribute.GetCustomAttribute(Assembly, Type, bool) Attribute.GetCustomAttribute(MemberInfo, Type) Attribute.GetCustomAttribute(MemberInfo, Type, bool) Attribute.GetCustomAttribute(Module, Type) Attribute.GetCustomAttribute(Module, Type, bool) Attribute.GetCustomAttribute(ParameterInfo, Type) Attribute.GetCustomAttribute(ParameterInfo, Type, bool) Attribute.GetCustomAttributes(Assembly) Attribute.GetCustomAttributes(Assembly, bool) Attribute.GetCustomAttributes(Assembly, Type) Attribute.GetCustomAttributes(Assembly, Type, bool) Attribute.GetCustomAttributes(MemberInfo) Attribute.GetCustomAttributes(MemberInfo, bool) Attribute.GetCustomAttributes(MemberInfo, Type) Attribute.GetCustomAttributes(MemberInfo, Type, bool) Attribute.GetCustomAttributes(Module) Attribute.GetCustomAttributes(Module, bool) Attribute.GetCustomAttributes(Module, Type) Attribute.GetCustomAttributes(Module, Type, bool) Attribute.GetCustomAttributes(ParameterInfo) Attribute.GetCustomAttributes(ParameterInfo, bool) Attribute.GetCustomAttributes(ParameterInfo, Type) Attribute.GetCustomAttributes(ParameterInfo, Type, bool) Attribute.GetHashCode() Attribute.IsDefaultAttribute() Attribute.IsDefined(Assembly, Type) Attribute.IsDefined(Assembly, Type, bool) Attribute.IsDefined(MemberInfo, Type) Attribute.IsDefined(MemberInfo, Type, bool) Attribute.IsDefined(Module, Type) Attribute.IsDefined(Module, Type, bool) Attribute.IsDefined(ParameterInfo, Type) Attribute.IsDefined(ParameterInfo, Type, bool) Attribute.Match(object) Attribute.TypeId object.Equals(object, object) object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors FunctionPropertyAttribute(string, bool, object?, object[]?) Initializes a new instance of the FunctionPropertyAttribute class. public FunctionPropertyAttribute(string description, bool required = false, object? defaultValue = null, object[]? possibleValues = null) Parameters description string Description of the property. required bool Whether the property is required. defaultValue object Default value of the property. possibleValues object[] Possible values of the property. Properties DefaultValue Default value of the property. public object? DefaultValue { get; } Property Value object Description Description of the property. public string Description { get; } Property Value string PossibleValues Possible values of the property. public object[]? PossibleValues { get; } Property Value object[] Required Whether the property is required. public bool Required { get; } Property Value bool"
"summary":"Interface ITool Namespace AnthropicClient.Models Assembly AnthropicClient.dll Interface that a class can implement to be used to create a tool. public interface ITool Properties Description Gets the description of the tool. Should not be null or empty. string Description { get; } Property Value string Function Gets the input schema of the tool. Should not be null. MethodInfo Function { get; } Property Value MethodInfo Name Gets the name of the tool. Should not be null or empty. string Name { get; } Property Value string"
"summary":"Class ImageContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents image content that is part of a message. public class ImageContent : Content Inheritance object Content ImageContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ImageContent(string, string) Initializes a new instance of the ImageContent class. public ImageContent(string mediaType, string data) Parameters mediaType string The media type of the image. data string The data of the image. Exceptions ArgumentNullException Thrown when the media type or data is null. ImageContent(string, string, CacheControl) Initializes a new instance of the ImageContent class. public ImageContent(string mediaType, string data, CacheControl cacheControl) Parameters mediaType string The media type of the image. data string The data of the image. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the media type, data, or cache control is null. Properties Source Gets the source of the image. public ImageSource Source { get; init; } Property Value ImageSource"
"summary":"Class ImageSource Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an image source. public class ImageSource Inheritance object ImageSource Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ImageSource(string, string) Initializes a new instance of the ImageSource class. public ImageSource(string mediaType, string data) Parameters mediaType string The media type of the image. data string The data of the image. Exceptions ArgumentException Thrown when the media type is invalid. ArgumentNullException Thrown when the media type or data is null. Properties Data Gets the data of the image. public string Data { get; init; } Property Value string MediaType Gets the media type of the image. [JsonPropertyName(\"media_type\")] public string MediaType { get; init; } Property Value string Type Gets the type of encoding of the image data. public string Type { get; init; } Property Value string"
"summary":"Class ImageType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the image type. public static class ImageType Inheritance object ImageType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Gif Represents the GIF image type. public const string Gif = \"image/gif\" Field Value string Jpg Represents the JPEG image type. public const string Jpg = \"image/jpeg\" Field Value string Png Represents the PNG image type. public const string Png = \"image/png\" Field Value string Webp Represents the WebP image type. public const string Webp = \"image/webp\" Field Value string"
"summary":"Class InputProperty Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an input property. public class InputProperty Inheritance object InputProperty Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors InputProperty(string, string) Initializes a new instance of the InputProperty class. public InputProperty(string type, string description) Parameters type string The type of the input property. description string The description of the input property. Exceptions ArgumentNullException Thrown when the type or description is null. Properties Description Gets the description of the input property. public string Description { get; init; } Property Value string Type Gets the type of the input property. public string Type { get; init; } Property Value string"
"summary":"Class InputSchema Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an input schema. public class InputSchema Inheritance object InputSchema Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors InputSchema(Dictionary<string, InputProperty>, List<string>) Initializes a new instance of the InputSchema class. public InputSchema(Dictionary<string, InputProperty> properties, List<string> required) Parameters properties Dictionary<string, InputProperty> The properties of the input schema. required List<string> The required properties of the input schema. Exceptions ArgumentNullException Thrown when the properties or required is null. ArgumentException Thrown when the required properties are not present in the properties dictionary. Properties Properties Gets the properties of the input schema. public Dictionary<string, InputProperty> Properties { get; init; } Property Value Dictionary<string, InputProperty> Required Gets the required properties of the input schema. public List<string> Required { get; init; } Property Value List<string> Type Gets the type of the input schema. public string Type { get; init; } Property Value string"
"summary":"Class InvalidRequestError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an invalid_request error. public class InvalidRequestError : Error Inheritance object Error InvalidRequestError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors InvalidRequestError(string) Initializes a new instance of the InvalidRequestError class. public InvalidRequestError(string message) Parameters message string The message of the error."
"summary":"Class Message Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message. public class Message Inheritance object Message Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors Message(string, List<Content>) Initializes a new instance of the Message class. public Message(string role, List<Content> content) Parameters role string The role of the message. content List<Content> The contents of the message. Exceptions ArgumentException Thrown when the role is invalid. ArgumentNullException Thrown when the role or content is null. Properties Content Gets the contents of the message. public List<Content> Content { get; init; } Property Value List<Content> Role Gets the role of the message. public string Role { get; init; } Property Value string"
"summary":"Class MessageBatchDeleteResponse Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch delete response. public class MessageBatchDeleteResponse Inheritance object MessageBatchDeleteResponse Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Id Gets the ID of the message batch that was deleted. public string Id { get; init; } Property Value string Type Gets the type of the message batch response. public string Type { get; init; } Property Value string"
"summary":"Class MessageBatchRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a request to create a batch of messages. public class MessageBatchRequest Inheritance object MessageBatchRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageBatchRequest(List<MessageBatchRequestItem>) Initializes a new instance of the MessageBatchRequest class. public MessageBatchRequest(List<MessageBatchRequestItem> requests) Parameters requests List<MessageBatchRequestItem> The requests to create messages. Exceptions ArgumentException Thrown when requests is empty. Properties Requests Gets the requests to create messages. public List<MessageBatchRequestItem> Requests { get; init; } Property Value List<MessageBatchRequestItem>"
"summary":"Class MessageBatchRequestCounts Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the counts of requests in a batch of messages. public class MessageBatchRequestCounts Inheritance object MessageBatchRequestCounts Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Canceled Gets the number of requests in the batch that were cancelled. public int Canceled { get; init; } Property Value int Errored Gets the number of requests in the batch that errored. public int Errored { get; init; } Property Value int Expired Gets the number of requests in the batch that expired. public int Expired { get; init; } Property Value int Processing Gets the number of requests in the batch that are processing. public int Processing { get; init; } Property Value int Succeeded Gets the number of requests in the batch that succeeded. public int Succeeded { get; init; } Property Value int"
"summary":"Class MessageBatchRequestItem Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an item in a batch of messages. public class MessageBatchRequestItem Inheritance object MessageBatchRequestItem Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageBatchRequestItem(string, MessageRequest) Initializes a new instance of the MessageBatchRequestItem class. public MessageBatchRequestItem(string customId, MessageRequest messageRequest) Parameters customId string The custom identifier for the message. messageRequest MessageRequest The message request parameters. Exceptions ArgumentException Thrown when customId is null or whitespace. ArgumentException Thrown when messageRequest is null. Properties CustomId Gets the custom identifier for the message. [JsonPropertyName(\"custom_id\")] public string CustomId { get; init; } Property Value string Params Gets the message request parameters. public MessageRequest Params { get; init; } Property Value MessageRequest"
"summary":"Class MessageBatchResponse Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a response to a batch of messages. public class MessageBatchResponse Inheritance object MessageBatchResponse Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties ArchivedAt Gets the date and time when the batch was archived. [JsonPropertyName(\"archived_at\")] public DateTimeOffset? ArchivedAt { get; init; } Property Value DateTimeOffset? CancelInitiatedAt Gets the date and time when the batch cancellation was initiated. [JsonPropertyName(\"cancel_initiated_at\")] public DateTimeOffset? CancelInitiatedAt { get; init; } Property Value DateTimeOffset? CreatedAt Gets the date and time when the batch was created. [JsonPropertyName(\"created_at\")] public DateTimeOffset CreatedAt { get; init; } Property Value DateTimeOffset EndedAt Gets the date and time when the batch ended. [JsonPropertyName(\"ended_at\")] public DateTimeOffset? EndedAt { get; init; } Property Value DateTimeOffset? ExpiresAt Gets the date and time when the batch expires. [JsonPropertyName(\"expires_at\")] public DateTimeOffset ExpiresAt { get; init; } Property Value DateTimeOffset Id Gets the identifier of the batch. public string Id { get; init; } Property Value string ProcessingStatus Gets the processing status of the batch. [JsonPropertyName(\"processing_status\")] public string ProcessingStatus { get; init; } Property Value string RequestCounts Gets the counts of requests in the batch. [JsonPropertyName(\"request_counts\")] public MessageBatchRequestCounts RequestCounts { get; init; } Property Value MessageBatchRequestCounts ResultsUrl Gets the URL to the results of the batch. [JsonPropertyName(\"results_url\")] public string? ResultsUrl { get; init; } Property Value string Type Gets the type of the batch. public string Type { get; init; } Property Value string"
"summary":"Class MessageBatchResult Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result. public abstract class MessageBatchResult Inheritance object MessageBatchResult Derived CanceledMessageBatchResult ErroredMessageBatchResult ExpiredMessageBatchResult SucceededMessageBatchResult Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageBatchResult(string) Initializes a new instance of the MessageBatchResult class. public MessageBatchResult(string type) Parameters type string The type of the message batch result. Properties Type Gets the type of the message batch result. public string Type { get; init; } Property Value string"
"summary":"Class MessageBatchResultItem Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result item. public class MessageBatchResultItem Inheritance object MessageBatchResultItem Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties CustomId Gets the custom ID of the message batch result item. [JsonPropertyName(\"custom_id\")] public string CustomId { get; init; } Property Value string Result Gets the result of the message batch result item. public MessageBatchResult Result { get; init; } Property Value MessageBatchResult"
"summary":"Class MessageBatchResultType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the types of message batch results. public static class MessageBatchResultType Inheritance object MessageBatchResultType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Canceled Represents a canceled message batch result. public const string Canceled = \"canceled\" Field Value string Errored Represents an errored message batch result. public const string Errored = \"errored\" Field Value string Expired Represents an expired message batch result. public const string Expired = \"expired\" Field Value string Succeeded Represents a succeeded message batch result. public const string Succeeded = \"succeeded\" Field Value string"
"summary":"Class MessageBatchStatus Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the status of a message batch. public static class MessageBatchStatus Inheritance object MessageBatchStatus Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Canceling The status of a message batch that is being canceled. public const string Canceling = \"canceling\" Field Value string Ended The status of a message batch that has ended. public const string Ended = \"ended\" Field Value string InProgress The status of a message batch that is in progress. public const string InProgress = \"in_progress\" Field Value string"
"summary":"Class MessageCompleteEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for the message_complete event. public class MessageCompleteEventData : EventData Inheritance object EventData MessageCompleteEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageCompleteEventData(MessageResponse, AnthropicHeaders) Initializes a new instance of the MessageCompleteEventData class. public MessageCompleteEventData(MessageResponse message, AnthropicHeaders headers) Parameters message MessageResponse The response message. headers AnthropicHeaders The anthropic headers. Properties Headers Gets the anthropic headers. public AnthropicHeaders Headers { get; init; } Property Value AnthropicHeaders Message Gets the response message. public MessageResponse Message { get; init; } Property Value MessageResponse"
"summary":"Class MessageDeltaEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a message_delta event. public class MessageDeltaEventData : EventData Inheritance object EventData MessageDeltaEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageDeltaEventData(MessageDelta, Usage) Initializes a new instance of the MessageDeltaEventData class. public MessageDeltaEventData(MessageDelta delta, Usage usage) Parameters delta MessageDelta The message delta. usage Usage The usage. Properties Delta Gets the message delta. public MessageDelta Delta { get; init; } Property Value MessageDelta Usage Gets the usage. public Usage Usage { get; init; } Property Value Usage"
"summary":"Class MessageRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message request. public class MessageRequest : BaseMessageRequest Inheritance object BaseMessageRequest MessageRequest Inherited Members BaseMessageRequest.Model BaseMessageRequest.System BaseMessageRequest.SystemMessages BaseMessageRequest.SystemPrompt BaseMessageRequest.Messages BaseMessageRequest.MaxTokens BaseMessageRequest.Metadata BaseMessageRequest.StopSequences BaseMessageRequest.Temperature BaseMessageRequest.TopK BaseMessageRequest.TopP BaseMessageRequest.ToolChoice BaseMessageRequest.Tools BaseMessageRequest.Stream object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageRequest(string, List<Message>, int, string?, Dictionary<string, object>?, decimal, int?, decimal?, ToolChoice?, List<Tool>?, List<string>?, List<TextContent>?) Initializes a new instance of the MessageRequest class. public MessageRequest(string model, List<Message> messages, int maxTokens = 1024, string? system = null, Dictionary<string, object>? metadata = null, decimal temperature = 0.0, int? topK = null, decimal? topP = null, ToolChoice? toolChoice = null, List<Tool>? tools = null, List<string>? stopSequences = null, List<TextContent>? systemMessages = null) Parameters model string The model ID to use for the request. messages List<Message> The messages to send to the model. maxTokens int The maximum number of tokens to generate. system string The system prompt to use for the request. metadata Dictionary<string, object> The metadata to include with the request. temperature decimal The temperature to use for the request. topK int? The top-K value to use for the request. topP decimal? The top-P value to use for the request. toolChoice ToolChoice The tool choice mode to use for the request. tools List<Tool> The tools to use for the request. stopSequences List<string> The prompt stop sequences. systemMessages List<TextContent> The system messages to include with the request. Exceptions ArgumentNullException Thrown when the model or messages is null. ArgumentException Thrown when the messages contain no messages. ArgumentException Thrown when the max tokens is less than one. ArgumentException Thrown when the temperature is less than zero or greater than one."
"summary":"Class MessageResponse Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a response. public class MessageResponse Inheritance object MessageResponse Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Content Gets the contents of the response. public List<Content> Content { get; init; } Property Value List<Content> Id Gets the ID of the response. public string Id { get; init; } Property Value string Model Gets the model used for the response. public string Model { get; init; } Property Value string Role Gets the role of the response. public string Role { get; init; } Property Value string StopReason Gets the stop reason of the response. [JsonPropertyName(\"stop_reason\")] public string? StopReason { get; init; } Property Value string StopSequence Gets the stop sequence of the response. [JsonPropertyName(\"stop_sequence\")] public string? StopSequence { get; init; } Property Value string ToolCall Gets the tool call of the response. If the response does not contain a tool call, this property is null. [JsonIgnore] public ToolCall? ToolCall { get; set; } Property Value ToolCall Type Gets the type of the response. public string Type { get; init; } Property Value string Usage Gets the usage of the response. public Usage Usage { get; init; } Property Value Usage"
"summary":"Class MessageRole Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the message role. public static class MessageRole Inheritance object MessageRole Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Assistant Represents the assistant role. public const string Assistant = \"assistant\" Field Value string User Represents the user role. public const string User = \"user\" Field Value string"
"summary":"Class MessageStartEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a message_start event. public class MessageStartEventData : EventData Inheritance object EventData MessageStartEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageStartEventData(MessageResponse) Initializes a new instance of the MessageStartEventData class. public MessageStartEventData(MessageResponse message) Parameters message MessageResponse The message. Properties Message Gets the message. public MessageResponse Message { get; init; } Property Value MessageResponse"
"summary":"Class MessageStopEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a message_stop event. public class MessageStopEventData : EventData Inheritance object EventData MessageStopEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageStopEventData() Initializes a new instance of the MessageStopEventData class. public MessageStopEventData()"
"summary":"Class NotFoundError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a not_found error. public class NotFoundError : Error Inheritance object Error NotFoundError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors NotFoundError(string) Initializes a new instance of the NotFoundError class. public NotFoundError(string message) Parameters message string The message of the error."
"summary":"Class OverloadedError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an overloaded error. public class OverloadedError : Error Inheritance object Error OverloadedError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors OverloadedError(string) Initializes a new instance of the OverloadedError class. public OverloadedError(string message) Parameters message string The message of the error."
"summary":"Class Page<T> Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a page with data. public class Page<T> : Page Type Parameters T Inheritance object Page Page<T> Inherited Members Page.FirstId Page.LastId Page.HasMore object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Data The data in the page. public T[] Data { get; init; } Property Value T[]"
"summary":"Class Page Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a page. public class Page Inheritance object Page Derived Page<T> Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties FirstId The id of the first item in the page. [JsonPropertyName(\"first_id\")] public string? FirstId { get; init; } Property Value string HasMore Indicates whether there is more data to be retrieved. [JsonPropertyName(\"has_more\")] public bool HasMore { get; init; } Property Value bool LastId The id of the last item in the page. [JsonPropertyName(\"last_id\")] public string? LastId { get; init; } Property Value string"
"summary":"Class PagingRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a request to page through a collection of items. public class PagingRequest Inheritance object PagingRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors PagingRequest(string, string, int) Initializes a new instance of the PagingRequest class. public PagingRequest(string beforeId = \"\", string afterId = \"\", int limit = 20) Parameters beforeId string The ID of the item before which to start the page. afterId string The ID of the item after which to start the page. limit int The maximum number of items to return in the page. Exceptions ArgumentException Thrown when both beforeId and afterId are specified. ArgumentOutOfRangeException Thrown when limit is less than 1 or greater than 1000. Properties AfterId The ID of the item after which to start the page. [JsonPropertyName(\"after_id\")] public string AfterId { get; init; } Property Value string BeforeId The ID of the item before which to start the page. [JsonPropertyName(\"before_id\")] public string BeforeId { get; init; } Property Value string Limit The maximum number of items to return in the page. public int Limit { get; init; } Property Value int Methods ToQueryParameters() Converts the PagingRequest to a query string. public string ToQueryParameters() Returns string The query string representation of the PagingRequest."
"summary":"Class PermissionError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a permission error. public class PermissionError : Error Inheritance object Error PermissionError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors PermissionError(string) Initializes a new instance of the PermissionError class. public PermissionError(string message) Parameters message string The message of the error."
"summary":"Class PingEventData Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents data for a ping event. public class PingEventData : EventData Inheritance object EventData PingEventData Inherited Members EventData.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors PingEventData() Initializes a new instance of the PingEventData class. public PingEventData()"
"summary":"Class RateLimitError Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a rate_limit error. public class RateLimitError : Error Inheritance object Error RateLimitError Inherited Members Error.Type Error.Message object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors RateLimitError(string) Initializes a new instance of the RateLimitError class. public RateLimitError(string message) Parameters message string The message of the error."
"summary":"Class SpecificToolChoice Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the specific tool choice mode. public class SpecificToolChoice : ToolChoice Inheritance object ToolChoice SpecificToolChoice Inherited Members ToolChoice.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors SpecificToolChoice(string) Initializes a new instance of the SpecificToolChoice class. public SpecificToolChoice(string name) Parameters name string The name of the tool. Exceptions ArgumentNullException Thrown when the name is null. Properties Name Gets the name of the tool. public string Name { get; init; } Property Value string"
"summary":"Class StopReasonType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the stop reason type. public static class StopReasonType Inheritance object StopReasonType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields EndTurn Represents the end_turn stop reason. public const string EndTurn = \"end_turn\" Field Value string MaxTokens Represents the max_tokens stop reason. public const string MaxTokens = \"max_tokens\" Field Value string StopSequence Represents the stop_sequence stop reason. public const string StopSequence = \"stop_sequence\" Field Value string ToolUse Represents the tool_use stop reason. public const string ToolUse = \"tool_use\" Field Value string"
"summary":"Class StreamMessageRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message request. public class StreamMessageRequest : BaseMessageRequest Inheritance object BaseMessageRequest StreamMessageRequest Inherited Members BaseMessageRequest.Model BaseMessageRequest.System BaseMessageRequest.SystemMessages BaseMessageRequest.SystemPrompt BaseMessageRequest.Messages BaseMessageRequest.MaxTokens BaseMessageRequest.Metadata BaseMessageRequest.StopSequences BaseMessageRequest.Temperature BaseMessageRequest.TopK BaseMessageRequest.TopP BaseMessageRequest.ToolChoice BaseMessageRequest.Tools BaseMessageRequest.Stream object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors StreamMessageRequest(string, List<Message>, int, string?, Dictionary<string, object>?, decimal, int?, decimal?, ToolChoice?, List<Tool>?, List<string>?, List<TextContent>?) Initializes a new instance of the StreamMessageRequest class. public StreamMessageRequest(string model, List<Message> messages, int maxTokens = 1024, string? system = null, Dictionary<string, object>? metadata = null, decimal temperature = 0.0, int? topK = null, decimal? topP = null, ToolChoice? toolChoice = null, List<Tool>? tools = null, List<string>? stopSequences = null, List<TextContent>? systemMessages = null) Parameters model string The model ID to use for the request. messages List<Message> The messages to send to the model. maxTokens int The maximum number of tokens to generate. system string The system prompt to use for the request. metadata Dictionary<string, object> The metadata to include with the request. temperature decimal The temperature to use for the request. topK int? The top-K value to use for the request. topP decimal? The top-P value to use for the request. toolChoice ToolChoice The tool choice mode to use for the request. tools List<Tool> The tools to use for the request. stopSequences List<string> The prompt stop sequences. systemMessages List<TextContent> The system messages to include with the request. Exceptions ArgumentNullException Thrown when the model or messages is null. ArgumentException Thrown when the messages contain no messages. ArgumentException Thrown when the max tokens is less than one. ArgumentException Thrown when the temperature is less than zero or greater than one."
"summary":"Class SucceededMessageBatchResult Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result that contains a message response. public class SucceededMessageBatchResult : MessageBatchResult Inheritance object MessageBatchResult SucceededMessageBatchResult Inherited Members MessageBatchResult.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors SucceededMessageBatchResult() Initializes a new instance of the SucceededMessageBatchResult class. public SucceededMessageBatchResult() Properties Message Gets the message of the message batch result. public MessageResponse Message { get; init; } Property Value MessageResponse"
"summary":"Class TextContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents text content that is part of a message. public class TextContent : Content Inheritance object Content TextContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors TextContent(string) Initializes a new instance of the TextContent class. public TextContent(string text) Parameters text string The text of the content. Exceptions ArgumentNullException Thrown when the text is null. TextContent(string, CacheControl) Initializes a new instance of the TextContent class. public TextContent(string text, CacheControl cacheControl) Parameters text string The text of the content. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the text or cache control is null. Properties Text Gets the text of the content. public string Text { get; init; } Property Value string"
"summary":"Class TextDelta Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a text delta. public class TextDelta : ContentDelta Inheritance object ContentDelta TextDelta Inherited Members ContentDelta.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors TextDelta(string) Initializes a new instance of the TextDelta class. public TextDelta(string text) Parameters text string The text. Properties Text Gets the text. public string Text { get; set; } Property Value string"
"summary":"Class TokenCountResponse Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a response to a token count request. public class TokenCountResponse Inheritance object TokenCountResponse Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties InputTokens The number of input tokens counted. [JsonPropertyName(\"input_tokens\")] public int InputTokens { get; init; } Property Value int"
"summary":"Class Tool Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a tool that can be used. public class Tool Inheritance object Tool Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties CacheControl Gets or sets the cache control to be used for the tool. [JsonPropertyName(\"cache_control\")] public CacheControl? CacheControl { get; set; } Property Value CacheControl Description Gets the description of the tool. public string Description { get; } Property Value string DisplayName Gets the display name of the tool. [JsonIgnore] public string DisplayName { get; } Property Value string Function Gets the function of the tool. [JsonIgnore] public AnthropicFunction Function { get; } Property Value AnthropicFunction InputSchema Gets the input schema of the tool. [JsonPropertyName(\"input_schema\")] public JsonObject InputSchema { get; } Property Value JsonObject Name Gets the name of the tool. This name will conform to the Anthropic tool naming rules. public string Name { get; } Property Value string Methods CreateFromClass<T>(CacheControl?) Creates a tool from a type that implements ITool. public static Tool CreateFromClass<T>(CacheControl? cacheControl = null) where T : ITool, new() Parameters cacheControl CacheControl Returns Tool The created tool as instance of Tool. Type Parameters T The type that implements ITool. Remarks The implementation of ITool must have a parameterless constructor. Exceptions ArgumentException Thrown when the name or description of the tool is null or empty. ArgumentNullException Thrown when the function of the tool is null. CreateFromFunction<TResult>(string, string, Func<TResult>, CacheControl?) Creates a tool from a function. public static Tool CreateFromFunction<TResult>(string name, string description, Func<TResult> func, CacheControl? cacheControl = null) Parameters name string The name of the tool. description string The description of the tool. func Func<TResult> The function. cacheControl CacheControl The cache control to be used for the tool. Returns Tool The created tool as instance of Tool. Type Parameters TResult The type of the result for the delegate. Remarks The name of the tool will be sanitized to conform to the Anthropic tool naming rules. Exceptions ArgumentNullException Thrown when func is null. CreateFromFunction<T1, TResult>(string, string, Func<T1, TResult>, CacheControl?) Creates a tool from a function. public static Tool CreateFromFunction<T1, TResult>(string name, string description, Func<T1, TResult> func, CacheControl? cacheControl = null) Parameters name string The name of the tool. description string The description of the tool. func Func<T1, TResult> The function. cacheControl CacheControl The cache control to be used for the tool. Returns Tool The created tool as instance of Tool. Type Parameters T1 The type of the first parameter for the delegate. TResult The type of the result for the delegate. Remarks The name of the tool will be sanitized to conform to the Anthropic tool naming rules. Exceptions ArgumentNullException Thrown when func is null. CreateFromFunction<T1, T2, TResult>(string, string, Func<T1, T2, TResult>, CacheControl?) Creates a tool from a function. public static Tool CreateFromFunction<T1, T2, TResult>(string name, string description, Func<T1, T2, TResult> func, CacheControl? cacheControl = null) Parameters name string The name of the tool. description string The description of the tool. func Func<T1, T2, TResult> The function. cacheControl CacheControl The cache control to be used for the tool. Returns Tool The created tool as instance of Tool. Type Parameters T1 The type of the first parameter for the delegate. T2 The type of the second parameter for the delegate. TResult The type of the result for the delegate. Remarks The name of the tool will be sanitized to conform to the Anthropic tool naming rules. Exceptions ArgumentNullException Thrown when func is null. Create
"summary": "ClassToolChoiceTypeNamespaceAnthropicClient.ModelsAssemblyAnthropicClient.dllRepresentsthetoolchoicetype.publicclassToolChoiceTypeInheritanceobjectToolChoiceTypeInheritedMembersobject.Equals(object)object.Equals(object,object)object.GetHashCode()object.GetType()object.MemberwiseClone()object.ReferenceEquals(object,object)object.ToString()FieldsAnyRepresentstheanytoolchoicetype.publicconststringAny=\"any\" Field Value string Auto Represents the auto tool choice type. public const string Auto = \"auto\" Field Value string Tool Represents the specific tool choice type. public const string Tool = \"tool\" Field Value string"
"summary":"Class ToolResultContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents tool result content that is part of a message. public class ToolResultContent : Content Inheritance object Content ToolResultContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ToolResultContent(string, string) Initializes a new instance of the ToolResultContent class. public ToolResultContent(string toolUseId, string content) Parameters toolUseId string The tool use ID of the content. content string The content of the tool result. Exceptions ArgumentNullException Thrown when the tool use ID or content is null. ToolResultContent(string, string, CacheControl) Initializes a new instance of the ToolResultContent class. public ToolResultContent(string toolUseId, string content, CacheControl cacheControl) Parameters toolUseId string The tool use ID of the content. content string The content of the tool result. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the tool use ID or content is null. Properties Content Gets the content of the tool result. public string Content { get; init; } Property Value string ToolUseId Gets the tool use ID of the content. [JsonPropertyName(\"tool_use_id\")] public string ToolUseId { get; init; } Property Value string"
"summary":"Class ToolUseContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents tool use content that is part of a message. public class ToolUseContent : Content Inheritance object Content ToolUseContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ToolUseContent() Initializes a new instance of the ToolUseContent class. public ToolUseContent() Properties Id Gets the ID of the tool use. public string Id { get; init; } Property Value string Input Gets the input of the tool. public Dictionary<string, object?> Input { get; init; } Property Value Dictionary<string, object> Name Gets the name of the tool. public string Name { get; init; } Property Value string"
"summary":"Class Usage Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the usage of a response. public class Usage Inheritance object Usage Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties CacheCreationInputTokens Gets the number of tokens written to the cache when creating a new entry [JsonPropertyName(\"cache_creation_input_tokens\")] public int CacheCreationInputTokens { get; init; } Property Value int CacheReadInputTokens Gets the number of tokens retrieved from the cache for the request. [JsonPropertyName(\"cache_read_input_tokens\")] public int CacheReadInputTokens { get; init; } Property Value int InputTokens Gets the number of input tokens used. [JsonPropertyName(\"input_tokens\")] public int InputTokens { get; init; } Property Value int OutputTokens Gets the number of output tokens used. [JsonPropertyName(\"output_tokens\")] public int OutputTokens { get; init; } Property Value int"
"summary":"Namespace AnthropicClient.Models Classes AnthropicError Represents an error response from the Anthropic API. AnthropicEvent Represents an event from the Anthropic API. AnthropicFunction Represents a function that can be provided as a tool. AnthropicHeaders Represents headers included in Anthropic API responses. AnthropicModel Represents an Anthropic model. AnthropicModels Provides constants for the Anthropic models. AnyToolChoice Represents the any tool choice mode. ApiError Represents an api_error response from the Anthropic API. AuthenticationError Represents an authentication_error response from the Anthropic API. AutoToolChoice Represents the auto tool choice mode. BaseMessageRequest Represents a message request. CacheControl Represents the cache control to be used for content. CacheControlType Provides constants for cache control types. CanceledMessageBatchResult Represents a message batch result that was cancelled. Content Represents part of the content of a message. ContentDelta Represents a content delta. ContentDeltaEventData Represents data for a content_block_delta event. ContentDeltaType Provides constants for content delta types. ContentStartEventData Represents data for a content_block_start event. ContentStopEventData Represents data for a content_block_stop event. ContentType Represents the content type. CountMessageTokensRequest Represents a request to count the number of tokens in a message. DocumentContent Represents content from a document that is part of a message. DocumentSource Represents a document source. EphemeralCacheControl Represents the cache control to be used for content. Error Represents an error. ErrorEventData Represents data for an error event. ErrorType Represents the error type. ErroredMessageBatchResult Represents a message batch result that contains an error response. EventData Represents data for an event. EventType Provides constants for event types. ExpiredMessageBatchResult Represents a message batch result that has expired. FunctionParameterAttribute Attribute to describe a function parameter. FunctionPropertyAttribute Attribute to describe a property of a type that is used as a function parameter. ImageContent Represents image content that is part of a message. ImageSource Represents an image source. ImageType Represents the image type. InputProperty Represents an input property. InputSchema Represents an input schema. InvalidRequestError Represents an invalid_request error. JsonDelta Represents a JSON delta. Message Represents a message. MessageBatchDeleteResponse Represents a message batch delete response. MessageBatchRequest Represents a request to create a batch of messages. MessageBatchRequestCounts Represents the counts of requests in a batch of messages. MessageBatchRequestItem Represents an item in a batch of messages. MessageBatchResponse Represents a response to a batch of messages. MessageBatchResult Represents a message batch result. MessageBatchResultItem Represents a message batch result item. MessageBatchResultType Represents the types of message batch results. MessageBatchStatus Represents the status of a message batch. MessageCompleteEventData Represents data for the message_complete event. MessageDelta Represents a message delta. MessageDeltaEventData Represents data for a message_delta event. MessageRequest Represents a message request. MessageResponse Represents a response. MessageRole Represents the message role. MessageStartEventData Represents data for a message_start event. MessageStopEventData Represents data for a message_stop event. NotFoundError Represents a not_found error. OverloadedError Represents an overloaded error. Page Represents a page. Page<T> Represents a page with data. PagingRequest Represents a request to page through a collection of items. PermissionError Represents a permission error. PingEventData Represents data for a ping event. RateLimitError Represents a rate_limit error. SpecificToolChoice Represents the specific tool choice mode. StopReasonType Represents the stop reason type. StreamMessageRequest Represents
"summary": "AnthropicClientThislibraryfortheAnthropicAPIismeanttosimplifydevelopmentinC#forAnthropicusers.NoteThisisanunofficialSDKfortheAnthropicAPI.ItwasnotbuiltinconsultationwithAnthropicoranymemberoftheirorganization.ThisSDKwasdevelopedindependentlyusingexistinglibrariesandtheAnthropicAPIdocumentationasthestartingpointwiththeintentionofmakingdevelopmentofintegrationsdoneinC#withAnthropicquickerandmoreconvenient.NoteThisclientlibraryisheavilyinspiredbytheAnthropic.SDKlibrary.IchosetocreateanewlibrarybecauseIwantedtohandlestreamingandtoolcallingdifferentlyaswellashavecontrolovertheclientlibraryasIplantouseittobuildaconnectorforSemanticKernel.HoweverifyouarelookingforaclientlibrarytheAnthropic.SDKisagreatplacetostart.\uD83D\uDCDDIssuesIfyouencounteranyissueswhileusingthislibrarypleaseopenanissuehere.\uD83D\uDCDCLicenseThislibraryislicensedundertheMITLicenseandisfreetouseandmodify.\uD83D\uDCDDContributingIfyouwouldliketocontributetothislibrarypleaseopenapullrequesthere.\uD83D\uDEE0️DependenciesMicrosoft.Bcl.AsyncInterfacesUsedtosupportasyncinterfaceswhenstreamingmessagesSystem.Text.JsonUsedforJSONserializationanddeserialization\uD83D\uDCBEInstallationInstallthepackagefromNuGetusingthefollowingcommand:dotnetaddpackageAnthropicClient\uD83D\uDD11APIKeyInordertousetheAnthropicAPIyouwillneedanAPIkey.YoucangetonebysigningupatAnthropic.PleasekeepyourAPIkeysecureanddonotshareitwithothers.BemindfulofwhereyoustoreyourAPIkeyanddonotcommitittoapublicrepository.\uD83D\uDC68\uD83C\uDFFB\uD83D\uDCBBStartCodingAnthropicApiClientThemostcommonwaytousetheSDKistocreateanAnthropicApiClientinstanceandcallitsmethods.Itsconstructorrequirestwoparameters:apiKey-yourAnthropicAPIkeyhttpClient-anHttpClientinstance.YoucanconfigureandcustomizetheHttpClientinstanceasneeded.ThislibraryhoweverwillperformthenecessaryconfigurationtoworkwiththeAnthropicAPI.Suchassettingthebaseaddressandaddingtheproperheaders.NoteThislibrarydoesnotmanagethelifecycleoftheHttpClientinstance.YoushouldcreateandmanagethelifecycleoftheHttpClientinstanceinyourapplication.ItisbestpracticetoreadtheAPIkeyfromasecurelocationsuchasaconfigurationfileorenvironmentvariable.Forexampleusingtheappsettings.jsonfile:{\"AnthropicApiKey\": \"YOUR_API\" } Example constructing an AnthropicApiClient instance: using AnthropicClient; using Microsoft.Extensions.Configuration; var configuration = new ConfigurationBuilder() .AddJsonFile(\"appsettings.json\") .Build(); var apiKey = configuration[\"AnthropicApiKey\"];varclient=newAnthropicApiClient(apiKey,newHttpClient());IAnthropicApiClientThelibrarydoesexposeaninterfaceIAnthropicApiClientthatcanbeusedfordependencyinjectionandtesting.TheinterfaceisimplementedbytheAnthropicApiClientclass.FullAPIDocumentationThislibrarywasdevelopedtomakeusingtheAnthropicAPIeasierwithina.NETapplication.IfyouarelookingforthefullAPIdocumentationyoucanfinditatAnthropicAPIDocumentation.UsageTheprimaryusecaseforworkingwiththeAnthropicAPIistocreateamessageinresponsetoarequestthatincludesoneormoreothermessages.Thecreatedmessagecanthenbereceivedeitherasacompleteresponseorastreamofevents.ThiscanbeusedtocreateaconversationbetweenthecallerandAnthropic'sAImodelsand/ortouseAnthropic'sAImodelstoperformatask.NoteThefollowingexamplesassumethatyouhavealreadycreatedaninstanceoftheAnthropicApiClientclassnamedclient.Youcanalsofindthesesnippetsintheexamplesdirectory.CountMessageTokensTheAnthropicApiClientexposesamethodnamedCountMessageTokensAsyncthatcanbeusedtocountthenumberoftokensinamessage.Themeth