322 lines
97 KiB
JSON
322 lines
97 KiB
JSON
{
|
|
"api/AnthropicClient.AnthropicApiClient.html": {
|
|
"href": "api/AnthropicClient.AnthropicApiClient.html",
|
|
"title": "Class AnthropicApiClient | AnthropicClient",
|
|
"keywords": "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 CreateMessageAsync(MessageRequest) Creates a message asynchronously. public Task<AnthropicResult<MessageResponse>> CreateMessageAsync(MessageRequest request) Parameters request MessageRequest The message request to create. Returns Task<AnthropicResult<MessageResponse>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T>. CreateMessageAsync(StreamMessageRequest) Creates a message asynchronously and streams the response. public IAsyncEnumerable<AnthropicEvent> CreateMessageAsync(StreamMessageRequest request) Parameters request StreamMessageRequest The message request to create. Returns IAsyncEnumerable<AnthropicEvent> An asynchronous enumerable that yields the response event by event."
|
|
},
|
|
"api/AnthropicClient.IAnthropicApiClient.html": {
|
|
"href": "api/AnthropicClient.IAnthropicApiClient.html",
|
|
"title": "Interface IAnthropicApiClient | AnthropicClient",
|
|
"keywords": "Interface IAnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public interface IAnthropicApiClient Methods CreateMessageAsync(MessageRequest) Creates a message asynchronously. Task<AnthropicResult<MessageResponse>> CreateMessageAsync(MessageRequest request) Parameters request MessageRequest The message request to create. Returns Task<AnthropicResult<MessageResponse>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T>. CreateMessageAsync(StreamMessageRequest) Creates a message asynchronously and streams the response. IAsyncEnumerable<AnthropicEvent> CreateMessageAsync(StreamMessageRequest request) Parameters request StreamMessageRequest The message request to create. Returns IAsyncEnumerable<AnthropicEvent> An asynchronous enumerable that yields the response event by event."
|
|
},
|
|
"api/AnthropicClient.Models.AnthropicError.html": {
|
|
"href": "api/AnthropicClient.Models.AnthropicError.html",
|
|
"title": "Class AnthropicError | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.AnthropicEvent.html": {
|
|
"href": "api/AnthropicClient.Models.AnthropicEvent.html",
|
|
"title": "Class AnthropicEvent | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.AnthropicFunction.html": {
|
|
"href": "api/AnthropicClient.Models.AnthropicFunction.html",
|
|
"title": "Class AnthropicFunction | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.AnthropicHeaders.html": {
|
|
"href": "api/AnthropicClient.Models.AnthropicHeaders.html",
|
|
"title": "Class AnthropicHeaders | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.AnthropicModels.html": {
|
|
"href": "api/AnthropicClient.Models.AnthropicModels.html",
|
|
"title": "Class AnthropicModels | AnthropicClient",
|
|
"keywords": "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 Claude35Sonnet The Claude-3.5 Sonnet model. public const string Claude35Sonnet = \"claude-3-5-sonnet-20240620\" Field Value string Claude3Haiku The Claude-3 Haiku model. public const string Claude3Haiku = \"claude-3-haiku-20240307\" Field Value string Claude3Opus The Claude-3 Opus model. public const string Claude3Opus = \"claude-3-opus-20240229\" Field Value string Claude3Sonnet The Claude-3 Sonnet model. public const string Claude3Sonnet = \"claude-3-sonnet-20240229\" Field Value string"
|
|
},
|
|
"api/AnthropicClient.Models.AnyToolChoice.html": {
|
|
"href": "api/AnthropicClient.Models.AnyToolChoice.html",
|
|
"title": "Class AnyToolChoice | AnthropicClient",
|
|
"keywords": "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()"
|
|
},
|
|
"api/AnthropicClient.Models.ApiError.html": {
|
|
"href": "api/AnthropicClient.Models.ApiError.html",
|
|
"title": "Class ApiError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.AuthenticationError.html": {
|
|
"href": "api/AnthropicClient.Models.AuthenticationError.html",
|
|
"title": "Class AuthenticationError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.AutoToolChoice.html": {
|
|
"href": "api/AnthropicClient.Models.AutoToolChoice.html",
|
|
"title": "Class AutoToolChoice | AnthropicClient",
|
|
"keywords": "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()"
|
|
},
|
|
"api/AnthropicClient.Models.BaseMessageRequest.html": {
|
|
"href": "api/AnthropicClient.Models.BaseMessageRequest.html",
|
|
"title": "Class BaseMessageRequest | AnthropicClient",
|
|
"keywords": "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>?) Initializes a new instance of the BaseMessageRequest class. protected BaseMessageRequest(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, bool stream = false, List<string>? stopSequences = 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 ID 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. Exceptions ArgumentException Thrown when the model ID is invalid. 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 prompt to use for the request. public string? System { get; init; } Property Value string 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; } Property Value int? TopP Gets the top-P value to use for the request. public decimal? TopP { get; init; } Property Value decimal?"
|
|
},
|
|
"api/AnthropicClient.Models.Content.html": {
|
|
"href": "api/AnthropicClient.Models.Content.html",
|
|
"title": "Class Content | AnthropicClient",
|
|
"keywords": "Class Content Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents part of the content of a message. public abstract class Content Inheritance object Content Derived 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. Properties Type Gets the type of the content. public string Type { get; init; } Property Value string"
|
|
},
|
|
"api/AnthropicClient.Models.ContentDelta.html": {
|
|
"href": "api/AnthropicClient.Models.ContentDelta.html",
|
|
"title": "Class ContentDelta | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ContentDeltaEventData.html": {
|
|
"href": "api/AnthropicClient.Models.ContentDeltaEventData.html",
|
|
"title": "Class ContentDeltaEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ContentDeltaType.html": {
|
|
"href": "api/AnthropicClient.Models.ContentDeltaType.html",
|
|
"title": "Class ContentDeltaType | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ContentStartEventData.html": {
|
|
"href": "api/AnthropicClient.Models.ContentStartEventData.html",
|
|
"title": "Class ContentStartEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ContentStopEventData.html": {
|
|
"href": "api/AnthropicClient.Models.ContentStopEventData.html",
|
|
"title": "Class ContentStopEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ContentType.html": {
|
|
"href": "api/AnthropicClient.Models.ContentType.html",
|
|
"title": "Class ContentType | AnthropicClient",
|
|
"keywords": "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 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"
|
|
},
|
|
"api/AnthropicClient.Models.Error.html": {
|
|
"href": "api/AnthropicClient.Models.Error.html",
|
|
"title": "Class Error | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ErrorEventData.html": {
|
|
"href": "api/AnthropicClient.Models.ErrorEventData.html",
|
|
"title": "Class ErrorEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ErrorType.html": {
|
|
"href": "api/AnthropicClient.Models.ErrorType.html",
|
|
"title": "Class ErrorType | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.EventData.html": {
|
|
"href": "api/AnthropicClient.Models.EventData.html",
|
|
"title": "Class EventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.EventType.html": {
|
|
"href": "api/AnthropicClient.Models.EventType.html",
|
|
"title": "Class EventType | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.FunctionParameterAttribute.html": {
|
|
"href": "api/AnthropicClient.Models.FunctionParameterAttribute.html",
|
|
"title": "Class FunctionParameterAttribute | AnthropicClient",
|
|
"keywords": "Class FunctionParameterAttribute Namespace AnthropicClient.Models Assembly AnthropicClient.dll Attribute to describe a function parameter. [AttributeUsage(AttributeTargets.Parameter)] public sealed class FunctionParameterAttribute : Attribute Inheritance object Attribute FunctionParameterAttribute 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.ReferenceEquals(object, object) object.ToString() Constructors FunctionParameterAttribute(string, string, bool) Initializes a new instance of the FunctionParameterAttribute class. public FunctionParameterAttribute(string description, string name = \"\", bool required = false) Parameters description string The description of the parameter. name string The name of the parameter. required bool Whether the parameter is required. Properties Description The description of the parameter. public string Description { get; } Property Value string Name The name of the parameter. public string Name { get; } Property Value string Required Whether the parameter is required. public bool Required { get; } Property Value bool"
|
|
},
|
|
"api/AnthropicClient.Models.FunctionPropertyAttribute.html": {
|
|
"href": "api/AnthropicClient.Models.FunctionPropertyAttribute.html",
|
|
"title": "Class FunctionPropertyAttribute | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ITool.html": {
|
|
"href": "api/AnthropicClient.Models.ITool.html",
|
|
"title": "Interface ITool | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ImageContent.html": {
|
|
"href": "api/AnthropicClient.Models.ImageContent.html",
|
|
"title": "Class ImageContent | AnthropicClient",
|
|
"keywords": "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 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. Properties Source Gets the source of the image. public ImageSource Source { get; init; } Property Value ImageSource"
|
|
},
|
|
"api/AnthropicClient.Models.ImageSource.html": {
|
|
"href": "api/AnthropicClient.Models.ImageSource.html",
|
|
"title": "Class ImageSource | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.ImageType.html": {
|
|
"href": "api/AnthropicClient.Models.ImageType.html",
|
|
"title": "Class ImageType | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.InputProperty.html": {
|
|
"href": "api/AnthropicClient.Models.InputProperty.html",
|
|
"title": "Class InputProperty | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.InputSchema.html": {
|
|
"href": "api/AnthropicClient.Models.InputSchema.html",
|
|
"title": "Class InputSchema | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.InvalidRequestError.html": {
|
|
"href": "api/AnthropicClient.Models.InvalidRequestError.html",
|
|
"title": "Class InvalidRequestError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.JsonDelta.html": {
|
|
"href": "api/AnthropicClient.Models.JsonDelta.html",
|
|
"title": "Class JsonDelta | AnthropicClient",
|
|
"keywords": "Class JsonDelta Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a JSON delta. public class JsonDelta : ContentDelta Inheritance object ContentDelta JsonDelta Inherited Members ContentDelta.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors JsonDelta(string) Initializes a new instance of the JsonDelta class. public JsonDelta(string partialJson) Parameters partialJson string The partial JSON. Properties PartialJson Gets the partial JSON. [JsonPropertyName(\"partial_json\")] public string PartialJson { get; init; } Property Value string"
|
|
},
|
|
"api/AnthropicClient.Models.Message.html": {
|
|
"href": "api/AnthropicClient.Models.Message.html",
|
|
"title": "Class Message | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.MessageCompleteEventData.html": {
|
|
"href": "api/AnthropicClient.Models.MessageCompleteEventData.html",
|
|
"title": "Class MessageCompleteEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.MessageDelta.html": {
|
|
"href": "api/AnthropicClient.Models.MessageDelta.html",
|
|
"title": "Class MessageDelta | AnthropicClient",
|
|
"keywords": "Class MessageDelta Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message delta. public class MessageDelta Inheritance object MessageDelta Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors MessageDelta(string, string) Initializes a new instance of the MessageDelta class. public MessageDelta(string stopReason, string stopSequence) Parameters stopReason string The stop reason. stopSequence string The stop sequence. Properties StopReason Gets the stop reason. [JsonPropertyName(\"stop_reason\")] public string StopReason { get; init; } Property Value string StopSequence Gets the stop sequence. [JsonPropertyName(\"stop_sequence\")] public string? StopSequence { get; init; } Property Value string"
|
|
},
|
|
"api/AnthropicClient.Models.MessageDeltaEventData.html": {
|
|
"href": "api/AnthropicClient.Models.MessageDeltaEventData.html",
|
|
"title": "Class MessageDeltaEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.MessageRequest.html": {
|
|
"href": "api/AnthropicClient.Models.MessageRequest.html",
|
|
"title": "Class MessageRequest | AnthropicClient",
|
|
"keywords": "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.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>?) 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) 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 ID 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. Exceptions ArgumentException Thrown when the model ID is invalid. 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."
|
|
},
|
|
"api/AnthropicClient.Models.MessageResponse.html": {
|
|
"href": "api/AnthropicClient.Models.MessageResponse.html",
|
|
"title": "Class MessageResponse | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.MessageRole.html": {
|
|
"href": "api/AnthropicClient.Models.MessageRole.html",
|
|
"title": "Class MessageRole | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.MessageStartEventData.html": {
|
|
"href": "api/AnthropicClient.Models.MessageStartEventData.html",
|
|
"title": "Class MessageStartEventData | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.MessageStopEventData.html": {
|
|
"href": "api/AnthropicClient.Models.MessageStopEventData.html",
|
|
"title": "Class MessageStopEventData | AnthropicClient",
|
|
"keywords": "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()"
|
|
},
|
|
"api/AnthropicClient.Models.NotFoundError.html": {
|
|
"href": "api/AnthropicClient.Models.NotFoundError.html",
|
|
"title": "Class NotFoundError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.OverloadedError.html": {
|
|
"href": "api/AnthropicClient.Models.OverloadedError.html",
|
|
"title": "Class OverloadedError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.PermissionError.html": {
|
|
"href": "api/AnthropicClient.Models.PermissionError.html",
|
|
"title": "Class PermissionError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.PingEventData.html": {
|
|
"href": "api/AnthropicClient.Models.PingEventData.html",
|
|
"title": "Class PingEventData | AnthropicClient",
|
|
"keywords": "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()"
|
|
},
|
|
"api/AnthropicClient.Models.RateLimitError.html": {
|
|
"href": "api/AnthropicClient.Models.RateLimitError.html",
|
|
"title": "Class RateLimitError | AnthropicClient",
|
|
"keywords": "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."
|
|
},
|
|
"api/AnthropicClient.Models.SpecificToolChoice.html": {
|
|
"href": "api/AnthropicClient.Models.SpecificToolChoice.html",
|
|
"title": "Class SpecificToolChoice | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.StopReasonType.html": {
|
|
"href": "api/AnthropicClient.Models.StopReasonType.html",
|
|
"title": "Class StopReasonType | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.StreamMessageRequest.html": {
|
|
"href": "api/AnthropicClient.Models.StreamMessageRequest.html",
|
|
"title": "Class StreamMessageRequest | AnthropicClient",
|
|
"keywords": "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.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>?) 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) 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 ID 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. Exceptions ArgumentException Thrown when the model ID is invalid. 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."
|
|
},
|
|
"api/AnthropicClient.Models.TextContent.html": {
|
|
"href": "api/AnthropicClient.Models.TextContent.html",
|
|
"title": "Class TextContent | AnthropicClient",
|
|
"keywords": "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 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. Properties Text Gets the text of the content. public string Text { get; init; } Property Value string"
|
|
},
|
|
"api/AnthropicClient.Models.TextDelta.html": {
|
|
"href": "api/AnthropicClient.Models.TextDelta.html",
|
|
"title": "Class TextDelta | AnthropicClient",
|
|
"keywords": "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"
|
|
},
|
|
"api/AnthropicClient.Models.Tool.html": {
|
|
"href": "api/AnthropicClient.Models.Tool.html",
|
|
"title": "Class Tool | AnthropicClient",
|
|
"keywords": "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 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>() Creates a tool from a type that implements ITool. public static Tool CreateFromClass<T>() where T : ITool, new() 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>) Creates a tool from a function. public static Tool CreateFromFunction<TResult>(string name, string description, Func<TResult> func) Parameters name string The name of the tool. description string The description of the tool. func Func<TResult> The function. 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>) Creates a tool from a function. public static Tool CreateFromFunction<T1, TResult>(string name, string description, Func<T1, TResult> func) Parameters name string The name of the tool. description string The description of the tool. func Func<T1, TResult> The function. 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>) Creates a tool from a function. public static Tool CreateFromFunction<T1, T2, TResult>(string name, string description, Func<T1, T2, TResult> func) Parameters name string The name of the tool. description string The description of the tool. func Func<T1, T2, TResult> The function. 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. CreateFromInstanceMethod(string, string, object, string) Creates a tool from an instance method. public static Tool CreateFromInstanceMethod(string name, string description, object instance, string methodName) Parameters name string The name of the tool. description string The description of the tool. instance object The instance that contains the method. methodName string The name of the method. Returns Tool The created tool as instance of Tool. Remarks The name of the tool will be sanitized to conform to the Anthropic tool naming rules. Exceptions ArgumentException Thrown when methodName is null or empty. ArgumentNullException Thrown when instance is null. ArgumentException Thrown when methodName is not found in the type of instance. CreateFromStaticMethod(string, string, Type, string) Creates a tool from a static method. public static Tool CreateFromStaticMethod(string name, string description, Type type, string methodName) Parameters name string The name of the tool. description string The description of the tool. type Type The type that contains the method. methodName string The name of the method. Returns Tool The created tool as instance of Tool. Remarks The name of the tool will be sanitized to conform to the Anthropic tool naming rules. Exceptions ArgumentException Thrown when methodName is null or empty. ArgumentNullException Thrown when type is null. ArgumentException Thrown when the method is not found in the type."
|
|
},
|
|
"api/AnthropicClient.Models.ToolCall.html": {
|
|
"href": "api/AnthropicClient.Models.ToolCall.html",
|
|
"title": "Class ToolCall | AnthropicClient",
|
|
"keywords": "Class ToolCall Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a tool call. public class ToolCall Inheritance object ToolCall Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ToolCall(Tool, ToolUseContent) Initializes a new instance of the ToolCall class. public ToolCall(Tool tool, ToolUseContent toolUse) Parameters tool Tool The tool of the tool call. toolUse ToolUseContent The tool use of the tool call. Properties Tool Gets the tool of the tool call. public Tool Tool { get; } Property Value Tool ToolUse Gets the tool use of the tool call. public ToolUseContent ToolUse { get; } Property Value ToolUseContent Methods InvokeAsync() Invokes the tool call. public Task<ToolCallResult<object>> InvokeAsync() Returns Task<ToolCallResult<object>> The result of the tool call as an instance of ToolCallResult<T>. InvokeAsync<T>() Invokes the tool call. public Task<ToolCallResult<T>> InvokeAsync<T>() Returns Task<ToolCallResult<T>> The result of the tool call as an instance of ToolCallResult<T>. Type Parameters T The type of the result value. Exceptions ArgumentException Thrown when a parameter name is not found. ArgumentException Thrown when an argument is missing."
|
|
},
|
|
"api/AnthropicClient.Models.ToolCallResult-1.html": {
|
|
"href": "api/AnthropicClient.Models.ToolCallResult-1.html",
|
|
"title": "Class ToolCallResult<T> | AnthropicClient",
|
|
"keywords": "Class ToolCallResult<T> Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a tool call result. public class ToolCallResult<T> Type Parameters T Inheritance object ToolCallResult<T> Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ToolCallResult(T?, Exception, bool) Initializes a new instance of the ToolCallResult<T> class. protected ToolCallResult(T? value, Exception error, bool isSuccess) Parameters value T The value of the tool call result. error Exception The error of the tool call result. isSuccess bool Indicates whether the tool call was successful. Properties Error The error of the tool call result. public Exception Error { get; } Property Value Exception Exceptions InvalidOperationException Thrown when the result is successful. IsFailure Indicates whether the tool call failed. public bool IsFailure { get; } Property Value bool IsSuccess Indicates whether the tool call was successful. public bool IsSuccess { get; } Property Value bool Value The value of the tool call result. Can be null if the call failed, the call was successful but the return type is void or Task, or the call was successful but the return value is null public T? Value { get; } Property Value T Exceptions InvalidOperationException Thrown when the result is not successful. Methods Failure(Exception) Creates a failed ool call result. public static ToolCallResult<T> Failure(Exception error) Parameters error Exception The error of the tool call result. Returns ToolCallResult<T> A new instance of the ToolCallResult<T> class. Success(T?) Creates a successful tool call result. public static ToolCallResult<T> Success(T? value) Parameters value T The value of the tool call result. Returns ToolCallResult<T> A new instance of the ToolCallResult<T> class."
|
|
},
|
|
"api/AnthropicClient.Models.ToolChoice.html": {
|
|
"href": "api/AnthropicClient.Models.ToolChoice.html",
|
|
"title": "Class ToolChoice | AnthropicClient",
|
|
"keywords": "Class ToolChoice Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a tool choice mode. public abstract class ToolChoice Inheritance object ToolChoice Derived AnyToolChoice AutoToolChoice SpecificToolChoice Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ToolChoice(string) Initializes a new instance of the ToolChoice class. protected ToolChoice(string type) Parameters type string The type of the tool choice. Properties Type Gets the type of the tool choice. public string Type { get; init; } Property Value string"
|
|
},
|
|
"api/AnthropicClient.Models.ToolChoiceType.html": {
|
|
"href": "api/AnthropicClient.Models.ToolChoiceType.html",
|
|
"title": "Class ToolChoiceType | AnthropicClient",
|
|
"keywords": "Class ToolChoiceType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the tool choice type. public class ToolChoiceType Inheritance object ToolChoiceType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Any Represents the any tool choice type. public const string Any = \"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"
|
|
},
|
|
"api/AnthropicClient.Models.ToolResultContent.html": {
|
|
"href": "api/AnthropicClient.Models.ToolResultContent.html",
|
|
"title": "Class ToolResultContent | AnthropicClient",
|
|
"keywords": "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 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. 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"
|
|
},
|
|
"api/AnthropicClient.Models.ToolUseContent.html": {
|
|
"href": "api/AnthropicClient.Models.ToolUseContent.html",
|
|
"title": "Class ToolUseContent | AnthropicClient",
|
|
"keywords": "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 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"
|
|
},
|
|
"api/AnthropicClient.Models.Usage.html": {
|
|
"href": "api/AnthropicClient.Models.Usage.html",
|
|
"title": "Class Usage | AnthropicClient",
|
|
"keywords": "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 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"
|
|
},
|
|
"api/AnthropicClient.Models.html": {
|
|
"href": "api/AnthropicClient.Models.html",
|
|
"title": "Namespace AnthropicClient.Models | AnthropicClient",
|
|
"keywords": "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. 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. 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. Error Represents an error. ErrorEventData Represents data for an error event. ErrorType Represents the error type. EventData Represents data for an event. EventType Provides constants for event types. 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. 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. 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 a message request. TextContent Represents text content that is part of a message. TextDelta Represents a text delta. Tool Represents a tool that can be used. ToolCall Represents a tool call. ToolCallResult<T> Represents a tool call result. ToolChoice Represents a tool choice mode. ToolChoiceType Represents the tool choice type. ToolResultContent Represents tool result content that is part of a message. ToolUseContent Represents tool use content that is part of a message. Usage Represents the usage of a response. Interfaces ITool Interface that a class can implement to be used to create a tool."
|
|
},
|
|
"api/AnthropicClient.html": {
|
|
"href": "api/AnthropicClient.html",
|
|
"title": "Namespace AnthropicClient | AnthropicClient",
|
|
"keywords": "Namespace AnthropicClient Classes AnthropicApiClient Represents a client for interacting with the Anthropic API. Interfaces IAnthropicApiClient Represents a client for interacting with the Anthropic API."
|
|
},
|
|
"index.html": {
|
|
"href": "index.html",
|
|
"title": "AnthropicClient | AnthropicClient",
|
|
"keywords": "AnthropicClient This library for the Anthropic API is meant to simplify development in C# for Anthropic users. Note This is an unofficial SDK for the Anthropic API. It was not built in consultation with Anthropic or any member of their organization. This SDK was developed independently using existing libraries and the Anthropic API documentation as the starting point with the intention of making development of integrations done in C# with Anthropic quicker and more convenient. Note This client library is heavily inspired by the Anthropic.SDK library. I chose to create a new library because I wanted to handle streaming and tool calling differently as well as have control over the client library as I plan to use it to build a connector for SemanticKernel. However if you are looking for a client library the Anthropic.SDK is a great place to start. 📝 Issues If you encounter any issues while using this library please open an issue here. 📜 License This library is licensed under the MIT License and is free to use and modify. 📝 Contributing If you would like to contribute to this library please open a pull request here. 🛠️ Dependencies Microsoft.Bcl.AsyncInterfaces Used to support async interfaces when streaming messages System.Text.Json Used for JSON serialization and deserialization 💾 Installation Install the package from NuGet using the following command: dotnet add package AnthropicClient 🔑 API Key In order to use the Anthropic API you will need an API key. You can get one by signing up at Anthropic. Please keep your API key secure and do not share it with others. Be mindful of where you store your API key and do not commit it to a public repository. 👨🏻💻 Start Coding AnthropicApiClient The most common way to use the SDK is to create an AnthropicApiClient instance and call its methods. Its constructor requires two parameters: apiKey - your Anthropic API key httpClient - an HttpClient instance. You can configure and customize the HttpClient instance as needed. This library however will perform the necessary configuration to work with the Anthropic API. Such as setting the base address and adding the proper headers. Note This library does not manage the lifecycle of the HttpClient instance. You should create and manage the lifecycle of the HttpClient instance in your application. It is best practice to read the API key from a secure location such as a configuration file or environment variable. For example using the appsettings.json file: { \"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\"]; var client = new AnthropicApiClient(apiKey, new HttpClient()); IAnthropicApiClient The library does expose an interface IAnthropicApiClient that can be used for dependency injection and testing. The interface is implemented by the AnthropicApiClient class. Full API Documentation This library was developed to make using the Anthropic API easier within a .NET application. If you are looking for the full API documentation you can find it at Anthropic API Documentation. Usage The primary use case for working with the Anthropic API is to create a message in response to a request that includes one or more other messages. The created message can then be received either as a complete response or a stream of events. This can be used to create a conversation between the caller and Anthropic's AI models and/or to use Anthropic's AI models to perform a task. Note The following examples assume that you have already created an instance of the AnthropicApiClient class named client. You can also find these snippets in the examples directory. Create a message The AnthropicApiClient exposes a single method named CreateMessageAsync that can be used to create a message. The method requires a MessageRequest or a StreamMessageRequest instance as a parameter. The MessageRequest class is used to create a message whose response is not streamed and the StreamMessageRequest class is used to create a message whose response is streamed. The MessageRequest instance's properties can be set to configure how the message is created. Non-Streaming using AnthropicClient; using AnthropicClient.Models; var response = await client.CreateMessageAsync(new MessageRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"Please write a haiku about the ocean.\")] ) ] )); if (response.IsSuccess is false) { Console.WriteLine($\"Failed to create message\"); Console.WriteLine($\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine($\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var content in response.Value.Content) { switch (content) { case TextContent textContent: Console.WriteLine(textContent.Text); break; } } Streaming Anthropic uses Server-Sent Events (SSE) to stream messages. The possible events and the format of those events are documented in the Anthropic API Documentation. This library provides a way to consume them after they have been deserialized into strongly-typed C# objects that are returned in an IAsyncEnumerable collection. This allows you to consume the events as they are received and process them in the way that best fits your use case. The following example demonstrates how to consume the streamed events and build up the complete text response from the model. using AnthropicClient; using AnthropicClient.Models; var events = client.CreateMessageAsync(new StreamMessageRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"Please write a haiku about the ocean.\")] ) ] )); var msgBuilder = new StringBuilder(); await foreach (var e in events) { switch (e.Data) { case var data when data is ContentDeltaEventData contentData: switch (contentData.Delta) { case var delta when delta is TextDelta textDelta: msgBuilder.Append(textDelta.Text); break; } break; } } Console.WriteLine(msgBuilder.ToString()); Message Complete Event This library also provides a custom message_complete event that is yielded when all the message's events have been received. This event is not part of Anthropic's SSE events but is provided to allow for easier consumption of the entire message response if desired and make it easier to implement built-in tool calling. using AnthropicClient; using AnthropicClient.Models; var events = client.CreateMessageAsync(new StreamMessageRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"Please write a haiku about the ocean.\")] ) ] )); MessageResponse? response = null; await foreach (var e in events) { switch (e.Data) { case var data when data is MessageCompleteEventData msgData: response = msgData.Message; break; } } var textContent = response?.Content .OfType<TextContent>() .Aggregate(new StringBuilder(), (sb, c) => sb.Append(c.Text)) .ToString(); Console.WriteLine(textContent); Tool Use Anthropic's models support the use of tools to perform tasks. This allows the models to interact with external client-side tools that can perform actions the models cannot do natively. This gives you the ability to further extend the model's abilities with your own custom tools. This feature is covered in depth in Anthropic's API Documentation. This library aims to make using tools convenient by allowing you to create, provide, and call tools from within your application by leveraging the reflection capabilities of C#. Note All tools are user provided. The models do no not have access to any built-in server-side tools. Create a tool You can create a tool in 4 different ways and then provide that tool when creating a message. Create a tool from a class Create a tool from a static method Create a tool from an instance method Create a tool from a delegate Create a tool from a class When creating a tool from a class the class must implement the ITool interface. using AnthropicClient.Models; class GetWeatherTool : ITool { public string Name => \"Get Weather\"; public string Description => \"Get the weather for a location in the specified units\"; public MethodInfo Function => typeof(GetWeatherTool).GetMethod(nameof(GetWeather))!; public static string GetWeather(string location, string units) { return $\"The weather in {location} is 72 degrees {units}\"; } } var getWeatherTool = Tool.CreateFromClass<GetWeatherTool>(); Create a tool from a static method When creating a tool from a static method the method must be public and static. using AnthropicClient.Models; class GetWeatherTool { public static string GetWeather(string location) { return $\"The weather in {location} is 72 degrees Fahrenheit\"; } } var getWeatherTool = Tool.CreateFromStaticMethod( \"Get Weather\", \"Get the weather for a location in the specified units\", typeof(GetWeatherTool), nameof(GetWeatherTool.GetWeather) ); Create a tool from an instance method When creating a tool from an instance method the method must be public and non-static. using AnthropicClient.Models; class GetWeatherTool { public string GetWeather(string location) { return $\"The weather in {location} is 72 degrees Fahrenheit\"; } } var toolInstance = new GetWeatherTool(); var getWeatherTool = Tool.CreateFromInstanceMethod( \"Get Weather\", \"Get the weather for a location in the specified units\", toolInstance, nameof(toolInstance.GetWeather) ); Create a tool from a delegate When creating a tool from a delegate the delegate must be a Func<TResult>, Func<T, TResult>, or Func<T1, T2, TResult>. If you need to create a tool from a delegate that takes more than 2 parameters you should create a complex type and pass that as the parameter. using AnthropicClient.Models; var tool = (string location, string units) => $\"The weather in {location} is 72 degrees {units}\"; var getWeatherTool = Tool.CreateFromFunction( \"Get Weather\", \"Get the weather for a location in the specified units\", tool ); Function Parameter Attribute When you create a tool from one of the methods above and send it to Anthropic in your request a JSON representation of the tool is provided in the message. This JSON representation includes the name, description, and input schema of the tool. This information is used by Anthropic's models to discern if and when it should use a tool. This library provides a FunctionParameterAttribute that can be used to provide additional information about the parameters of the tool. This information is used to provide a more detailed input schema for the tool. using AnthropicClient.Models; var tool = ( [FunctionParameter(description: \"The location of the weather being got\", name: \"Location\", required: true)] string location, string units ) => $\"The weather in {location} is 72 degrees {units}\"; var getWeatherTool = Tool.CreateFromFunction( \"Get Weather\", \"Get the weather for a location in the specified units\", tool ); Function Property Attribute This library also provides a FunctionPropertyAttribute that can be used to provide additional information about the members of complex types used as parameters in the tool. This information is used to provide a more detailed input schema for the tool. using AnthropicClient.Models; class GetWeatherInput { [FunctionProperty( description: \"The location of the weather being got\", required: true )] public string Location { get; } = string.Empty; [FunctionProperty( description: \"The units to get the weather in\", required: false, defaultValue: \"Fahrenheit\", possibleValues: [\"Fahrenheit\", \"Celsius\"] )] public string Units { get; } = \"Fahrenheit\"; } var tool = (GetWeatherInput input) => $\"The weather in {input.Location} is 72 degrees {input.Units}\"; var getWeatherTool = Tool.CreateFromFunction( \"Get Weather\", \"Get the weather for a location in the specified units\", tool ); Call a tool It is important to remember that while Anthropic's models do support tool use they don't actually have access to any built-in server-side tools. All tools are user provided. This means that while Anthropic's models can respond to a request to create a message with a request to use a tool that is all it is - a request. It is still up to the client to handle the tool request by calling the tool with the input provided by the model and then providing the result of that call back to the model. This library aims to make this process convenient by allowing you to simply provide the tools you want Anthropic's models to consider for use when creating a message, receive the response, check if the response contains a tool call, and if it does invoke the tool to get the result. Note Anthropic's API expects requests to contain messages that alternate between the user and the assistant. In addition if you receive a tool use from the model the API expects you to respond with a message that contains the result of the tool call. The tool use content will always be from the assistant while the tool result will always be from the user. using AnthropicClient; using AnthropicClient.Models; class GetWeatherTool : ITool { public string Name => \"Get Weather\"; public string Description => \"Get the weather for a location in the specified units\"; public MethodInfo Function => typeof(GetWeatherTool).GetMethod(nameof(GetWeather))!; public static string GetWeather(string location, string units) { return $\"The weather in {location} is 72 degrees {units}\"; } } List<Message> messages = [ new( MessageRole.User, [new TextContent(\"What is the weather in New York?\")] ) ]; List<Tool> tools = [Tool.CreateFromClass<GetWeatherTool>()]; var response = await client.CreateMessageAsync(new MessageRequest( AnthropicModels.Claude3Haiku, messages, tools: tools )); if (response.IsSuccess is false) { Console.WriteLine($\"Failed to create message\"); Console.WriteLine($\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine($\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var content in response.Value.Content) { messages.Add(new(MessageRole.Assistant, [content])); switch (content) { case TextContent textContent: Console.WriteLine(textContent.Text); break; case ToolUseContent toolUseContent: Console.WriteLine(toolUseContent.Name); break; } } if (response.Value.ToolCall is not null) { var toolCallResult = await response.Value.ToolCall.InvokeAsync<string>(); string toolResultContent; if (toolCallResult.IsSuccess && toolCallResult.Value is not null) { Console.WriteLine(toolCallResult.Value); toolResultContent = toolCallResult.Value; } else { Console.WriteLine(toolCallResult.Error.Message); toolResultContent = toolCallResult.Error.Message; } messages.Add( new( MessageRole.User, [ new ToolResultContent( response.Value.ToolCall.ToolUse.Id, toolResultContent ) ] ) ); } var finalResponse = await client.CreateMessageAsync(new MessageRequest( AnthropicModels.Claude3Haiku, messages, tools: tools )); if (finalResponse.IsSuccess is false) { Console.WriteLine($\"Failed to create message\"); Console.WriteLine($\"Error Type: {0}\", finalResponse.Error.Error.Type); Console.WriteLine($\"Error Message: {0}\", finalResponse.Error.Error.Message); return; } foreach (var content in finalResponse.Value.Content) { switch (content) { case TextContent textContent: Console.WriteLine(textContent.Text); break; } } If an exception is thrown while invoking the tool the InvokeAsync method will return a ToolCallResult with the exception contained in the Error property. Note The InvokeAsync method does accept a generic type parameter that can be used to specify the type of the Value property of the ToolCallResult. If it is not specified it will be an object. Call a tool in streamed message Tool calling is also supported when streaming the message response. The following example demonstrates how you can handle a tool call in a streamed message response. using AnthropicClient; using AnthropicClient.Models; var tool = (string location, string units) => $\"The weather in {location} is 72 degrees {units}\"; var messages = [ new( MessageRole.User, [new TextContent(\"What is the weather in New York?\")] ) ]; var tools = [Tool.CreateFromFunction( \"Get Weather\", \"Get the weather for a location in the specified units\", tool )]; var events = client.CreateMessageAsync(new StreamMessageRequest( AnthropicModels.Claude3Haiku, messages, tools: tools )); MessageResponse? response = null; await foreach (var e in events) { switch (e.Data) { case var data when data is MessageCompleteEventData msgData: response = msgData.Message; break; } } if (response is null) { Console.WriteLine(\"Failed to get message response\"); return; } foreach (var content in response.Content) { messages.Add(new(MessageRole.Assistant, [content])); } if (response?.ToolCall is not null) { var toolCallResult = await response.ToolCall.InvokeAsync<string>(); string toolResultContent; if (toolCallResult.IsSuccess && toolCallResult.Value is not null) { toolResultContent = toolCallResult.Value; } else { toolResultContent = toolCallResult.Error.Message; } messages.Add( new( MessageRole.User, [ new ToolResultContent( response.ToolCall.ToolUse.Id, toolResultContent ) ] ) ); } var finalResponse = await client.CreateMessageAsync(new MessageRequest( AnthropicModels.Claude3Haiku, messages, tools: tools )); if (finalResponse.IsSuccess is false) { Console.WriteLine($\"Failed to create message\"); Console.WriteLine($\"Error Type: {0}\", finalResponse.Error.Error.Type); Console.WriteLine($\"Error Message: {0}\", finalResponse.Error.Error.Message); return; } foreach (var content in finalResponse.Value.Content) { switch (content) { case TextContent textContent: Console.WriteLine(textContent.Text); break; } } If you do find that you need more control over how exactly provided tools are called and how the result of those tools are returned you can avoid using the InvokeAsync method and instead use the Tool and ToolUse properties of the ToolCall instance to implement your own solution."
|
|
}
|
|
} |