diff --git a/docs/api/AnthropicClient.AnthropicApiClient.html b/docs/api/AnthropicClient.AnthropicApiClient.html index e370a90..eccdeea 100644 --- a/docs/api/AnthropicClient.AnthropicApiClient.html +++ b/docs/api/AnthropicClient.AnthropicApiClient.html @@ -163,7 +163,7 @@ Class AnthropicApiClient AnthropicApiClient(string, HttpClient) - +

Initializes a new instance of the AnthropicApiClient class.

@@ -209,7 +209,7 @@ Class AnthropicApiClient CancelMessageBatchAsync(string, CancellationToken) - +

Cancels a message batch asynchronously.

@@ -251,7 +251,7 @@ Class AnthropicApiClient CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) - +

Counts the tokens in a message asynchronously.

@@ -289,11 +289,53 @@ Class AnthropicApiClient + +

+ CreateFileAsync(CreateFileRequest, CancellationToken) + +

+ +

Creates a file asynchronously using the Files API.

+
+
+ +
+
public Task<AnthropicResult<AnthropicFile>> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
request CreateFileRequest
+

The file creation request.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<AnthropicFile>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

CreateMessageAsync(MessageRequest, CancellationToken) - +

Creates a message asynchronously.

@@ -335,7 +377,7 @@ Class AnthropicApiClient CreateMessageAsync(StreamMessageRequest, CancellationToken) - +

Creates a message asynchronously and streams the response.

@@ -377,7 +419,7 @@ Class AnthropicApiClient CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) - +

Creates a batch of messages asynchronously.

@@ -415,11 +457,53 @@ Class AnthropicApiClient + +

+ DeleteFileAsync(string, CancellationToken) + +

+ +

Deletes a file by its ID asynchronously.

+
+
+ +
+
public Task<AnthropicResult<AnthropicFileDeleteResponse>> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
fileId string
+

The ID of the file to delete.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<AnthropicFileDeleteResponse>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is AnthropicFileDeleteResponse.

+
+
+ + + + + + + + + + +

DeleteMessageBatchAsync(string, CancellationToken) - +

Deletes a message batch asynchronously.

@@ -457,11 +541,95 @@ Class AnthropicApiClient + +

+ GetFileAsync(string, CancellationToken) + +

+ +

Gets a file's content by its ID asynchronously.

+
+
+ +
+
public Task<AnthropicResult<Stream>> GetFileAsync(string fileId, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
fileId string
+

The ID of the file to get the content for.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<Stream>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is a stream containing the file content.

+
+
+ + + + + + + + + + + + + +

+ GetFileInfoAsync(string, CancellationToken) + +

+ +

Gets a file's metadata by its ID asynchronously.

+
+
+ +
+
public Task<AnthropicResult<AnthropicFile>> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
fileId string
+

The ID of the file to get.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<AnthropicFile>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

GetMessageBatchAsync(string, CancellationToken) - +

Gets a message batch asynchronously.

@@ -503,7 +671,7 @@ Class AnthropicApiClient GetMessageBatchResultsAsync(string, CancellationToken) - +

Gets the results of a message batch asynchronously.

@@ -545,7 +713,7 @@ Class AnthropicApiClient GetModelAsync(string, CancellationToken) - +

Gets a model by its ID asynchronously.

@@ -583,11 +751,53 @@ Class AnthropicApiClient + +

+ ListAllFilesAsync(int, CancellationToken) + +

+ +

Lists all files asynchronously, returning every page of results.

+
+
+ +
+
public IAsyncEnumerable<AnthropicResult<Page<AnthropicFile>>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
limit int
+

The maximum number of files to return in each page.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
IAsyncEnumerable<AnthropicResult<Page<AnthropicFile>>>
+

An asynchronous enumerable that yields the response as an AnthropicResult<T> where T is Page<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

ListAllMessageBatchesAsync(int, CancellationToken) - +

Lists all message batches asynchronously.

@@ -629,7 +839,7 @@ Class AnthropicApiClient ListAllModelsAsync(int, CancellationToken) - +

Lists all models asynchronously, returning every page of results.

@@ -667,11 +877,53 @@ Class AnthropicApiClient + +

+ ListFilesAsync(PagingRequest?, CancellationToken) + +

+ +

Lists files asynchronously, returning a single page of results.

+
+
+ +
+
public Task<AnthropicResult<Page<AnthropicFile>>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
request PagingRequest
+

The paging request to use for listing the files.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<Page<AnthropicFile>>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is Page<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

ListMessageBatchesAsync(PagingRequest?, CancellationToken) - +

Lists the message batches asynchronously.

@@ -713,7 +965,7 @@ Class AnthropicApiClient ListModelsAsync(PagingRequest?, CancellationToken) - +

Lists models asynchronously, returning a single page of results.

diff --git a/docs/api/AnthropicClient.IAnthropicApiClient.html b/docs/api/AnthropicClient.IAnthropicApiClient.html index c2ead15..c359ea4 100644 --- a/docs/api/AnthropicClient.IAnthropicApiClient.html +++ b/docs/api/AnthropicClient.IAnthropicApiClient.html @@ -205,6 +205,48 @@ Interface IAnthropicApiClient + +

+ CreateFileAsync(CreateFileRequest, CancellationToken) + +

+ +

Creates a file asynchronously using the Files API.

+
+
+ +
+
Task<AnthropicResult<AnthropicFile>> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
request CreateFileRequest
+

The file creation request.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<AnthropicFile>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

@@ -331,6 +373,48 @@ Interface IAnthropicApiClient + +

+ DeleteFileAsync(string, CancellationToken) + +

+ +

Deletes a file by its ID asynchronously.

+
+
+ +
+
Task<AnthropicResult<AnthropicFileDeleteResponse>> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
fileId string
+

The ID of the file to delete.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<AnthropicFileDeleteResponse>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is AnthropicFileDeleteResponse.

+
+
+ + + + + + + + + + +

@@ -373,6 +457,90 @@ Interface IAnthropicApiClient + +

+ GetFileAsync(string, CancellationToken) + +

+ +

Gets a file's content by its ID asynchronously.

+
+
+ +
+
Task<AnthropicResult<Stream>> GetFileAsync(string fileId, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
fileId string
+

The ID of the file to get the content for.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<Stream>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is a stream containing the file content.

+
+
+ + + + + + + + + + + + + +

+ GetFileInfoAsync(string, CancellationToken) + +

+ +

Gets a file's metadata by its ID asynchronously.

+
+
+ +
+
Task<AnthropicResult<AnthropicFile>> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
fileId string
+

The ID of the file to get.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<AnthropicFile>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

@@ -499,6 +667,48 @@ Interface IAnthropicApiClient + +

+ ListAllFilesAsync(int, CancellationToken) + +

+ +

Lists all files asynchronously, returning every page of results.

+
+
+ +
+
IAsyncEnumerable<AnthropicResult<Page<AnthropicFile>>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
limit int
+

The maximum number of files to return in each page.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
IAsyncEnumerable<AnthropicResult<Page<AnthropicFile>>>
+

An asynchronous enumerable that yields the response as an AnthropicResult<T> where T is Page<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

@@ -583,6 +793,48 @@ Interface IAnthropicApiClient + +

+ ListFilesAsync(PagingRequest?, CancellationToken) + +

+ +

Lists files asynchronously, returning a single page of results.

+
+
+ +
+
Task<AnthropicResult<Page<AnthropicFile>>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default)
+
+ +

Parameters

+
+
request PagingRequest
+

The paging request to use for listing the files.

+
+
cancellationToken CancellationToken
+

A token to cancel the asynchronous operation.

+
+
+ +

Returns

+
+
Task<AnthropicResult<Page<AnthropicFile>>>
+

A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult<T> where T is Page<T> where T is AnthropicFile.

+
+
+ + + + + + + + + + +

diff --git a/docs/api/AnthropicClient.Models.AnthropicFile.html b/docs/api/AnthropicClient.Models.AnthropicFile.html new file mode 100644 index 0000000..db3c6d8 --- /dev/null +++ b/docs/api/AnthropicClient.Models.AnthropicFile.html @@ -0,0 +1,412 @@ + + + + + Class AnthropicFile | AnthropicClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ +
+
+ + + +
+ +
+ + + +

+Class AnthropicFile +

+ +
+
Namespace
AnthropicClient.Models
+
Assembly
AnthropicClient.dll
+
+ +

Represents a file object from the Anthropic Files API.

+
+
+ +
+
public class AnthropicFile
+
+ + + + +
+
Inheritance
+
+ +
AnthropicFile
+
+
+ + + +
+
Inherited Members
+
+ + + + + + + +
+ + + + + + +

Properties +

+ + + + +

+ CreatedAt + +

+ +

Date file was created.

+
+
+ +
+
[JsonPropertyName("created_at")]
+public DateTimeOffset CreatedAt { get; init; }
+
+ + + + + +

Property Value

+
+
DateTimeOffset
+
+
+ + + + + + + + + + +

+ Downloadable + +

+ +

Whether the file can be downloaded.

+
+
+ +
+
[JsonPropertyName("downloadable")]
+public bool Downloadable { get; init; }
+
+ + + + + +

Property Value

+
+
bool
+
+
+ + + + + + + + + + +

+ Id + +

+ +

Unique object identifier.

+
+
+ +
+
[JsonPropertyName("id")]
+public string Id { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + + +

+ MimeType + +

+ +

MIME type of the file.

+
+
+ +
+
[JsonPropertyName("mime_type")]
+public string MimeType { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + + +

+ Name + +

+ +

Original filename of the uploaded file.

+
+
+ +
+
[JsonPropertyName("filename")]
+public string Name { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + + +

+ Size + +

+ +

Size of the file in bytes.

+
+
+ +
+
[JsonPropertyName("size_bytes")]
+public long Size { get; init; }
+
+ + + + + +

Property Value

+
+
long
+
+
+ + + + + + + + + + +

+ Type + +

+ +

Object type.

+
+
+ +
+
[JsonPropertyName("type")]
+public string Type { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + +
+ + + + +
+ +
+ +
+
+ +
+ +
+
+
+ Made with docfx +
+
+
+ + diff --git a/docs/api/AnthropicClient.Models.AnthropicFileDeleteResponse.html b/docs/api/AnthropicClient.Models.AnthropicFileDeleteResponse.html new file mode 100644 index 0000000..7a7f1af --- /dev/null +++ b/docs/api/AnthropicClient.Models.AnthropicFileDeleteResponse.html @@ -0,0 +1,245 @@ + + + + + Class AnthropicFileDeleteResponse | AnthropicClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ +
+
+ + + +
+ +
+ + + +

+Class AnthropicFileDeleteResponse +

+ +
+
Namespace
AnthropicClient.Models
+
Assembly
AnthropicClient.dll
+
+ +

Represents the response from deleting a file in the Anthropic API.

+
+
+ +
+
public class AnthropicFileDeleteResponse
+
+ + + + +
+
Inheritance
+
+ +
AnthropicFileDeleteResponse
+
+
+ + + +
+
Inherited Members
+
+ + + + + + + +
+ + + + + + +

Properties +

+ + + + +

+ Id + +

+ +

Gets or sets the ID of the file that was deleted.

+
+
+ +
+
public string Id { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + + +

+ Type + +

+ +

Gets or sets the response type

+
+
+ +
+
public string Type { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + +
+ + + + +
+ +
+ +
+
+ +
+ +
+
+
+ Made with docfx +
+
+
+ + diff --git a/docs/api/AnthropicClient.Models.AnthropicModels.html b/docs/api/AnthropicClient.Models.AnthropicModels.html index 906b235..4937e36 100644 --- a/docs/api/AnthropicClient.Models.AnthropicModels.html +++ b/docs/api/AnthropicClient.Models.AnthropicModels.html @@ -156,7 +156,7 @@ Class AnthropicModels Claude35Haiku20241022 - +

The Claude 3.5 Haiku model.

@@ -187,7 +187,7 @@ Class AnthropicModels Claude35HaikuLatest - +

The Claude 3.5 Haiku model.

@@ -218,7 +218,7 @@ Class AnthropicModels Claude35Sonnet - +

The Claude 3.5 Sonnet model.

@@ -249,7 +249,7 @@ Class AnthropicModels Claude35Sonnet20240620 - +

The Claude 3.5 Sonnet model.

@@ -280,7 +280,7 @@ Class AnthropicModels Claude35Sonnet20241022 - +

The Claude 3.5 Sonnet model.

@@ -311,7 +311,7 @@ Class AnthropicModels Claude35SonnetLatest - +

The Claude 3.5 Sonnet model.

@@ -340,9 +340,71 @@ Class AnthropicModels + Claude37Sonnet20250219 + + + +

The Claude 3 Sonnet model

+
+
+ +
+
public const string Claude37Sonnet20250219 = "claude-3-7-sonnet-20250219"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + + +

+ Claude37SonnetLatest + +

+ +

The Claude 3 Sonnet model

+
+
+ +
+
public const string Claude37SonnetLatest = "claude-3-7-sonnet-latest"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + +

Claude3Haiku - +

The Claude 3 Haiku model.

@@ -373,7 +435,7 @@ Class AnthropicModels Claude3Haiku20240307 - +

The Claude 3 Haiku model.

@@ -497,7 +559,7 @@ Class AnthropicModels Claude3Sonnet - +

The Claude 3 Sonnet model.

@@ -528,7 +590,7 @@ Class AnthropicModels Claude3Sonnet20240229 - +

The Claude 3 Sonnet model.

@@ -557,6 +619,130 @@ Class AnthropicModels + ClaudeOpus40 + + + +

The Claude 4 Opus model.

+
+
+ +
+
public const string ClaudeOpus40 = "claude-opus-4-0"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + + +

+ ClaudeOpus420250514 + +

+ +

The Claude 4 Opus model.

+
+
+ +
+
public const string ClaudeOpus420250514 = "claude-opus-4-20250514"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + + +

+ ClaudeSonnet40 + +

+ +

The Claude 4 Sonnet model.

+
+
+ +
+
public const string ClaudeSonnet40 = "claude-sonnet-4-0"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + + +

+ ClaudeSonnet420250514 + +

+ +

The Claude 4 Sonnet model.

+
+
+ +
+
public const string ClaudeSonnet420250514 = "claude-sonnet-4-20250514"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + +
diff --git a/docs/api/AnthropicClient.Models.CreateFileRequest.html b/docs/api/AnthropicClient.Models.CreateFileRequest.html new file mode 100644 index 0000000..546a1cf --- /dev/null +++ b/docs/api/AnthropicClient.Models.CreateFileRequest.html @@ -0,0 +1,377 @@ + + + + + Class CreateFileRequest | AnthropicClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ +
+
+ + + +
+ +
+ + + +

+Class CreateFileRequest +

+ +
+
Namespace
AnthropicClient.Models
+
Assembly
AnthropicClient.dll
+
+ +

Represents a request to create a file via the Anthropic Files API.

+
+
+ +
+
public class CreateFileRequest
+
+ + + + +
+
Inheritance
+
+ +
CreateFileRequest
+
+
+ + + +
+
Inherited Members
+
+ + + + + + + +
+ + + + + + +

Constructors +

+ + + + +

+ CreateFileRequest(byte[], string, string) + +

+ +

Initializes a new instance of the CreateFileRequest class.

+
+
+ +
+
public CreateFileRequest(byte[] file, string fileName, string fileType)
+
+ +

Parameters

+
+
file byte[]
+

The file content as a byte array.

+
+
fileName string
+

The original filename of the file being uploaded.

+
+
fileType string
+

The MIME type of the file.

+
+
+ + + + + + + + + +

Exceptions

+
+
ArgumentNullException
+

Thrown when file is null.

+
+
ArgumentException
+

Thrown when fileName or fileType is null or whitespace.

+
+
+ + + + + +

+ CreateFileRequest(Stream, string, string) + +

+ +

Initializes a new instance of the CreateFileRequest class from a stream.

+
+
+ +
+
public CreateFileRequest(Stream stream, string fileName, string fileType)
+
+ +

Parameters

+
+
stream Stream
+

The stream containing the file content.

+
+
fileName string
+

The original filename of the file being uploaded.

+
+
fileType string
+

The MIME type of the file.

+
+
+ + + + + + + + + +

Exceptions

+
+
ArgumentNullException
+

Thrown when stream is null.

+
+
ArgumentException
+

Thrown when fileName or fileType is null or whitespace.

+
+
+ + + +

Properties +

+ + + + +

+ File + +

+ +

The file content as a byte array.

+
+
+ +
+
public byte[] File { get; init; }
+
+ + + + + +

Property Value

+
+
byte[]
+
+
+ + + + + + + + + + +

+ FileName + +

+ +

The original filename of the file being uploaded.

+
+
+ +
+
public string FileName { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + + +

+ FileType + +

+ +

The MIME type of the file.

+
+
+ +
+
public string FileType { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + +
+ + + + +
+ +
+ +
+
+ +
+ +
+
+
+ Made with docfx +
+
+
+ + diff --git a/docs/api/AnthropicClient.Models.DocumentSource.html b/docs/api/AnthropicClient.Models.DocumentSource.html index f3fb70e..60f8341 100644 --- a/docs/api/AnthropicClient.Models.DocumentSource.html +++ b/docs/api/AnthropicClient.Models.DocumentSource.html @@ -89,7 +89,7 @@

-Class DocumentSource +Class DocumentSource

@@ -168,7 +168,7 @@ Class DocumentSource DocumentSource(string, string) - +

Initializes a new instance of the DocumentSource class.

@@ -213,7 +213,7 @@ Class DocumentSource - Edit this page + Edit this page
diff --git a/docs/api/AnthropicClient.Models.FileSource.html b/docs/api/AnthropicClient.Models.FileSource.html new file mode 100644 index 0000000..6302de4 --- /dev/null +++ b/docs/api/AnthropicClient.Models.FileSource.html @@ -0,0 +1,282 @@ + + + + + Class FileSource | AnthropicClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ +
+
+ + + +
+ +
+ + + +

+Class FileSource +

+ +
+
Namespace
AnthropicClient.Models
+
Assembly
AnthropicClient.dll
+
+ +

Represents a file source in the Anthropic API.

+
+
+ +
+
public class FileSource : Source
+
+ + + + +
+
Inheritance
+
+ + +
FileSource
+
+
+ + + +
+
Inherited Members
+
+ + + + + + + + +
+ + + + + + +

Constructors +

+ + + + +

+ FileSource() + +

+ +

Initializes a new instance of the FileSource class.

+
+
+ +
+
public FileSource()
+
+ + + + + + + + + + + + + + + +

+ FileSource(string) + +

+ +

Initializes a new instance of the FileSource class with a specified file ID.

+
+
+ +
+
public FileSource(string id)
+
+ +

Parameters

+
+
id string
+

The unique identifier for the file source.

+
+
+ + + + + + + + + + + + +

Properties +

+ + + + +

+ Id + +

+ +

Gets or sets the unique identifier for the file source.

+
+
+ +
+
[JsonPropertyName("file_id")]
+public string Id { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + +
+ + + + +
+ +
+ +
+
+ +
+ +
+
+
+ Made with docfx +
+
+
+ + diff --git a/docs/api/AnthropicClient.Models.ImageContent.html b/docs/api/AnthropicClient.Models.ImageContent.html index 6425efd..b4040e7 100644 --- a/docs/api/AnthropicClient.Models.ImageContent.html +++ b/docs/api/AnthropicClient.Models.ImageContent.html @@ -160,6 +160,87 @@ Class ImageContent + + +

+ ImageContent(Source) + +

+ +

Initializes a new instance of the ImageContent class.

+
+
+ +
+
public ImageContent(Source source)
+
+ +

Parameters

+
+
source Source
+

The source of the image.

+
+
+ + + + + + + + + +

Exceptions

+
+
ArgumentNullException
+

Thrown when the source is null.

+
+
+ + + + + +

+ ImageContent(Source, CacheControl) + +

+ +

Initializes a new instance of the ImageContent class.

+
+
+ +
+
public ImageContent(Source source, CacheControl cacheControl)
+
+ +

Parameters

+
+
source Source
+

The source of the image.

+
+
cacheControl CacheControl
+

The cache control to be used for the content.

+
+
+ + + + + + + + + +

Exceptions

+
+
ArgumentNullException
+

Thrown when the source or cache control is null.

+
+
+ + +

diff --git a/docs/api/AnthropicClient.Models.ImageSource.html b/docs/api/AnthropicClient.Models.ImageSource.html index c185d16..d3e8567 100644 --- a/docs/api/AnthropicClient.Models.ImageSource.html +++ b/docs/api/AnthropicClient.Models.ImageSource.html @@ -89,7 +89,7 @@

-Class ImageSource +Class ImageSource

@@ -168,7 +168,7 @@ Class ImageSource ImageSource(string, string) - +

Initializes a new instance of the ImageSource class.

@@ -213,7 +213,7 @@ Class ImageSource diff --git a/docs/api/AnthropicClient.Models.Source.html b/docs/api/AnthropicClient.Models.Source.html index 777266e..ff601e7 100644 --- a/docs/api/AnthropicClient.Models.Source.html +++ b/docs/api/AnthropicClient.Models.Source.html @@ -122,7 +122,9 @@ Class Source Base64Source
+ + diff --git a/docs/api/AnthropicClient.Models.SourceType.html b/docs/api/AnthropicClient.Models.SourceType.html index 89a3821..e1271bc 100644 --- a/docs/api/AnthropicClient.Models.SourceType.html +++ b/docs/api/AnthropicClient.Models.SourceType.html @@ -216,6 +216,37 @@ Class SourceType + File + + + +

The file document source type.

+
+
+ +
+
public const string File = "file"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + +

Text @@ -247,6 +278,37 @@ Class SourceType + Url + +

+ +

The URL document source type.

+
+
+ +
+
public const string Url = "url"
+
+ + + + +

Field Value

+
+
string
+
+
+ + + + + + + + + +
diff --git a/docs/api/AnthropicClient.Models.UrlSource.html b/docs/api/AnthropicClient.Models.UrlSource.html new file mode 100644 index 0000000..0f7ad9d --- /dev/null +++ b/docs/api/AnthropicClient.Models.UrlSource.html @@ -0,0 +1,281 @@ + + + + + Class UrlSource | AnthropicClient + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
Table of Contents
+ +
+
+ +
+
+
+ +
+
+ + + +
+ +
+ + + +

+Class UrlSource +

+ +
+
Namespace
AnthropicClient.Models
+
Assembly
AnthropicClient.dll
+
+ +

Represents a URL source in the Anthropic API.

+
+
+ +
+
public class UrlSource : Source
+
+ + + + +
+
Inheritance
+
+ + +
UrlSource
+
+
+ + + +
+
Inherited Members
+
+ + + + + + + + +
+ + + + + + +

Constructors +

+ + + + +

+ UrlSource() + +

+ +

Initializes a new instance of the UrlSource class.

+
+
+ +
+
public UrlSource()
+
+ + + + + + + + + + + + + + + +

+ UrlSource(string) + +

+ +

Initializes a new instance of the UrlSource class with a specified URL.

+
+
+ +
+
public UrlSource(string url)
+
+ +

Parameters

+
+
url string
+

The URL of the source document.

+
+
+ + + + + + + + + + + + +

Properties +

+ + + + +

+ Url + +

+ +

Gets or sets the URL of the source document.

+
+
+ +
+
public string Url { get; init; }
+
+ + + + + +

Property Value

+
+
string
+
+
+ + + + + + + + + +
+ + + + +
+ +
+ +
+
+ +
+ +
+
+
+ Made with docfx +
+
+
+ + diff --git a/docs/api/AnthropicClient.Models.html b/docs/api/AnthropicClient.Models.html index 77103c2..0b27f0d 100644 --- a/docs/api/AnthropicClient.Models.html +++ b/docs/api/AnthropicClient.Models.html @@ -102,6 +102,16 @@ Classes
AnthropicEvent

Represents an event from the Anthropic API.

+
+
+
+
AnthropicFile
+

Represents a file object from the Anthropic Files API.

+
+
+
+
AnthropicFileDeleteResponse
+

Represents the response from deleting a file in the Anthropic API.

@@ -237,6 +247,11 @@ Classes
CountMessageTokensRequest

Represents a request to count the number of tokens in a message.

+
+
+
+
CreateFileRequest
+

Represents a request to create a file via the Anthropic Files API.

@@ -292,6 +307,11 @@ Classes
ExpiredMessageBatchResult

Represents a message batch result that has expired.

+
+
+
+
FileSource
+

Represents a file source in the Anthropic API.

@@ -557,6 +577,11 @@ Classes
ToolUseContent

Represents tool use content that is part of a message.

+
+
+
+
UrlSource
+

Represents a URL source in the Anthropic API.

diff --git a/docs/api/toc.html b/docs/api/toc.html index 5fa4e08..61ed76e 100644 --- a/docs/api/toc.html +++ b/docs/api/toc.html @@ -36,6 +36,12 @@
  • AnthropicEvent
  • +
  • + AnthropicFile +
  • +
  • + AnthropicFileDeleteResponse +
  • AnthropicFunction
  • @@ -117,6 +123,9 @@
  • CountMessageTokensRequest
  • +
  • + CreateFileRequest +
  • CustomSource
  • @@ -150,6 +159,9 @@
  • ExpiredMessageBatchResult
  • +
  • + FileSource +
  • FunctionParameterAttribute
  • @@ -312,6 +324,9 @@
  • ToolUseContent
  • +
  • + UrlSource +
  • Usage
  • diff --git a/docs/api/toc.json b/docs/api/toc.json index ff5ee64..4fbd060 100644 --- a/docs/api/toc.json +++ b/docs/api/toc.json @@ -1,2 +1,2 @@ -{"items":[{"name":"AnthropicClient","href":"AnthropicClient.html","topicHref":"AnthropicClient.html","topicUid":"AnthropicClient","type":"Namespace","items":[{"name":"AnthropicApiClient","href":"AnthropicClient.AnthropicApiClient.html","topicHref":"AnthropicClient.AnthropicApiClient.html","topicUid":"AnthropicClient.AnthropicApiClient","type":"Class"},{"name":"IAnthropicApiClient","href":"AnthropicClient.IAnthropicApiClient.html","topicHref":"AnthropicClient.IAnthropicApiClient.html","topicUid":"AnthropicClient.IAnthropicApiClient","type":"Interface"}]},{"name":"AnthropicClient.Models","href":"AnthropicClient.Models.html","topicHref":"AnthropicClient.Models.html","topicUid":"AnthropicClient.Models","type":"Namespace","items":[{"name":"AnthropicError","href":"AnthropicClient.Models.AnthropicError.html","topicHref":"AnthropicClient.Models.AnthropicError.html","topicUid":"AnthropicClient.Models.AnthropicError","type":"Class"},{"name":"AnthropicEvent","href":"AnthropicClient.Models.AnthropicEvent.html","topicHref":"AnthropicClient.Models.AnthropicEvent.html","topicUid":"AnthropicClient.Models.AnthropicEvent","type":"Class"},{"name":"AnthropicFunction","href":"AnthropicClient.Models.AnthropicFunction.html","topicHref":"AnthropicClient.Models.AnthropicFunction.html","topicUid":"AnthropicClient.Models.AnthropicFunction","type":"Class"},{"name":"AnthropicHeaders","href":"AnthropicClient.Models.AnthropicHeaders.html","topicHref":"AnthropicClient.Models.AnthropicHeaders.html","topicUid":"AnthropicClient.Models.AnthropicHeaders","type":"Class"},{"name":"AnthropicModel","href":"AnthropicClient.Models.AnthropicModel.html","topicHref":"AnthropicClient.Models.AnthropicModel.html","topicUid":"AnthropicClient.Models.AnthropicModel","type":"Class"},{"name":"AnthropicModels","href":"AnthropicClient.Models.AnthropicModels.html","topicHref":"AnthropicClient.Models.AnthropicModels.html","topicUid":"AnthropicClient.Models.AnthropicModels","type":"Class"},{"name":"AnyToolChoice","href":"AnthropicClient.Models.AnyToolChoice.html","topicHref":"AnthropicClient.Models.AnyToolChoice.html","topicUid":"AnthropicClient.Models.AnyToolChoice","type":"Class"},{"name":"ApiError","href":"AnthropicClient.Models.ApiError.html","topicHref":"AnthropicClient.Models.ApiError.html","topicUid":"AnthropicClient.Models.ApiError","type":"Class"},{"name":"AuthenticationError","href":"AnthropicClient.Models.AuthenticationError.html","topicHref":"AnthropicClient.Models.AuthenticationError.html","topicUid":"AnthropicClient.Models.AuthenticationError","type":"Class"},{"name":"AutoToolChoice","href":"AnthropicClient.Models.AutoToolChoice.html","topicHref":"AnthropicClient.Models.AutoToolChoice.html","topicUid":"AnthropicClient.Models.AutoToolChoice","type":"Class"},{"name":"Base64Source","href":"AnthropicClient.Models.Base64Source.html","topicHref":"AnthropicClient.Models.Base64Source.html","topicUid":"AnthropicClient.Models.Base64Source","type":"Class"},{"name":"BaseMessageRequest","href":"AnthropicClient.Models.BaseMessageRequest.html","topicHref":"AnthropicClient.Models.BaseMessageRequest.html","topicUid":"AnthropicClient.Models.BaseMessageRequest","type":"Class"},{"name":"CacheControl","href":"AnthropicClient.Models.CacheControl.html","topicHref":"AnthropicClient.Models.CacheControl.html","topicUid":"AnthropicClient.Models.CacheControl","type":"Class"},{"name":"CacheControlType","href":"AnthropicClient.Models.CacheControlType.html","topicHref":"AnthropicClient.Models.CacheControlType.html","topicUid":"AnthropicClient.Models.CacheControlType","type":"Class"},{"name":"CanceledMessageBatchResult","href":"AnthropicClient.Models.CanceledMessageBatchResult.html","topicHref":"AnthropicClient.Models.CanceledMessageBatchResult.html","topicUid":"AnthropicClient.Models.CanceledMessageBatchResult","type":"Class"},{"name":"CharacterLocationCitation","href":"AnthropicClient.Models.CharacterLocationCitation.html","topicHref":"AnthropicClient.Models.CharacterLocationCitation.html","topicUid":"AnthropicClient.Models.CharacterLocationCitation","type":"Class"},{"name":"Citation","href":"AnthropicClient.Models.Citation.html","topicHref":"AnthropicClient.Models.Citation.html","topicUid":"AnthropicClient.Models.Citation","type":"Class"},{"name":"CitationDelta","href":"AnthropicClient.Models.CitationDelta.html","topicHref":"AnthropicClient.Models.CitationDelta.html","topicUid":"AnthropicClient.Models.CitationDelta","type":"Class"},{"name":"CitationOption","href":"AnthropicClient.Models.CitationOption.html","topicHref":"AnthropicClient.Models.CitationOption.html","topicUid":"AnthropicClient.Models.CitationOption","type":"Class"},{"name":"CitationType","href":"AnthropicClient.Models.CitationType.html","topicHref":"AnthropicClient.Models.CitationType.html","topicUid":"AnthropicClient.Models.CitationType","type":"Class"},{"name":"Content","href":"AnthropicClient.Models.Content.html","topicHref":"AnthropicClient.Models.Content.html","topicUid":"AnthropicClient.Models.Content","type":"Class"},{"name":"ContentBlockLocationCitation","href":"AnthropicClient.Models.ContentBlockLocationCitation.html","topicHref":"AnthropicClient.Models.ContentBlockLocationCitation.html","topicUid":"AnthropicClient.Models.ContentBlockLocationCitation","type":"Class"},{"name":"ContentDelta","href":"AnthropicClient.Models.ContentDelta.html","topicHref":"AnthropicClient.Models.ContentDelta.html","topicUid":"AnthropicClient.Models.ContentDelta","type":"Class"},{"name":"ContentDeltaEventData","href":"AnthropicClient.Models.ContentDeltaEventData.html","topicHref":"AnthropicClient.Models.ContentDeltaEventData.html","topicUid":"AnthropicClient.Models.ContentDeltaEventData","type":"Class"},{"name":"ContentDeltaType","href":"AnthropicClient.Models.ContentDeltaType.html","topicHref":"AnthropicClient.Models.ContentDeltaType.html","topicUid":"AnthropicClient.Models.ContentDeltaType","type":"Class"},{"name":"ContentStartEventData","href":"AnthropicClient.Models.ContentStartEventData.html","topicHref":"AnthropicClient.Models.ContentStartEventData.html","topicUid":"AnthropicClient.Models.ContentStartEventData","type":"Class"},{"name":"ContentStopEventData","href":"AnthropicClient.Models.ContentStopEventData.html","topicHref":"AnthropicClient.Models.ContentStopEventData.html","topicUid":"AnthropicClient.Models.ContentStopEventData","type":"Class"},{"name":"ContentType","href":"AnthropicClient.Models.ContentType.html","topicHref":"AnthropicClient.Models.ContentType.html","topicUid":"AnthropicClient.Models.ContentType","type":"Class"},{"name":"CountMessageTokensRequest","href":"AnthropicClient.Models.CountMessageTokensRequest.html","topicHref":"AnthropicClient.Models.CountMessageTokensRequest.html","topicUid":"AnthropicClient.Models.CountMessageTokensRequest","type":"Class"},{"name":"CustomSource","href":"AnthropicClient.Models.CustomSource.html","topicHref":"AnthropicClient.Models.CustomSource.html","topicUid":"AnthropicClient.Models.CustomSource","type":"Class"},{"name":"DocumentContent","href":"AnthropicClient.Models.DocumentContent.html","topicHref":"AnthropicClient.Models.DocumentContent.html","topicUid":"AnthropicClient.Models.DocumentContent","type":"Class"},{"name":"DocumentSource","href":"AnthropicClient.Models.DocumentSource.html","topicHref":"AnthropicClient.Models.DocumentSource.html","topicUid":"AnthropicClient.Models.DocumentSource","type":"Class"},{"name":"EphemeralCacheControl","href":"AnthropicClient.Models.EphemeralCacheControl.html","topicHref":"AnthropicClient.Models.EphemeralCacheControl.html","topicUid":"AnthropicClient.Models.EphemeralCacheControl","type":"Class"},{"name":"Error","href":"AnthropicClient.Models.Error.html","topicHref":"AnthropicClient.Models.Error.html","topicUid":"AnthropicClient.Models.Error","type":"Class"},{"name":"ErrorEventData","href":"AnthropicClient.Models.ErrorEventData.html","topicHref":"AnthropicClient.Models.ErrorEventData.html","topicUid":"AnthropicClient.Models.ErrorEventData","type":"Class"},{"name":"ErrorType","href":"AnthropicClient.Models.ErrorType.html","topicHref":"AnthropicClient.Models.ErrorType.html","topicUid":"AnthropicClient.Models.ErrorType","type":"Class"},{"name":"ErroredMessageBatchResult","href":"AnthropicClient.Models.ErroredMessageBatchResult.html","topicHref":"AnthropicClient.Models.ErroredMessageBatchResult.html","topicUid":"AnthropicClient.Models.ErroredMessageBatchResult","type":"Class"},{"name":"EventData","href":"AnthropicClient.Models.EventData.html","topicHref":"AnthropicClient.Models.EventData.html","topicUid":"AnthropicClient.Models.EventData","type":"Class"},{"name":"EventType","href":"AnthropicClient.Models.EventType.html","topicHref":"AnthropicClient.Models.EventType.html","topicUid":"AnthropicClient.Models.EventType","type":"Class"},{"name":"ExpiredMessageBatchResult","href":"AnthropicClient.Models.ExpiredMessageBatchResult.html","topicHref":"AnthropicClient.Models.ExpiredMessageBatchResult.html","topicUid":"AnthropicClient.Models.ExpiredMessageBatchResult","type":"Class"},{"name":"FunctionParameterAttribute","href":"AnthropicClient.Models.FunctionParameterAttribute.html","topicHref":"AnthropicClient.Models.FunctionParameterAttribute.html","topicUid":"AnthropicClient.Models.FunctionParameterAttribute","type":"Class"},{"name":"FunctionPropertyAttribute","href":"AnthropicClient.Models.FunctionPropertyAttribute.html","topicHref":"AnthropicClient.Models.FunctionPropertyAttribute.html","topicUid":"AnthropicClient.Models.FunctionPropertyAttribute","type":"Class"},{"name":"ITool","href":"AnthropicClient.Models.ITool.html","topicHref":"AnthropicClient.Models.ITool.html","topicUid":"AnthropicClient.Models.ITool","type":"Interface"},{"name":"ImageContent","href":"AnthropicClient.Models.ImageContent.html","topicHref":"AnthropicClient.Models.ImageContent.html","topicUid":"AnthropicClient.Models.ImageContent","type":"Class"},{"name":"ImageSource","href":"AnthropicClient.Models.ImageSource.html","topicHref":"AnthropicClient.Models.ImageSource.html","topicUid":"AnthropicClient.Models.ImageSource","type":"Class"},{"name":"ImageType","href":"AnthropicClient.Models.ImageType.html","topicHref":"AnthropicClient.Models.ImageType.html","topicUid":"AnthropicClient.Models.ImageType","type":"Class"},{"name":"InputProperty","href":"AnthropicClient.Models.InputProperty.html","topicHref":"AnthropicClient.Models.InputProperty.html","topicUid":"AnthropicClient.Models.InputProperty","type":"Class"},{"name":"InputSchema","href":"AnthropicClient.Models.InputSchema.html","topicHref":"AnthropicClient.Models.InputSchema.html","topicUid":"AnthropicClient.Models.InputSchema","type":"Class"},{"name":"InvalidRequestError","href":"AnthropicClient.Models.InvalidRequestError.html","topicHref":"AnthropicClient.Models.InvalidRequestError.html","topicUid":"AnthropicClient.Models.InvalidRequestError","type":"Class"},{"name":"JsonDelta","href":"AnthropicClient.Models.JsonDelta.html","topicHref":"AnthropicClient.Models.JsonDelta.html","topicUid":"AnthropicClient.Models.JsonDelta","type":"Class"},{"name":"Message","href":"AnthropicClient.Models.Message.html","topicHref":"AnthropicClient.Models.Message.html","topicUid":"AnthropicClient.Models.Message","type":"Class"},{"name":"MessageBatchDeleteResponse","href":"AnthropicClient.Models.MessageBatchDeleteResponse.html","topicHref":"AnthropicClient.Models.MessageBatchDeleteResponse.html","topicUid":"AnthropicClient.Models.MessageBatchDeleteResponse","type":"Class"},{"name":"MessageBatchRequest","href":"AnthropicClient.Models.MessageBatchRequest.html","topicHref":"AnthropicClient.Models.MessageBatchRequest.html","topicUid":"AnthropicClient.Models.MessageBatchRequest","type":"Class"},{"name":"MessageBatchRequestCounts","href":"AnthropicClient.Models.MessageBatchRequestCounts.html","topicHref":"AnthropicClient.Models.MessageBatchRequestCounts.html","topicUid":"AnthropicClient.Models.MessageBatchRequestCounts","type":"Class"},{"name":"MessageBatchRequestItem","href":"AnthropicClient.Models.MessageBatchRequestItem.html","topicHref":"AnthropicClient.Models.MessageBatchRequestItem.html","topicUid":"AnthropicClient.Models.MessageBatchRequestItem","type":"Class"},{"name":"MessageBatchResponse","href":"AnthropicClient.Models.MessageBatchResponse.html","topicHref":"AnthropicClient.Models.MessageBatchResponse.html","topicUid":"AnthropicClient.Models.MessageBatchResponse","type":"Class"},{"name":"MessageBatchResult","href":"AnthropicClient.Models.MessageBatchResult.html","topicHref":"AnthropicClient.Models.MessageBatchResult.html","topicUid":"AnthropicClient.Models.MessageBatchResult","type":"Class"},{"name":"MessageBatchResultItem","href":"AnthropicClient.Models.MessageBatchResultItem.html","topicHref":"AnthropicClient.Models.MessageBatchResultItem.html","topicUid":"AnthropicClient.Models.MessageBatchResultItem","type":"Class"},{"name":"MessageBatchResultType","href":"AnthropicClient.Models.MessageBatchResultType.html","topicHref":"AnthropicClient.Models.MessageBatchResultType.html","topicUid":"AnthropicClient.Models.MessageBatchResultType","type":"Class"},{"name":"MessageBatchStatus","href":"AnthropicClient.Models.MessageBatchStatus.html","topicHref":"AnthropicClient.Models.MessageBatchStatus.html","topicUid":"AnthropicClient.Models.MessageBatchStatus","type":"Class"},{"name":"MessageCompleteEventData","href":"AnthropicClient.Models.MessageCompleteEventData.html","topicHref":"AnthropicClient.Models.MessageCompleteEventData.html","topicUid":"AnthropicClient.Models.MessageCompleteEventData","type":"Class"},{"name":"MessageDelta","href":"AnthropicClient.Models.MessageDelta.html","topicHref":"AnthropicClient.Models.MessageDelta.html","topicUid":"AnthropicClient.Models.MessageDelta","type":"Class"},{"name":"MessageDeltaEventData","href":"AnthropicClient.Models.MessageDeltaEventData.html","topicHref":"AnthropicClient.Models.MessageDeltaEventData.html","topicUid":"AnthropicClient.Models.MessageDeltaEventData","type":"Class"},{"name":"MessageRequest","href":"AnthropicClient.Models.MessageRequest.html","topicHref":"AnthropicClient.Models.MessageRequest.html","topicUid":"AnthropicClient.Models.MessageRequest","type":"Class"},{"name":"MessageResponse","href":"AnthropicClient.Models.MessageResponse.html","topicHref":"AnthropicClient.Models.MessageResponse.html","topicUid":"AnthropicClient.Models.MessageResponse","type":"Class"},{"name":"MessageRole","href":"AnthropicClient.Models.MessageRole.html","topicHref":"AnthropicClient.Models.MessageRole.html","topicUid":"AnthropicClient.Models.MessageRole","type":"Class"},{"name":"MessageStartEventData","href":"AnthropicClient.Models.MessageStartEventData.html","topicHref":"AnthropicClient.Models.MessageStartEventData.html","topicUid":"AnthropicClient.Models.MessageStartEventData","type":"Class"},{"name":"MessageStopEventData","href":"AnthropicClient.Models.MessageStopEventData.html","topicHref":"AnthropicClient.Models.MessageStopEventData.html","topicUid":"AnthropicClient.Models.MessageStopEventData","type":"Class"},{"name":"NotFoundError","href":"AnthropicClient.Models.NotFoundError.html","topicHref":"AnthropicClient.Models.NotFoundError.html","topicUid":"AnthropicClient.Models.NotFoundError","type":"Class"},{"name":"OverloadedError","href":"AnthropicClient.Models.OverloadedError.html","topicHref":"AnthropicClient.Models.OverloadedError.html","topicUid":"AnthropicClient.Models.OverloadedError","type":"Class"},{"name":"Page","href":"AnthropicClient.Models.Page.html","topicHref":"AnthropicClient.Models.Page.html","topicUid":"AnthropicClient.Models.Page","type":"Class"},{"name":"PageLocationCitation","href":"AnthropicClient.Models.PageLocationCitation.html","topicHref":"AnthropicClient.Models.PageLocationCitation.html","topicUid":"AnthropicClient.Models.PageLocationCitation","type":"Class"},{"name":"Page","href":"AnthropicClient.Models.Page-1.html","topicHref":"AnthropicClient.Models.Page-1.html","topicUid":"AnthropicClient.Models.Page`1","type":"Class"},{"name":"PagingRequest","href":"AnthropicClient.Models.PagingRequest.html","topicHref":"AnthropicClient.Models.PagingRequest.html","topicUid":"AnthropicClient.Models.PagingRequest","type":"Class"},{"name":"PermissionError","href":"AnthropicClient.Models.PermissionError.html","topicHref":"AnthropicClient.Models.PermissionError.html","topicUid":"AnthropicClient.Models.PermissionError","type":"Class"},{"name":"PingEventData","href":"AnthropicClient.Models.PingEventData.html","topicHref":"AnthropicClient.Models.PingEventData.html","topicUid":"AnthropicClient.Models.PingEventData","type":"Class"},{"name":"RateLimitError","href":"AnthropicClient.Models.RateLimitError.html","topicHref":"AnthropicClient.Models.RateLimitError.html","topicUid":"AnthropicClient.Models.RateLimitError","type":"Class"},{"name":"Source","href":"AnthropicClient.Models.Source.html","topicHref":"AnthropicClient.Models.Source.html","topicUid":"AnthropicClient.Models.Source","type":"Class"},{"name":"SourceType","href":"AnthropicClient.Models.SourceType.html","topicHref":"AnthropicClient.Models.SourceType.html","topicUid":"AnthropicClient.Models.SourceType","type":"Class"},{"name":"SpecificToolChoice","href":"AnthropicClient.Models.SpecificToolChoice.html","topicHref":"AnthropicClient.Models.SpecificToolChoice.html","topicUid":"AnthropicClient.Models.SpecificToolChoice","type":"Class"},{"name":"StopReasonType","href":"AnthropicClient.Models.StopReasonType.html","topicHref":"AnthropicClient.Models.StopReasonType.html","topicUid":"AnthropicClient.Models.StopReasonType","type":"Class"},{"name":"StreamMessageRequest","href":"AnthropicClient.Models.StreamMessageRequest.html","topicHref":"AnthropicClient.Models.StreamMessageRequest.html","topicUid":"AnthropicClient.Models.StreamMessageRequest","type":"Class"},{"name":"SucceededMessageBatchResult","href":"AnthropicClient.Models.SucceededMessageBatchResult.html","topicHref":"AnthropicClient.Models.SucceededMessageBatchResult.html","topicUid":"AnthropicClient.Models.SucceededMessageBatchResult","type":"Class"},{"name":"TextContent","href":"AnthropicClient.Models.TextContent.html","topicHref":"AnthropicClient.Models.TextContent.html","topicUid":"AnthropicClient.Models.TextContent","type":"Class"},{"name":"TextDelta","href":"AnthropicClient.Models.TextDelta.html","topicHref":"AnthropicClient.Models.TextDelta.html","topicUid":"AnthropicClient.Models.TextDelta","type":"Class"},{"name":"TextSource","href":"AnthropicClient.Models.TextSource.html","topicHref":"AnthropicClient.Models.TextSource.html","topicUid":"AnthropicClient.Models.TextSource","type":"Class"},{"name":"TokenCountResponse","href":"AnthropicClient.Models.TokenCountResponse.html","topicHref":"AnthropicClient.Models.TokenCountResponse.html","topicUid":"AnthropicClient.Models.TokenCountResponse","type":"Class"},{"name":"Tool","href":"AnthropicClient.Models.Tool.html","topicHref":"AnthropicClient.Models.Tool.html","topicUid":"AnthropicClient.Models.Tool","type":"Class"},{"name":"ToolCall","href":"AnthropicClient.Models.ToolCall.html","topicHref":"AnthropicClient.Models.ToolCall.html","topicUid":"AnthropicClient.Models.ToolCall","type":"Class"},{"name":"ToolCallResult","href":"AnthropicClient.Models.ToolCallResult-1.html","topicHref":"AnthropicClient.Models.ToolCallResult-1.html","topicUid":"AnthropicClient.Models.ToolCallResult`1","type":"Class"},{"name":"ToolChoice","href":"AnthropicClient.Models.ToolChoice.html","topicHref":"AnthropicClient.Models.ToolChoice.html","topicUid":"AnthropicClient.Models.ToolChoice","type":"Class"},{"name":"ToolChoiceType","href":"AnthropicClient.Models.ToolChoiceType.html","topicHref":"AnthropicClient.Models.ToolChoiceType.html","topicUid":"AnthropicClient.Models.ToolChoiceType","type":"Class"},{"name":"ToolResultContent","href":"AnthropicClient.Models.ToolResultContent.html","topicHref":"AnthropicClient.Models.ToolResultContent.html","topicUid":"AnthropicClient.Models.ToolResultContent","type":"Class"},{"name":"ToolUseContent","href":"AnthropicClient.Models.ToolUseContent.html","topicHref":"AnthropicClient.Models.ToolUseContent.html","topicUid":"AnthropicClient.Models.ToolUseContent","type":"Class"},{"name":"Usage","href":"AnthropicClient.Models.Usage.html","topicHref":"AnthropicClient.Models.Usage.html","topicUid":"AnthropicClient.Models.Usage","type":"Class"}]}],"memberLayout":"SamePage"} +{"items":[{"name":"AnthropicClient","href":"AnthropicClient.html","topicHref":"AnthropicClient.html","topicUid":"AnthropicClient","type":"Namespace","items":[{"name":"AnthropicApiClient","href":"AnthropicClient.AnthropicApiClient.html","topicHref":"AnthropicClient.AnthropicApiClient.html","topicUid":"AnthropicClient.AnthropicApiClient","type":"Class"},{"name":"IAnthropicApiClient","href":"AnthropicClient.IAnthropicApiClient.html","topicHref":"AnthropicClient.IAnthropicApiClient.html","topicUid":"AnthropicClient.IAnthropicApiClient","type":"Interface"}]},{"name":"AnthropicClient.Models","href":"AnthropicClient.Models.html","topicHref":"AnthropicClient.Models.html","topicUid":"AnthropicClient.Models","type":"Namespace","items":[{"name":"AnthropicError","href":"AnthropicClient.Models.AnthropicError.html","topicHref":"AnthropicClient.Models.AnthropicError.html","topicUid":"AnthropicClient.Models.AnthropicError","type":"Class"},{"name":"AnthropicEvent","href":"AnthropicClient.Models.AnthropicEvent.html","topicHref":"AnthropicClient.Models.AnthropicEvent.html","topicUid":"AnthropicClient.Models.AnthropicEvent","type":"Class"},{"name":"AnthropicFile","href":"AnthropicClient.Models.AnthropicFile.html","topicHref":"AnthropicClient.Models.AnthropicFile.html","topicUid":"AnthropicClient.Models.AnthropicFile","type":"Class"},{"name":"AnthropicFileDeleteResponse","href":"AnthropicClient.Models.AnthropicFileDeleteResponse.html","topicHref":"AnthropicClient.Models.AnthropicFileDeleteResponse.html","topicUid":"AnthropicClient.Models.AnthropicFileDeleteResponse","type":"Class"},{"name":"AnthropicFunction","href":"AnthropicClient.Models.AnthropicFunction.html","topicHref":"AnthropicClient.Models.AnthropicFunction.html","topicUid":"AnthropicClient.Models.AnthropicFunction","type":"Class"},{"name":"AnthropicHeaders","href":"AnthropicClient.Models.AnthropicHeaders.html","topicHref":"AnthropicClient.Models.AnthropicHeaders.html","topicUid":"AnthropicClient.Models.AnthropicHeaders","type":"Class"},{"name":"AnthropicModel","href":"AnthropicClient.Models.AnthropicModel.html","topicHref":"AnthropicClient.Models.AnthropicModel.html","topicUid":"AnthropicClient.Models.AnthropicModel","type":"Class"},{"name":"AnthropicModels","href":"AnthropicClient.Models.AnthropicModels.html","topicHref":"AnthropicClient.Models.AnthropicModels.html","topicUid":"AnthropicClient.Models.AnthropicModels","type":"Class"},{"name":"AnyToolChoice","href":"AnthropicClient.Models.AnyToolChoice.html","topicHref":"AnthropicClient.Models.AnyToolChoice.html","topicUid":"AnthropicClient.Models.AnyToolChoice","type":"Class"},{"name":"ApiError","href":"AnthropicClient.Models.ApiError.html","topicHref":"AnthropicClient.Models.ApiError.html","topicUid":"AnthropicClient.Models.ApiError","type":"Class"},{"name":"AuthenticationError","href":"AnthropicClient.Models.AuthenticationError.html","topicHref":"AnthropicClient.Models.AuthenticationError.html","topicUid":"AnthropicClient.Models.AuthenticationError","type":"Class"},{"name":"AutoToolChoice","href":"AnthropicClient.Models.AutoToolChoice.html","topicHref":"AnthropicClient.Models.AutoToolChoice.html","topicUid":"AnthropicClient.Models.AutoToolChoice","type":"Class"},{"name":"Base64Source","href":"AnthropicClient.Models.Base64Source.html","topicHref":"AnthropicClient.Models.Base64Source.html","topicUid":"AnthropicClient.Models.Base64Source","type":"Class"},{"name":"BaseMessageRequest","href":"AnthropicClient.Models.BaseMessageRequest.html","topicHref":"AnthropicClient.Models.BaseMessageRequest.html","topicUid":"AnthropicClient.Models.BaseMessageRequest","type":"Class"},{"name":"CacheControl","href":"AnthropicClient.Models.CacheControl.html","topicHref":"AnthropicClient.Models.CacheControl.html","topicUid":"AnthropicClient.Models.CacheControl","type":"Class"},{"name":"CacheControlType","href":"AnthropicClient.Models.CacheControlType.html","topicHref":"AnthropicClient.Models.CacheControlType.html","topicUid":"AnthropicClient.Models.CacheControlType","type":"Class"},{"name":"CanceledMessageBatchResult","href":"AnthropicClient.Models.CanceledMessageBatchResult.html","topicHref":"AnthropicClient.Models.CanceledMessageBatchResult.html","topicUid":"AnthropicClient.Models.CanceledMessageBatchResult","type":"Class"},{"name":"CharacterLocationCitation","href":"AnthropicClient.Models.CharacterLocationCitation.html","topicHref":"AnthropicClient.Models.CharacterLocationCitation.html","topicUid":"AnthropicClient.Models.CharacterLocationCitation","type":"Class"},{"name":"Citation","href":"AnthropicClient.Models.Citation.html","topicHref":"AnthropicClient.Models.Citation.html","topicUid":"AnthropicClient.Models.Citation","type":"Class"},{"name":"CitationDelta","href":"AnthropicClient.Models.CitationDelta.html","topicHref":"AnthropicClient.Models.CitationDelta.html","topicUid":"AnthropicClient.Models.CitationDelta","type":"Class"},{"name":"CitationOption","href":"AnthropicClient.Models.CitationOption.html","topicHref":"AnthropicClient.Models.CitationOption.html","topicUid":"AnthropicClient.Models.CitationOption","type":"Class"},{"name":"CitationType","href":"AnthropicClient.Models.CitationType.html","topicHref":"AnthropicClient.Models.CitationType.html","topicUid":"AnthropicClient.Models.CitationType","type":"Class"},{"name":"Content","href":"AnthropicClient.Models.Content.html","topicHref":"AnthropicClient.Models.Content.html","topicUid":"AnthropicClient.Models.Content","type":"Class"},{"name":"ContentBlockLocationCitation","href":"AnthropicClient.Models.ContentBlockLocationCitation.html","topicHref":"AnthropicClient.Models.ContentBlockLocationCitation.html","topicUid":"AnthropicClient.Models.ContentBlockLocationCitation","type":"Class"},{"name":"ContentDelta","href":"AnthropicClient.Models.ContentDelta.html","topicHref":"AnthropicClient.Models.ContentDelta.html","topicUid":"AnthropicClient.Models.ContentDelta","type":"Class"},{"name":"ContentDeltaEventData","href":"AnthropicClient.Models.ContentDeltaEventData.html","topicHref":"AnthropicClient.Models.ContentDeltaEventData.html","topicUid":"AnthropicClient.Models.ContentDeltaEventData","type":"Class"},{"name":"ContentDeltaType","href":"AnthropicClient.Models.ContentDeltaType.html","topicHref":"AnthropicClient.Models.ContentDeltaType.html","topicUid":"AnthropicClient.Models.ContentDeltaType","type":"Class"},{"name":"ContentStartEventData","href":"AnthropicClient.Models.ContentStartEventData.html","topicHref":"AnthropicClient.Models.ContentStartEventData.html","topicUid":"AnthropicClient.Models.ContentStartEventData","type":"Class"},{"name":"ContentStopEventData","href":"AnthropicClient.Models.ContentStopEventData.html","topicHref":"AnthropicClient.Models.ContentStopEventData.html","topicUid":"AnthropicClient.Models.ContentStopEventData","type":"Class"},{"name":"ContentType","href":"AnthropicClient.Models.ContentType.html","topicHref":"AnthropicClient.Models.ContentType.html","topicUid":"AnthropicClient.Models.ContentType","type":"Class"},{"name":"CountMessageTokensRequest","href":"AnthropicClient.Models.CountMessageTokensRequest.html","topicHref":"AnthropicClient.Models.CountMessageTokensRequest.html","topicUid":"AnthropicClient.Models.CountMessageTokensRequest","type":"Class"},{"name":"CreateFileRequest","href":"AnthropicClient.Models.CreateFileRequest.html","topicHref":"AnthropicClient.Models.CreateFileRequest.html","topicUid":"AnthropicClient.Models.CreateFileRequest","type":"Class"},{"name":"CustomSource","href":"AnthropicClient.Models.CustomSource.html","topicHref":"AnthropicClient.Models.CustomSource.html","topicUid":"AnthropicClient.Models.CustomSource","type":"Class"},{"name":"DocumentContent","href":"AnthropicClient.Models.DocumentContent.html","topicHref":"AnthropicClient.Models.DocumentContent.html","topicUid":"AnthropicClient.Models.DocumentContent","type":"Class"},{"name":"DocumentSource","href":"AnthropicClient.Models.DocumentSource.html","topicHref":"AnthropicClient.Models.DocumentSource.html","topicUid":"AnthropicClient.Models.DocumentSource","type":"Class"},{"name":"EphemeralCacheControl","href":"AnthropicClient.Models.EphemeralCacheControl.html","topicHref":"AnthropicClient.Models.EphemeralCacheControl.html","topicUid":"AnthropicClient.Models.EphemeralCacheControl","type":"Class"},{"name":"Error","href":"AnthropicClient.Models.Error.html","topicHref":"AnthropicClient.Models.Error.html","topicUid":"AnthropicClient.Models.Error","type":"Class"},{"name":"ErrorEventData","href":"AnthropicClient.Models.ErrorEventData.html","topicHref":"AnthropicClient.Models.ErrorEventData.html","topicUid":"AnthropicClient.Models.ErrorEventData","type":"Class"},{"name":"ErrorType","href":"AnthropicClient.Models.ErrorType.html","topicHref":"AnthropicClient.Models.ErrorType.html","topicUid":"AnthropicClient.Models.ErrorType","type":"Class"},{"name":"ErroredMessageBatchResult","href":"AnthropicClient.Models.ErroredMessageBatchResult.html","topicHref":"AnthropicClient.Models.ErroredMessageBatchResult.html","topicUid":"AnthropicClient.Models.ErroredMessageBatchResult","type":"Class"},{"name":"EventData","href":"AnthropicClient.Models.EventData.html","topicHref":"AnthropicClient.Models.EventData.html","topicUid":"AnthropicClient.Models.EventData","type":"Class"},{"name":"EventType","href":"AnthropicClient.Models.EventType.html","topicHref":"AnthropicClient.Models.EventType.html","topicUid":"AnthropicClient.Models.EventType","type":"Class"},{"name":"ExpiredMessageBatchResult","href":"AnthropicClient.Models.ExpiredMessageBatchResult.html","topicHref":"AnthropicClient.Models.ExpiredMessageBatchResult.html","topicUid":"AnthropicClient.Models.ExpiredMessageBatchResult","type":"Class"},{"name":"FileSource","href":"AnthropicClient.Models.FileSource.html","topicHref":"AnthropicClient.Models.FileSource.html","topicUid":"AnthropicClient.Models.FileSource","type":"Class"},{"name":"FunctionParameterAttribute","href":"AnthropicClient.Models.FunctionParameterAttribute.html","topicHref":"AnthropicClient.Models.FunctionParameterAttribute.html","topicUid":"AnthropicClient.Models.FunctionParameterAttribute","type":"Class"},{"name":"FunctionPropertyAttribute","href":"AnthropicClient.Models.FunctionPropertyAttribute.html","topicHref":"AnthropicClient.Models.FunctionPropertyAttribute.html","topicUid":"AnthropicClient.Models.FunctionPropertyAttribute","type":"Class"},{"name":"ITool","href":"AnthropicClient.Models.ITool.html","topicHref":"AnthropicClient.Models.ITool.html","topicUid":"AnthropicClient.Models.ITool","type":"Interface"},{"name":"ImageContent","href":"AnthropicClient.Models.ImageContent.html","topicHref":"AnthropicClient.Models.ImageContent.html","topicUid":"AnthropicClient.Models.ImageContent","type":"Class"},{"name":"ImageSource","href":"AnthropicClient.Models.ImageSource.html","topicHref":"AnthropicClient.Models.ImageSource.html","topicUid":"AnthropicClient.Models.ImageSource","type":"Class"},{"name":"ImageType","href":"AnthropicClient.Models.ImageType.html","topicHref":"AnthropicClient.Models.ImageType.html","topicUid":"AnthropicClient.Models.ImageType","type":"Class"},{"name":"InputProperty","href":"AnthropicClient.Models.InputProperty.html","topicHref":"AnthropicClient.Models.InputProperty.html","topicUid":"AnthropicClient.Models.InputProperty","type":"Class"},{"name":"InputSchema","href":"AnthropicClient.Models.InputSchema.html","topicHref":"AnthropicClient.Models.InputSchema.html","topicUid":"AnthropicClient.Models.InputSchema","type":"Class"},{"name":"InvalidRequestError","href":"AnthropicClient.Models.InvalidRequestError.html","topicHref":"AnthropicClient.Models.InvalidRequestError.html","topicUid":"AnthropicClient.Models.InvalidRequestError","type":"Class"},{"name":"JsonDelta","href":"AnthropicClient.Models.JsonDelta.html","topicHref":"AnthropicClient.Models.JsonDelta.html","topicUid":"AnthropicClient.Models.JsonDelta","type":"Class"},{"name":"Message","href":"AnthropicClient.Models.Message.html","topicHref":"AnthropicClient.Models.Message.html","topicUid":"AnthropicClient.Models.Message","type":"Class"},{"name":"MessageBatchDeleteResponse","href":"AnthropicClient.Models.MessageBatchDeleteResponse.html","topicHref":"AnthropicClient.Models.MessageBatchDeleteResponse.html","topicUid":"AnthropicClient.Models.MessageBatchDeleteResponse","type":"Class"},{"name":"MessageBatchRequest","href":"AnthropicClient.Models.MessageBatchRequest.html","topicHref":"AnthropicClient.Models.MessageBatchRequest.html","topicUid":"AnthropicClient.Models.MessageBatchRequest","type":"Class"},{"name":"MessageBatchRequestCounts","href":"AnthropicClient.Models.MessageBatchRequestCounts.html","topicHref":"AnthropicClient.Models.MessageBatchRequestCounts.html","topicUid":"AnthropicClient.Models.MessageBatchRequestCounts","type":"Class"},{"name":"MessageBatchRequestItem","href":"AnthropicClient.Models.MessageBatchRequestItem.html","topicHref":"AnthropicClient.Models.MessageBatchRequestItem.html","topicUid":"AnthropicClient.Models.MessageBatchRequestItem","type":"Class"},{"name":"MessageBatchResponse","href":"AnthropicClient.Models.MessageBatchResponse.html","topicHref":"AnthropicClient.Models.MessageBatchResponse.html","topicUid":"AnthropicClient.Models.MessageBatchResponse","type":"Class"},{"name":"MessageBatchResult","href":"AnthropicClient.Models.MessageBatchResult.html","topicHref":"AnthropicClient.Models.MessageBatchResult.html","topicUid":"AnthropicClient.Models.MessageBatchResult","type":"Class"},{"name":"MessageBatchResultItem","href":"AnthropicClient.Models.MessageBatchResultItem.html","topicHref":"AnthropicClient.Models.MessageBatchResultItem.html","topicUid":"AnthropicClient.Models.MessageBatchResultItem","type":"Class"},{"name":"MessageBatchResultType","href":"AnthropicClient.Models.MessageBatchResultType.html","topicHref":"AnthropicClient.Models.MessageBatchResultType.html","topicUid":"AnthropicClient.Models.MessageBatchResultType","type":"Class"},{"name":"MessageBatchStatus","href":"AnthropicClient.Models.MessageBatchStatus.html","topicHref":"AnthropicClient.Models.MessageBatchStatus.html","topicUid":"AnthropicClient.Models.MessageBatchStatus","type":"Class"},{"name":"MessageCompleteEventData","href":"AnthropicClient.Models.MessageCompleteEventData.html","topicHref":"AnthropicClient.Models.MessageCompleteEventData.html","topicUid":"AnthropicClient.Models.MessageCompleteEventData","type":"Class"},{"name":"MessageDelta","href":"AnthropicClient.Models.MessageDelta.html","topicHref":"AnthropicClient.Models.MessageDelta.html","topicUid":"AnthropicClient.Models.MessageDelta","type":"Class"},{"name":"MessageDeltaEventData","href":"AnthropicClient.Models.MessageDeltaEventData.html","topicHref":"AnthropicClient.Models.MessageDeltaEventData.html","topicUid":"AnthropicClient.Models.MessageDeltaEventData","type":"Class"},{"name":"MessageRequest","href":"AnthropicClient.Models.MessageRequest.html","topicHref":"AnthropicClient.Models.MessageRequest.html","topicUid":"AnthropicClient.Models.MessageRequest","type":"Class"},{"name":"MessageResponse","href":"AnthropicClient.Models.MessageResponse.html","topicHref":"AnthropicClient.Models.MessageResponse.html","topicUid":"AnthropicClient.Models.MessageResponse","type":"Class"},{"name":"MessageRole","href":"AnthropicClient.Models.MessageRole.html","topicHref":"AnthropicClient.Models.MessageRole.html","topicUid":"AnthropicClient.Models.MessageRole","type":"Class"},{"name":"MessageStartEventData","href":"AnthropicClient.Models.MessageStartEventData.html","topicHref":"AnthropicClient.Models.MessageStartEventData.html","topicUid":"AnthropicClient.Models.MessageStartEventData","type":"Class"},{"name":"MessageStopEventData","href":"AnthropicClient.Models.MessageStopEventData.html","topicHref":"AnthropicClient.Models.MessageStopEventData.html","topicUid":"AnthropicClient.Models.MessageStopEventData","type":"Class"},{"name":"NotFoundError","href":"AnthropicClient.Models.NotFoundError.html","topicHref":"AnthropicClient.Models.NotFoundError.html","topicUid":"AnthropicClient.Models.NotFoundError","type":"Class"},{"name":"OverloadedError","href":"AnthropicClient.Models.OverloadedError.html","topicHref":"AnthropicClient.Models.OverloadedError.html","topicUid":"AnthropicClient.Models.OverloadedError","type":"Class"},{"name":"Page","href":"AnthropicClient.Models.Page.html","topicHref":"AnthropicClient.Models.Page.html","topicUid":"AnthropicClient.Models.Page","type":"Class"},{"name":"PageLocationCitation","href":"AnthropicClient.Models.PageLocationCitation.html","topicHref":"AnthropicClient.Models.PageLocationCitation.html","topicUid":"AnthropicClient.Models.PageLocationCitation","type":"Class"},{"name":"Page","href":"AnthropicClient.Models.Page-1.html","topicHref":"AnthropicClient.Models.Page-1.html","topicUid":"AnthropicClient.Models.Page`1","type":"Class"},{"name":"PagingRequest","href":"AnthropicClient.Models.PagingRequest.html","topicHref":"AnthropicClient.Models.PagingRequest.html","topicUid":"AnthropicClient.Models.PagingRequest","type":"Class"},{"name":"PermissionError","href":"AnthropicClient.Models.PermissionError.html","topicHref":"AnthropicClient.Models.PermissionError.html","topicUid":"AnthropicClient.Models.PermissionError","type":"Class"},{"name":"PingEventData","href":"AnthropicClient.Models.PingEventData.html","topicHref":"AnthropicClient.Models.PingEventData.html","topicUid":"AnthropicClient.Models.PingEventData","type":"Class"},{"name":"RateLimitError","href":"AnthropicClient.Models.RateLimitError.html","topicHref":"AnthropicClient.Models.RateLimitError.html","topicUid":"AnthropicClient.Models.RateLimitError","type":"Class"},{"name":"Source","href":"AnthropicClient.Models.Source.html","topicHref":"AnthropicClient.Models.Source.html","topicUid":"AnthropicClient.Models.Source","type":"Class"},{"name":"SourceType","href":"AnthropicClient.Models.SourceType.html","topicHref":"AnthropicClient.Models.SourceType.html","topicUid":"AnthropicClient.Models.SourceType","type":"Class"},{"name":"SpecificToolChoice","href":"AnthropicClient.Models.SpecificToolChoice.html","topicHref":"AnthropicClient.Models.SpecificToolChoice.html","topicUid":"AnthropicClient.Models.SpecificToolChoice","type":"Class"},{"name":"StopReasonType","href":"AnthropicClient.Models.StopReasonType.html","topicHref":"AnthropicClient.Models.StopReasonType.html","topicUid":"AnthropicClient.Models.StopReasonType","type":"Class"},{"name":"StreamMessageRequest","href":"AnthropicClient.Models.StreamMessageRequest.html","topicHref":"AnthropicClient.Models.StreamMessageRequest.html","topicUid":"AnthropicClient.Models.StreamMessageRequest","type":"Class"},{"name":"SucceededMessageBatchResult","href":"AnthropicClient.Models.SucceededMessageBatchResult.html","topicHref":"AnthropicClient.Models.SucceededMessageBatchResult.html","topicUid":"AnthropicClient.Models.SucceededMessageBatchResult","type":"Class"},{"name":"TextContent","href":"AnthropicClient.Models.TextContent.html","topicHref":"AnthropicClient.Models.TextContent.html","topicUid":"AnthropicClient.Models.TextContent","type":"Class"},{"name":"TextDelta","href":"AnthropicClient.Models.TextDelta.html","topicHref":"AnthropicClient.Models.TextDelta.html","topicUid":"AnthropicClient.Models.TextDelta","type":"Class"},{"name":"TextSource","href":"AnthropicClient.Models.TextSource.html","topicHref":"AnthropicClient.Models.TextSource.html","topicUid":"AnthropicClient.Models.TextSource","type":"Class"},{"name":"TokenCountResponse","href":"AnthropicClient.Models.TokenCountResponse.html","topicHref":"AnthropicClient.Models.TokenCountResponse.html","topicUid":"AnthropicClient.Models.TokenCountResponse","type":"Class"},{"name":"Tool","href":"AnthropicClient.Models.Tool.html","topicHref":"AnthropicClient.Models.Tool.html","topicUid":"AnthropicClient.Models.Tool","type":"Class"},{"name":"ToolCall","href":"AnthropicClient.Models.ToolCall.html","topicHref":"AnthropicClient.Models.ToolCall.html","topicUid":"AnthropicClient.Models.ToolCall","type":"Class"},{"name":"ToolCallResult","href":"AnthropicClient.Models.ToolCallResult-1.html","topicHref":"AnthropicClient.Models.ToolCallResult-1.html","topicUid":"AnthropicClient.Models.ToolCallResult`1","type":"Class"},{"name":"ToolChoice","href":"AnthropicClient.Models.ToolChoice.html","topicHref":"AnthropicClient.Models.ToolChoice.html","topicUid":"AnthropicClient.Models.ToolChoice","type":"Class"},{"name":"ToolChoiceType","href":"AnthropicClient.Models.ToolChoiceType.html","topicHref":"AnthropicClient.Models.ToolChoiceType.html","topicUid":"AnthropicClient.Models.ToolChoiceType","type":"Class"},{"name":"ToolResultContent","href":"AnthropicClient.Models.ToolResultContent.html","topicHref":"AnthropicClient.Models.ToolResultContent.html","topicUid":"AnthropicClient.Models.ToolResultContent","type":"Class"},{"name":"ToolUseContent","href":"AnthropicClient.Models.ToolUseContent.html","topicHref":"AnthropicClient.Models.ToolUseContent.html","topicUid":"AnthropicClient.Models.ToolUseContent","type":"Class"},{"name":"UrlSource","href":"AnthropicClient.Models.UrlSource.html","topicHref":"AnthropicClient.Models.UrlSource.html","topicUid":"AnthropicClient.Models.UrlSource","type":"Class"},{"name":"Usage","href":"AnthropicClient.Models.Usage.html","topicHref":"AnthropicClient.Models.Usage.html","topicUid":"AnthropicClient.Models.Usage","type":"Class"}]}],"memberLayout":"SamePage"} diff --git a/docs/index.html b/docs/index.html index 2f4779f..8015dbd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -227,6 +227,119 @@ if (response.IsFailure) Console.WriteLine("Model Id: {0}", response.Value.Id); +

    Files API

    +

    The AnthropicApiClient provides support for the Anthropic Files API, which allows you to upload and manage files for use with the Anthropic API.

    +
    +
    Note
    +

    The Files API is currently in beta. To use the Files API, you’ll need to include the beta feature header: anthropic-beta: files-api-2025-04-14

    +
    +

    Create a File

    +

    You can create a file using the Files API in several ways:

    +
    From a Byte Array
    +
    var fileBytes = await File.ReadAllBytesAsync("path/to/file.txt");
    +var request = new CreateFileRequest(fileBytes, "file.txt", "text/plain");
    +var result = await client.CreateFileAsync(request);
    +
    +if (result.IsSuccess)
    +{
    +  var file = result.Value;
    +  Console.WriteLine($"Created file: {file.Name} (ID: {file.Id})");
    +}
    +
    +
    From a Stream
    +
    using var fileStream = File.OpenRead("path/to/file.txt");
    +var request = new CreateFileRequest(fileStream, "file.txt", "text/plain");
    +
    +var result = await client.CreateFileAsync(request);
    +
    +if (result.IsSuccess)
    +{
    +    var file = result.Value;
    +    Console.WriteLine($"Created file: {file.Name} (ID: {file.Id})");
    +}
    +
    +

    List Files

    +

    You can list files in your account using pagination:

    +
    Single Page
    +
    var result = await client.ListFilesAsync();
    +
    +if (result.IsSuccess)
    +{
    +    var page = result.Value;
    +    Console.WriteLine($"Found {page.Data.Count} files");
    +    
    +    foreach (var file in page.Data)
    +    {
    +        Console.WriteLine($"- {file.Name} (ID: {file.Id}, Size: {file.Size} bytes)");
    +    }
    +    
    +    if (page.HasMore)
    +    {
    +        Console.WriteLine("More files available...");
    +    }
    +}
    +
    +
    With Pagination Options
    +
    var pagingRequest = new PagingRequest(afterId: "file_12345", limit: 10);
    +var result = await client.ListFilesAsync(pagingRequest);
    +
    +
    All Files (Multiple Pages)
    +
    await foreach (var pageResult in client.ListAllFilesAsync(limit: 20))
    +{
    +    if (pageResult.IsSuccess)
    +    {
    +        var page = pageResult.Value;
    +        foreach (var file in page.Data)
    +        {
    +            Console.WriteLine($"- {file.Name} (ID: {file.Id})");
    +        }
    +    }
    +}
    +
    +

    Get File Information

    +

    Retrieve metadata about a specific file:

    +
    var result = await client.GetFileInfoAsync("file_12345");
    +
    +if (result.IsSuccess)
    +{
    +    var file = result.Value;
    +    Console.WriteLine($"File: {file.Name}");
    +    Console.WriteLine($"ID: {file.Id}");
    +    Console.WriteLine($"MIME Type: {file.MimeType}");
    +    Console.WriteLine($"Size: {file.Size} bytes");
    +    Console.WriteLine($"Created: {file.CreatedAt}");
    +    Console.WriteLine($"Downloadable: {file.Downloadable}");
    +}
    +
    +

    Get File Content

    +

    Download the content of a file as a stream:

    +
    var result = await client.GetFileAsync("file_12345");
    +
    +if (result.IsSuccess)
    +{
    +    using var contentStream = result.Value;
    +    using var reader = new StreamReader(contentStream);
    +    var content = await reader.ReadToEndAsync();
    +    
    +    Console.WriteLine("File content:");
    +    Console.WriteLine(content);
    +}
    +
    +

    Delete a File

    +

    Remove a file from your account:

    +
    var result = await client.DeleteFileAsync("file_12345");
    +
    +if (result.IsSuccess)
    +{
    +    var deleteResponse = result.Value;
    +    Console.WriteLine($"Deleted file: {deleteResponse.Id}");
    +    Console.WriteLine($"Type: {deleteResponse.Type}");
    +}
    +
    +
    +
    Note
    +

    The Files API has certain limitations on file size, supported file types, and usage quotas. Please refer to the Anthropic API Documentation for the most up-to-date information on these limitations.

    +

    Create a message

    The AnthropicApiClient exposes a 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

    diff --git a/docs/index.json b/docs/index.json index c4c06cf..7cf826c 100644 --- a/docs/index.json +++ b/docs/index.json @@ -2,12 +2,12 @@ "api/AnthropicClient.AnthropicApiClient.html": { "href": "api/AnthropicClient.AnthropicApiClient.html", "title": "Class AnthropicApiClient | AnthropicClient", - "summary": "Class AnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public class AnthropicApiClient : IAnthropicApiClient Inheritance object AnthropicApiClient Implements IAnthropicApiClient Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicApiClient(string, HttpClient) Initializes a new instance of the AnthropicApiClient class. public AnthropicApiClient(string apiKey, HttpClient httpClient) Parameters apiKey string The API key to use for the client. httpClient HttpClient The HTTP client to use for the client. Exceptions ArgumentNullException Thrown when the API key or HTTP client is null. Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. public Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. public Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. public Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. public IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. public Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. public Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. public Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. public Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. public Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. public IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. public IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. public Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. public Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel." + "summary": "Class AnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public class AnthropicApiClient : IAnthropicApiClient Inheritance object AnthropicApiClient Implements IAnthropicApiClient Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicApiClient(string, HttpClient) Initializes a new instance of the AnthropicApiClient class. public AnthropicApiClient(string apiKey, HttpClient httpClient) Parameters apiKey string The API key to use for the client. httpClient HttpClient The HTTP client to use for the client. Exceptions ArgumentNullException Thrown when the API key or HTTP client is null. Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. public Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. public Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateFileAsync(CreateFileRequest, CancellationToken) Creates a file asynchronously using the Files API. public Task> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default) Parameters request CreateFileRequest The file creation request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. public Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. public IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. public Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteFileAsync(string, CancellationToken) Deletes a file by its ID asynchronously. public Task> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFileDeleteResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. public Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetFileAsync(string, CancellationToken) Gets a file's content by its ID asynchronously. public Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get the content for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is a stream containing the file content. GetFileInfoAsync(string, CancellationToken) Gets a file's metadata by its ID asynchronously. public Task> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. public Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. public Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. public Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllFilesAsync(int, CancellationToken) Lists all files asynchronously, returning every page of results. public IAsyncEnumerable>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of files to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicFile. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. public IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. public IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListFilesAsync(PagingRequest?, CancellationToken) Lists files asynchronously, returning a single page of results. public Task>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the files. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicFile. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. public Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. public Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel." }, "api/AnthropicClient.IAnthropicApiClient.html": { "href": "api/AnthropicClient.IAnthropicApiClient.html", "title": "Interface IAnthropicApiClient | AnthropicClient", - "summary": "Interface IAnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public interface IAnthropicApiClient Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel." + "summary": "Interface IAnthropicApiClient Namespace AnthropicClient Assembly AnthropicClient.dll Represents a client for interacting with the Anthropic API. public interface IAnthropicApiClient Methods CancelMessageBatchAsync(string, CancellationToken) Cancels a message batch asynchronously. Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to cancel. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. CountMessageTokensAsync(CountMessageTokensRequest, CancellationToken) Counts the tokens in a message asynchronously. Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default) Parameters request CountMessageTokensRequest The count message tokens request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is TokenCountResponse. CreateFileAsync(CreateFileRequest, CancellationToken) Creates a file asynchronously using the Files API. Task> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default) Parameters request CreateFileRequest The file creation request. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. CreateMessageAsync(MessageRequest, CancellationToken) Creates a message asynchronously. Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default) Parameters request MessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult. CreateMessageAsync(StreamMessageRequest, CancellationToken) Creates a message asynchronously and streams the response. IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default) Parameters request StreamMessageRequest The message request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable An asynchronous enumerable that yields the response event by event. CreateMessageBatchAsync(MessageBatchRequest, CancellationToken) Creates a batch of messages asynchronously. Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default) Parameters request MessageBatchRequest The message batch request to create. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. DeleteFileAsync(string, CancellationToken) Deletes a file by its ID asynchronously. Task> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFileDeleteResponse. DeleteMessageBatchAsync(string, CancellationToken) Deletes a message batch asynchronously. Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to delete. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchDeleteResponse. GetFileAsync(string, CancellationToken) Gets a file's content by its ID asynchronously. Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get the content for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is a stream containing the file content. GetFileInfoAsync(string, CancellationToken) Gets a file's metadata by its ID asynchronously. Task> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default) Parameters fileId string The ID of the file to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicFile. GetMessageBatchAsync(string, CancellationToken) Gets a message batch asynchronously. Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is MessageBatchResponse. GetMessageBatchResultsAsync(string, CancellationToken) Gets the results of a message batch asynchronously. Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default) Parameters batchId string The ID of the message batch to get the results for. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is IAsyncEnumerable where T is MessageBatchResultItem. GetModelAsync(string, CancellationToken) Gets a model by its ID asynchronously. Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default) Parameters modelId string The ID of the model to get. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is AnthropicModel. ListAllFilesAsync(int, CancellationToken) Lists all files asynchronously, returning every page of results. IAsyncEnumerable>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of files to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicFile. ListAllMessageBatchesAsync(int, CancellationToken) Lists all message batches asynchronously. IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of message batches to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListAllModelsAsync(int, CancellationToken) Lists all models asynchronously, returning every page of results. IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default) Parameters limit int The maximum number of models to return in each page. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns IAsyncEnumerable>> An asynchronous enumerable that yields the response as an AnthropicResult where T is Page where T is AnthropicModel. ListFilesAsync(PagingRequest?, CancellationToken) Lists files asynchronously, returning a single page of results. Task>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the files. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicFile. ListMessageBatchesAsync(PagingRequest?, CancellationToken) Lists the message batches asynchronously. Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the message batches. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is MessageBatchResponse. ListModelsAsync(PagingRequest?, CancellationToken) Lists models asynchronously, returning a single page of results. Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default) Parameters request PagingRequest The paging request to use for listing the models. cancellationToken CancellationToken A token to cancel the asynchronous operation. Returns Task>> A task that represents the asynchronous operation. The task result contains the response as an AnthropicResult where T is Page where T is AnthropicModel." }, "api/AnthropicClient.Models.AnthropicError.html": { "href": "api/AnthropicClient.Models.AnthropicError.html", @@ -19,6 +19,16 @@ "title": "Class AnthropicEvent | AnthropicClient", "summary": "Class AnthropicEvent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents an event from the Anthropic API. public class AnthropicEvent Inheritance object AnthropicEvent Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors AnthropicEvent(string, EventData) Initializes a new instance of the AnthropicEvent class. public AnthropicEvent(string type, EventData data) Parameters type string The type of the event. data EventData The data associated with the event. Properties Data The data associated with the event. public EventData Data { get; init; } Property Value EventData Type The type of the event. public string Type { get; init; } Property Value string" }, + "api/AnthropicClient.Models.AnthropicFile.html": { + "href": "api/AnthropicClient.Models.AnthropicFile.html", + "title": "Class AnthropicFile | AnthropicClient", + "summary": "Class AnthropicFile Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a file object from the Anthropic Files API. public class AnthropicFile Inheritance object AnthropicFile Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties CreatedAt Date file was created. [JsonPropertyName(\"created_at\")] public DateTimeOffset CreatedAt { get; init; } Property Value DateTimeOffset Downloadable Whether the file can be downloaded. [JsonPropertyName(\"downloadable\")] public bool Downloadable { get; init; } Property Value bool Id Unique object identifier. [JsonPropertyName(\"id\")] public string Id { get; init; } Property Value string MimeType MIME type of the file. [JsonPropertyName(\"mime_type\")] public string MimeType { get; init; } Property Value string Name Original filename of the uploaded file. [JsonPropertyName(\"filename\")] public string Name { get; init; } Property Value string Size Size of the file in bytes. [JsonPropertyName(\"size_bytes\")] public long Size { get; init; } Property Value long Type Object type. [JsonPropertyName(\"type\")] public string Type { get; init; } Property Value string" + }, + "api/AnthropicClient.Models.AnthropicFileDeleteResponse.html": { + "href": "api/AnthropicClient.Models.AnthropicFileDeleteResponse.html", + "title": "Class AnthropicFileDeleteResponse | AnthropicClient", + "summary": "Class AnthropicFileDeleteResponse Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the response from deleting a file in the Anthropic API. public class AnthropicFileDeleteResponse Inheritance object AnthropicFileDeleteResponse Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Properties Id Gets or sets the ID of the file that was deleted. public string Id { get; init; } Property Value string Type Gets or sets the response type public string Type { get; init; } Property Value string" + }, "api/AnthropicClient.Models.AnthropicFunction.html": { "href": "api/AnthropicClient.Models.AnthropicFunction.html", "title": "Class AnthropicFunction | AnthropicClient", @@ -37,7 +47,7 @@ "api/AnthropicClient.Models.AnthropicModels.html": { "href": "api/AnthropicClient.Models.AnthropicModels.html", "title": "Class AnthropicModels | AnthropicClient", - "summary": "Class AnthropicModels Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for the Anthropic models. public static class AnthropicModels Inheritance object AnthropicModels Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Claude35Haiku20241022 The Claude 3.5 Haiku model. public const string Claude35Haiku20241022 = \"claude-3-5-haiku-20241022\" Field Value string Claude35HaikuLatest The Claude 3.5 Haiku model. public const string Claude35HaikuLatest = \"claude-3-5-haiku-latest\" Field Value string Claude35Sonnet The Claude 3.5 Sonnet model. public const string Claude35Sonnet = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20240620 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20240620 = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20241022 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20241022 = \"claude-3-5-sonnet-20241022\" Field Value string Claude35SonnetLatest The Claude 3.5 Sonnet model. public const string Claude35SonnetLatest = \"claude-3-5-sonnet-latest\" Field Value string Claude3Haiku The Claude 3 Haiku model. public const string Claude3Haiku = \"claude-3-haiku-20240307\" Field Value string Claude3Haiku20240307 The Claude 3 Haiku model. public const string Claude3Haiku20240307 = \"claude-3-haiku-20240307\" Field Value string Claude3Opus The Claude 3 Opus model. public const string Claude3Opus = \"claude-3-opus-20240229\" Field Value string Claude3Opus20241022 The Claude 3 Opus model. public const string Claude3Opus20241022 = \"claude-3-opus-20240229\" Field Value string Claude3OpusLatest The Claude 3 Opus model. public const string Claude3OpusLatest = \"claude-3-opus-latest\" Field Value string Claude3Sonnet The Claude 3 Sonnet model. public const string Claude3Sonnet = \"claude-3-sonnet-20240229\" Field Value string Claude3Sonnet20240229 The Claude 3 Sonnet model. public const string Claude3Sonnet20240229 = \"claude-3-sonnet-20240229\" Field Value string" + "summary": "Class AnthropicModels Namespace AnthropicClient.Models Assembly AnthropicClient.dll Provides constants for the Anthropic models. public static class AnthropicModels Inheritance object AnthropicModels Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Claude35Haiku20241022 The Claude 3.5 Haiku model. public const string Claude35Haiku20241022 = \"claude-3-5-haiku-20241022\" Field Value string Claude35HaikuLatest The Claude 3.5 Haiku model. public const string Claude35HaikuLatest = \"claude-3-5-haiku-latest\" Field Value string Claude35Sonnet The Claude 3.5 Sonnet model. public const string Claude35Sonnet = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20240620 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20240620 = \"claude-3-5-sonnet-20240620\" Field Value string Claude35Sonnet20241022 The Claude 3.5 Sonnet model. public const string Claude35Sonnet20241022 = \"claude-3-5-sonnet-20241022\" Field Value string Claude35SonnetLatest The Claude 3.5 Sonnet model. public const string Claude35SonnetLatest = \"claude-3-5-sonnet-latest\" Field Value string Claude37Sonnet20250219 The Claude 3 Sonnet model public const string Claude37Sonnet20250219 = \"claude-3-7-sonnet-20250219\" Field Value string Claude37SonnetLatest The Claude 3 Sonnet model public const string Claude37SonnetLatest = \"claude-3-7-sonnet-latest\" Field Value string Claude3Haiku The Claude 3 Haiku model. public const string Claude3Haiku = \"claude-3-haiku-20240307\" Field Value string Claude3Haiku20240307 The Claude 3 Haiku model. public const string Claude3Haiku20240307 = \"claude-3-haiku-20240307\" Field Value string Claude3Opus The Claude 3 Opus model. public const string Claude3Opus = \"claude-3-opus-20240229\" Field Value string Claude3Opus20241022 The Claude 3 Opus model. public const string Claude3Opus20241022 = \"claude-3-opus-20240229\" Field Value string Claude3OpusLatest The Claude 3 Opus model. public const string Claude3OpusLatest = \"claude-3-opus-latest\" Field Value string Claude3Sonnet The Claude 3 Sonnet model. public const string Claude3Sonnet = \"claude-3-sonnet-20240229\" Field Value string Claude3Sonnet20240229 The Claude 3 Sonnet model. public const string Claude3Sonnet20240229 = \"claude-3-sonnet-20240229\" Field Value string ClaudeOpus40 The Claude 4 Opus model. public const string ClaudeOpus40 = \"claude-opus-4-0\" Field Value string ClaudeOpus420250514 The Claude 4 Opus model. public const string ClaudeOpus420250514 = \"claude-opus-4-20250514\" Field Value string ClaudeSonnet40 The Claude 4 Sonnet model. public const string ClaudeSonnet40 = \"claude-sonnet-4-0\" Field Value string ClaudeSonnet420250514 The Claude 4 Sonnet model. public const string ClaudeSonnet420250514 = \"claude-sonnet-4-20250514\" Field Value string" }, "api/AnthropicClient.Models.AnyToolChoice.html": { "href": "api/AnthropicClient.Models.AnyToolChoice.html", @@ -154,6 +164,11 @@ "title": "Class CountMessageTokensRequest | AnthropicClient", "summary": "Class CountMessageTokensRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a request to count the number of tokens in a message. public class CountMessageTokensRequest Inheritance object CountMessageTokensRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors CountMessageTokensRequest(string, List, ToolChoice?, List?, List?) Initializes a new instance of the CountMessageTokensRequest class. public CountMessageTokensRequest(string model, List messages, ToolChoice? toolChoice = null, List? tools = null, List? systemPrompt = null) Parameters model string The model ID to use for the request. messages List The messages to count the number of tokens in. toolChoice ToolChoice The tool choice mode to use for the request. tools List The tools to use for the request. systemPrompt List The system prompt to use for the request. Exceptions ArgumentNullException Thrown when model or messages is null. ArgumentException Thrown when messages is empty. Properties Messages Gets the messages to count the number of tokens in. public List Messages { get; init; } Property Value List Model Gets the model ID to be used for the request. public string Model { get; init; } Property Value string SystemPrompt Gets the system prompt to use for the request. [JsonPropertyName(\"system\")] public List? SystemPrompt { get; init; } Property Value List 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? Tools { get; init; } Property Value List" }, + "api/AnthropicClient.Models.CreateFileRequest.html": { + "href": "api/AnthropicClient.Models.CreateFileRequest.html", + "title": "Class CreateFileRequest | AnthropicClient", + "summary": "Class CreateFileRequest Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a request to create a file via the Anthropic Files API. public class CreateFileRequest Inheritance object CreateFileRequest Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors CreateFileRequest(byte[], string, string) Initializes a new instance of the CreateFileRequest class. public CreateFileRequest(byte[] file, string fileName, string fileType) Parameters file byte[] The file content as a byte array. fileName string The original filename of the file being uploaded. fileType string The MIME type of the file. Exceptions ArgumentNullException Thrown when file is null. ArgumentException Thrown when fileName or fileType is null or whitespace. CreateFileRequest(Stream, string, string) Initializes a new instance of the CreateFileRequest class from a stream. public CreateFileRequest(Stream stream, string fileName, string fileType) Parameters stream Stream The stream containing the file content. fileName string The original filename of the file being uploaded. fileType string The MIME type of the file. Exceptions ArgumentNullException Thrown when stream is null. ArgumentException Thrown when fileName or fileType is null or whitespace. Properties File The file content as a byte array. public byte[] File { get; init; } Property Value byte[] FileName The original filename of the file being uploaded. public string FileName { get; init; } Property Value string FileType The MIME type of the file. public string FileType { get; init; } Property Value string" + }, "api/AnthropicClient.Models.CustomSource.html": { "href": "api/AnthropicClient.Models.CustomSource.html", "title": "Class CustomSource | AnthropicClient", @@ -209,6 +224,11 @@ "title": "Class ExpiredMessageBatchResult | AnthropicClient", "summary": "Class ExpiredMessageBatchResult Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a message batch result that has expired. public class ExpiredMessageBatchResult : MessageBatchResult Inheritance object MessageBatchResult ExpiredMessageBatchResult Inherited Members MessageBatchResult.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ExpiredMessageBatchResult() Initializes a new instance of the ExpiredMessageBatchResult class. public ExpiredMessageBatchResult()" }, + "api/AnthropicClient.Models.FileSource.html": { + "href": "api/AnthropicClient.Models.FileSource.html", + "title": "Class FileSource | AnthropicClient", + "summary": "Class FileSource Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a file source in the Anthropic API. public class FileSource : Source Inheritance object Source FileSource Inherited Members Source.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors FileSource() Initializes a new instance of the FileSource class. public FileSource() FileSource(string) Initializes a new instance of the FileSource class with a specified file ID. public FileSource(string id) Parameters id string The unique identifier for the file source. Properties Id Gets or sets the unique identifier for the file source. [JsonPropertyName(\"file_id\")] public string Id { get; init; } Property Value string" + }, "api/AnthropicClient.Models.FunctionParameterAttribute.html": { "href": "api/AnthropicClient.Models.FunctionParameterAttribute.html", "title": "Class FunctionParameterAttribute | AnthropicClient", @@ -227,7 +247,7 @@ "api/AnthropicClient.Models.ImageContent.html": { "href": "api/AnthropicClient.Models.ImageContent.html", "title": "Class ImageContent | AnthropicClient", - "summary": "Class ImageContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents image content that is part of a message. public class ImageContent : Content Inheritance object Content ImageContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ImageContent(string, string) Initializes a new instance of the ImageContent class. public ImageContent(string mediaType, string data) Parameters mediaType string The media type of the image. data string The data of the image. Exceptions ArgumentNullException Thrown when the media type or data is null. ImageContent(string, string, CacheControl) Initializes a new instance of the ImageContent class. public ImageContent(string mediaType, string data, CacheControl cacheControl) Parameters mediaType string The media type of the image. data string The data of the image. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the media type, data, or cache control is null. Properties Source Gets the source of the image. public Source Source { get; init; } Property Value Source" + "summary": "Class ImageContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents image content that is part of a message. public class ImageContent : Content Inheritance object Content ImageContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ImageContent(Source) Initializes a new instance of the ImageContent class. public ImageContent(Source source) Parameters source Source The source of the image. Exceptions ArgumentNullException Thrown when the source is null. ImageContent(Source, CacheControl) Initializes a new instance of the ImageContent class. public ImageContent(Source source, CacheControl cacheControl) Parameters source Source The source of the image. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the source or cache control is null. ImageContent(string, string) Initializes a new instance of the ImageContent class. public ImageContent(string mediaType, string data) Parameters mediaType string The media type of the image. data string The data of the image. Exceptions ArgumentNullException Thrown when the media type or data is null. ImageContent(string, string, CacheControl) Initializes a new instance of the ImageContent class. public ImageContent(string mediaType, string data, CacheControl cacheControl) Parameters mediaType string The media type of the image. data string The data of the image. cacheControl CacheControl The cache control to be used for the content. Exceptions ArgumentNullException Thrown when the media type, data, or cache control is null. Properties Source Gets the source of the image. public Source Source { get; init; } Property Value Source" }, "api/AnthropicClient.Models.ImageSource.html": { "href": "api/AnthropicClient.Models.ImageSource.html", @@ -397,12 +417,12 @@ "api/AnthropicClient.Models.Source.html": { "href": "api/AnthropicClient.Models.Source.html", "title": "Class Source | AnthropicClient", - "summary": "Class Source Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a base class for sources. public abstract class Source Inheritance object Source Derived Base64Source CustomSource TextSource Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors Source(string) Initializes a new instance of the Source class. protected Source(string type) Parameters type string The type of the source. Properties Type Gets the type of the source. public string Type { get; init; } Property Value string" + "summary": "Class Source Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a base class for sources. public abstract class Source Inheritance object Source Derived Base64Source CustomSource FileSource TextSource UrlSource Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors Source(string) Initializes a new instance of the Source class. protected Source(string type) Parameters type string The type of the source. Properties Type Gets the type of the source. public string Type { get; init; } Property Value string" }, "api/AnthropicClient.Models.SourceType.html": { "href": "api/AnthropicClient.Models.SourceType.html", "title": "Class SourceType | AnthropicClient", - "summary": "Class SourceType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the types of document sources that can be used in the Anthropic API. public static class SourceType Inheritance object SourceType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Base64 The base64 encoded document source type. public const string Base64 = \"base64\" Field Value string Content The custom content document source type. public const string Content = \"content\" Field Value string Text The text document source type. public const string Text = \"text\" Field Value string" + "summary": "Class SourceType Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents the types of document sources that can be used in the Anthropic API. public static class SourceType Inheritance object SourceType Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Fields Base64 The base64 encoded document source type. public const string Base64 = \"base64\" Field Value string Content The custom content document source type. public const string Content = \"content\" Field Value string File The file document source type. public const string File = \"file\" Field Value string Text The text document source type. public const string Text = \"text\" Field Value string Url The URL document source type. public const string Url = \"url\" Field Value string" }, "api/AnthropicClient.Models.SpecificToolChoice.html": { "href": "api/AnthropicClient.Models.SpecificToolChoice.html", @@ -479,6 +499,11 @@ "title": "Class ToolUseContent | AnthropicClient", "summary": "Class ToolUseContent Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents tool use content that is part of a message. public class ToolUseContent : Content Inheritance object Content ToolUseContent Inherited Members Content.Type Content.CacheControl object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors ToolUseContent() Initializes a new instance of the ToolUseContent class. public ToolUseContent() Properties Id Gets the ID of the tool use. public string Id { get; init; } Property Value string Input Gets the input of the tool. public Dictionary Input { get; init; } Property Value Dictionary Name Gets the name of the tool. public string Name { get; init; } Property Value string" }, + "api/AnthropicClient.Models.UrlSource.html": { + "href": "api/AnthropicClient.Models.UrlSource.html", + "title": "Class UrlSource | AnthropicClient", + "summary": "Class UrlSource Namespace AnthropicClient.Models Assembly AnthropicClient.dll Represents a URL source in the Anthropic API. public class UrlSource : Source Inheritance object Source UrlSource Inherited Members Source.Type object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() Constructors UrlSource() Initializes a new instance of the UrlSource class. public UrlSource() UrlSource(string) Initializes a new instance of the UrlSource class with a specified URL. public UrlSource(string url) Parameters url string The URL of the source document. Properties Url Gets or sets the URL of the source document. public string Url { get; init; } Property Value string" + }, "api/AnthropicClient.Models.Usage.html": { "href": "api/AnthropicClient.Models.Usage.html", "title": "Class Usage | AnthropicClient", @@ -487,7 +512,7 @@ "api/AnthropicClient.Models.html": { "href": "api/AnthropicClient.Models.html", "title": "Namespace AnthropicClient.Models | AnthropicClient", - "summary": "Namespace AnthropicClient.Models Classes AnthropicError Represents an error response from the Anthropic API. AnthropicEvent Represents an event from the Anthropic API. AnthropicFunction Represents a function that can be provided as a tool. AnthropicHeaders Represents headers included in Anthropic API responses. AnthropicModel Represents an Anthropic model. AnthropicModels Provides constants for the Anthropic models. AnyToolChoice Represents the any tool choice mode. ApiError Represents an api_error response from the Anthropic API. AuthenticationError Represents an authentication_error response from the Anthropic API. AutoToolChoice Represents the auto tool choice mode. Base64Source Represents a base64 source. BaseMessageRequest Represents a message request. CacheControl Represents the cache control to be used for content. CacheControlType Provides constants for cache control types. CanceledMessageBatchResult Represents a message batch result that was cancelled. CharacterLocationCitation Represents a citation for specific locations within text content. Citation Represents a citation CitationDelta Represents a citation delta. CitationOption Represents whether citations are enabled for a document. CitationType The types of citations that can be returned by the Anthropic API. Content Represents part of the content of a message. ContentBlockLocationCitation Represents a citation for content blocks within custom content. ContentDelta Represents a content delta. ContentDeltaEventData Represents data for a content_block_delta event. ContentDeltaType Provides constants for content delta types. ContentStartEventData Represents data for a content_block_start event. ContentStopEventData Represents data for a content_block_stop event. ContentType Represents the content type. CountMessageTokensRequest Represents a request to count the number of tokens in a message. CustomSource Represents a custom source that contains a list of text content. DocumentContent Represents content from a document that is part of a message. DocumentSource Represents a document source. EphemeralCacheControl Represents the cache control to be used for content. Error Represents an error. ErrorEventData Represents data for an error event. ErrorType Represents the error type. ErroredMessageBatchResult Represents a message batch result that contains an error response. EventData Represents data for an event. EventType Provides constants for event types. ExpiredMessageBatchResult Represents a message batch result that has expired. FunctionParameterAttribute Attribute to describe a function parameter. FunctionPropertyAttribute Attribute to describe a property of a type that is used as a function parameter. ImageContent Represents image content that is part of a message. ImageSource Represents an image source. ImageType Represents the image type. InputProperty Represents an input property. InputSchema Represents an input schema. InvalidRequestError Represents an invalid_request error. JsonDelta Represents a JSON delta. Message Represents a message. MessageBatchDeleteResponse Represents a message batch delete response. MessageBatchRequest Represents a request to create a batch of messages. MessageBatchRequestCounts Represents the counts of requests in a batch of messages. MessageBatchRequestItem Represents an item in a batch of messages. MessageBatchResponse Represents a response to a batch of messages. MessageBatchResult Represents a message batch result. MessageBatchResultItem Represents a message batch result item. MessageBatchResultType Represents the types of message batch results. MessageBatchStatus Represents the status of a message batch. MessageCompleteEventData Represents data for the message_complete event. MessageDelta Represents a message delta. MessageDeltaEventData Represents data for a message_delta event. MessageRequest Represents a message request. MessageResponse Represents a response. MessageRole Represents the message role. MessageStartEventData Represents data for a message_start event. MessageStopEventData Represents data for a message_stop event. NotFoundError Represents a not_found error. OverloadedError Represents an overloaded error. Page Represents a page. PageLocationCitation Represents a citation for text within a page of a document. Page Represents a page with data. PagingRequest Represents a request to page through a collection of items. PermissionError Represents a permission error. PingEventData Represents data for a ping event. RateLimitError Represents a rate_limit error. Source Represents a base class for sources. SourceType Represents the types of document sources that can be used in the Anthropic API. SpecificToolChoice Represents the specific tool choice mode. StopReasonType Represents the stop reason type. StreamMessageRequest Represents a message request. SucceededMessageBatchResult Represents a message batch result that contains a message response. TextContent Represents text content that is part of a message. TextDelta Represents a text delta. TextSource Represents a text document source. TokenCountResponse Represents a response to a token count request. Tool Represents a tool that can be used. ToolCall Represents a tool call. ToolCallResult 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." + "summary": "Namespace AnthropicClient.Models Classes AnthropicError Represents an error response from the Anthropic API. AnthropicEvent Represents an event from the Anthropic API. AnthropicFile Represents a file object from the Anthropic Files API. AnthropicFileDeleteResponse Represents the response from deleting a file in the Anthropic API. AnthropicFunction Represents a function that can be provided as a tool. AnthropicHeaders Represents headers included in Anthropic API responses. AnthropicModel Represents an Anthropic model. AnthropicModels Provides constants for the Anthropic models. AnyToolChoice Represents the any tool choice mode. ApiError Represents an api_error response from the Anthropic API. AuthenticationError Represents an authentication_error response from the Anthropic API. AutoToolChoice Represents the auto tool choice mode. Base64Source Represents a base64 source. BaseMessageRequest Represents a message request. CacheControl Represents the cache control to be used for content. CacheControlType Provides constants for cache control types. CanceledMessageBatchResult Represents a message batch result that was cancelled. CharacterLocationCitation Represents a citation for specific locations within text content. Citation Represents a citation CitationDelta Represents a citation delta. CitationOption Represents whether citations are enabled for a document. CitationType The types of citations that can be returned by the Anthropic API. Content Represents part of the content of a message. ContentBlockLocationCitation Represents a citation for content blocks within custom content. ContentDelta Represents a content delta. ContentDeltaEventData Represents data for a content_block_delta event. ContentDeltaType Provides constants for content delta types. ContentStartEventData Represents data for a content_block_start event. ContentStopEventData Represents data for a content_block_stop event. ContentType Represents the content type. CountMessageTokensRequest Represents a request to count the number of tokens in a message. CreateFileRequest Represents a request to create a file via the Anthropic Files API. CustomSource Represents a custom source that contains a list of text content. DocumentContent Represents content from a document that is part of a message. DocumentSource Represents a document source. EphemeralCacheControl Represents the cache control to be used for content. Error Represents an error. ErrorEventData Represents data for an error event. ErrorType Represents the error type. ErroredMessageBatchResult Represents a message batch result that contains an error response. EventData Represents data for an event. EventType Provides constants for event types. ExpiredMessageBatchResult Represents a message batch result that has expired. FileSource Represents a file source in the Anthropic API. FunctionParameterAttribute Attribute to describe a function parameter. FunctionPropertyAttribute Attribute to describe a property of a type that is used as a function parameter. ImageContent Represents image content that is part of a message. ImageSource Represents an image source. ImageType Represents the image type. InputProperty Represents an input property. InputSchema Represents an input schema. InvalidRequestError Represents an invalid_request error. JsonDelta Represents a JSON delta. Message Represents a message. MessageBatchDeleteResponse Represents a message batch delete response. MessageBatchRequest Represents a request to create a batch of messages. MessageBatchRequestCounts Represents the counts of requests in a batch of messages. MessageBatchRequestItem Represents an item in a batch of messages. MessageBatchResponse Represents a response to a batch of messages. MessageBatchResult Represents a message batch result. MessageBatchResultItem Represents a message batch result item. MessageBatchResultType Represents the types of message batch results. MessageBatchStatus Represents the status of a message batch. MessageCompleteEventData Represents data for the message_complete event. MessageDelta Represents a message delta. MessageDeltaEventData Represents data for a message_delta event. MessageRequest Represents a message request. MessageResponse Represents a response. MessageRole Represents the message role. MessageStartEventData Represents data for a message_start event. MessageStopEventData Represents data for a message_stop event. NotFoundError Represents a not_found error. OverloadedError Represents an overloaded error. Page Represents a page. PageLocationCitation Represents a citation for text within a page of a document. Page Represents a page with data. PagingRequest Represents a request to page through a collection of items. PermissionError Represents a permission error. PingEventData Represents data for a ping event. RateLimitError Represents a rate_limit error. Source Represents a base class for sources. SourceType Represents the types of document sources that can be used in the Anthropic API. SpecificToolChoice Represents the specific tool choice mode. StopReasonType Represents the stop reason type. StreamMessageRequest Represents a message request. SucceededMessageBatchResult Represents a message batch result that contains a message response. TextContent Represents text content that is part of a message. TextDelta Represents a text delta. TextSource Represents a text document source. TokenCountResponse Represents a response to a token count request. Tool Represents a tool that can be used. ToolCall Represents a tool call. ToolCallResult 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. UrlSource Represents a URL source in the Anthropic API. 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", @@ -497,6 +522,6 @@ "index.html": { "href": "index.html", "title": "AnthropicClient | AnthropicClient", - "summary": "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. \uD83D\uDCDD Issues If you encounter any issues while using this library please open an issue here. \uD83D\uDCDC License This library is licensed under the MIT License and is free to use and modify. \uD83D\uDCDD Contributing If you would like to contribute to this library please open a pull request here. \uD83D\uDEE0️ Dependencies Microsoft.Bcl.AsyncInterfaces Used to support async interfaces when streaming messages System.Text.Json Used for JSON serialization and deserialization \uD83D\uDCBE Installation Install the package from NuGet using the following command: dotnet add package AnthropicClient \uD83D\uDD11 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. \uD83D\uDC68\uD83C\uDFFB‍\uD83D\uDCBB 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. Count Message Tokens The AnthropicApiClient exposes a method named CountMessageTokensAsync that can be used to count the number of tokens in a message. The method requires a CountMessageTokensRequest instance as a parameter. using AnthropicClient; using AnthropicClient.Models; var response = await client.CountMessageTokensAsync(new CountMessageTokensRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"Please write a haiku about the ocean.\")] ) ] )); if (response.IsFailure) { Console.WriteLine(\"Failed to count message tokens\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Token Count: {0}\", response.Value.InputTokens); List Models The AnthropicApiClient exposes a method named ListModelsAsync that can be used to list the available models. The method takes an optional PagingRequest instance as a parameter. using AnthropicClient; var response = await client.ListModelsAsync(); if (response.IsFailure) { Console.WriteLine(\"Failed to list models\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var model in response.Value.Data) { Console.WriteLine(\"Model Id: {0}\", model.Id); Console.WriteLine(\"Model Name: {0}\", model.DisplayName); } Using the PagingRequest instance allows you to specify the number of models to return and the page of models to return. using AnthropicClient; using AnthropicClient.Models; var response = await client.ListModelsAsync(new PagingRequest(afterId: \"claude-3-5-sonnet-20241022\", limit: 2)); if (response.IsFailure) { Console.WriteLine(\"Failed to list models\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var model in response.Value.Data) { Console.WriteLine(\"Model Id: {0}\", model.Id); Console.WriteLine(\"Model Name: {0}\", model.DisplayName); } Get Model The AnthropicApiClient exposes a method named GetModelAsync that can be used to get a model by its id. using AnthropicClient; var response = await client.GetModelAsync(\"claude-3-5-sonnet-20241022\"); if (response.IsFailure) { Console.WriteLine(\"Failed to get model\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Model Id: {0}\", response.Value.Id); Create a message The AnthropicApiClient exposes a 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() .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(); 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, Func, or Func. 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 messages = [ new( MessageRole.User, [new TextContent(\"What is the weather in New York?\")] ) ]; List tools = [Tool.CreateFromClass()]; 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; } messages.Add(new(MessageRole.Assistant, response.Content)); foreach (var content in response.Value.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 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; } messages.Add(new(MessageRole.Assistant, response.Content)); if (response?.ToolCall is not null) { var toolCallResult = await response.ToolCall.InvokeAsync(); 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. System Prompt Anthropic's models support the use of system prompts to provide additional context to the user. This can be used to provide additional information to the user or to ask for additional information from the user. This feature is covered in depth in Anthropic's API Documentation. This library aims to make using system prompts convenient by allowing you to provide the system prompts you want Anthropic's models to consider for use when creating a message. System Message You can create a system prompt by providing a string as the system parameter in the MessageRequest or StreamMessageRequest constructor. 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.\")] ) ], system: \"You are a internationally renowned poet. You excel at writing haikus. )); 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; } } System Messages You can create a more complex system prompt by providing a List as the systemMessages parameter in the MessageRequest or StreamMessageRequest constructor. 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.\")] ) ], systemMessages: [ new TextContent(\"You are a internationally renowned poet. You excel at writing haikus.\"), new TextContent(\"You have been asked to 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; } } Prompt Caching Anthropic provides a feature called Prompt Caching that allows you to cache all or part of the prompt you send to the model. This can be used to improve the performance of your application by reducing latency and token usage. This feature is covered in depth in Anthropic's API Documentation. Prompt caching can be used to cache all parts of the prompt including system messages, user messages, and tools. You should refer to the Anthropic API Documentation for specifics on limitations and requirements for using prompt caching. This library aims to make using prompt caching convenient and give you complete control over what parts of the prompt are cached. Currently there is only one type of cache control available - EphemeralCacheControl. Caching System Messages System messages can be cached by providing a List as the systemMessages parameter in the MessageRequest or StreamMessageRequest constructor and having one or more of the TextContent instances have the CacheControl property set. 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.\")] ) ], systemMessages: [ new TextContent(\"You are a internationally renowned poet. You excel at writing haikus. Please use the following as examples.\"), new TextContent(exampleHaikus, new EphemeralCacheControl()) ] )); 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; } } Caching User Messages User messages can be cached by providing a List as the messages parameter in the MessageRequest or StreamMessageRequest constructor and having one or more of the Content instances have the CacheControl property set. 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. Here are some examples of haikus I like.\"), new TextContent(exampleHaikus, new EphemeralCacheControl()) ] ), ] )); 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; } } Caching Tools Tools can be cached by providing a List as the tools parameter in the MessageRequest or StreamMessageRequest constructor and having one or more of the Tool instances have the CacheControl property set. This property can be set after the tool is created manually or by using one of the static methods on the Tool class. using AnthropicClient; 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, new EphemeralCacheControl() ); var response = await client.CreateMessageAsync(new MessageRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"What is the weather in New York?\")] ) ], tools: [ // Lots of other tools // ... getWeatherTool ] )); 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; case ToolUseContent toolUseContent: Console.WriteLine(toolUseContent.Name); break; } } PDF Support Anthropic provides a feature called PDF Support that allows Claude to support PDF input and understand both text and visual content within documents. This feature is covered in depth in Anthropic's API Documentation. PDF support can be used to provide a PDF document as input to the model. This can be used to provide additional context to the model or to ask for additional information from the model. This library aims to make using PDF support convenient by allowing you to provide the PDF document you want Anthropic's models to consider for use when creating a message. PDF Document You can provide a PDF document by providing its base64 encoded content as a DocumentContent instance in the list of messages in the MessageRequest or StreamMessageRequest constructor. using AnthropicClient; using AnthropicClient.Models; var request = new MessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [new TextContent(\"What is the title of this paper?\")]), new(MessageRole.User, [new DocumentContent(\"application/pdf\", base64Data)]) ] ); var response = await client.CreateMessageAsync(request); 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; } } Citations Anthropic provides a feature called Citations that allows Claude to provide citations for information extracted from documents. This feature enables Claude to reference specific parts of the source material when answering questions, making it easier to verify information and understand the context of responses. Citations can be enabled for documents and will return references to the specific locations in the source material where information was found. This library provides comprehensive support for citations through strongly-typed models that represent different types of citation locations. Enabling Citations for Documents You can enable citations for documents by setting the Citations property on DocumentContent instances: using AnthropicClient; using AnthropicClient.Models; var request = new MessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [ new DocumentContent(new TextSource(\"The grass is green. The sky is blue.\")) { Title = \"My Document\", Context = \"This is a trustworthy document.\", Citations = new() { Enabled = true } }, new TextContent(\"What color is the grass and sky?\") ]) ] ); var response = await client.CreateMessageAsync(request); 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(\"Response: {0}\", textContent.Text); if (textContent.Citations is not null) { Console.WriteLine(\"Citations:\"); foreach (var citation in textContent.Citations) { Console.WriteLine(\" - Cited Text: {0}\", citation.CitedText); Console.WriteLine(\" Document: {0}\", citation.DocumentTitle); Console.WriteLine(\" Type: {0}\", citation.Type); switch (citation) { case CharacterLocationCitation charCitation: Console.WriteLine( \" Character Range: {0}-{1}\", charCitation.StartCharIndex, charCitation.EndCharIndex ); break; case PageLocationCitation pageCitation: Console.WriteLine( \" Page Range: {0}-{1}\", pageCitation.StartPageNumber, pageCitation.EndPageNumber ); break; case ContentBlockLocationCitation blockCitation: Console.WriteLine( \" Block Range: {0}-{1}\", blockCitation.StartBlockIndex, blockCitation.EndBlockIndex ); break; } } } break; } } Citations with PDF Documents Citations work particularly well with PDF documents, providing page-level references: using AnthropicClient; using AnthropicClient.Models; var pdfBytes = await File.ReadAllBytesAsync(\"document.pdf\"); var base64Data = Convert.ToBase64String(pdfBytes); var request = new MessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [ new DocumentContent(\"application/pdf\", base64Data) { Title = \"Research Paper\", Citations = new() { Enabled = true } }, new TextContent(\"Summarize the key findings from this research paper.\") ]) ] ); var response = await client.CreateMessageAsync(request); 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(\"Summary: {0}\", textContent.Text); if (textContent.Citations is not null) { Console.WriteLine(\"\\nCitations:\"); foreach (var citation in textContent.Citations.OfType()) { Console.WriteLine( \" - \\\"{0}\\\" (Pages {1}-{2})\", citation.CitedText, citation.StartPageNumber, citation.EndPageNumber ); } } break; } } Citations in Streaming Responses Citations are also supported in streaming responses through the CitationDelta events: using AnthropicClient; using AnthropicClient.Models; var request = new StreamMessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [ new DocumentContent(new TextSource(\"The grass is green. The sky is blue.\")) { Citations = new() { Enabled = true } }, new TextContent(\"What color is the grass?\") ]) ] ); var events = client.CreateMessageAsync(request); await foreach (var e in events) { switch (e.Data) { case ContentDeltaEventData contentData: switch (contentData.Delta) { case CitationDelta citationDelta: Console.WriteLine(\"Citation: {0}\", citationDelta.Citation.CitedText); Console.WriteLine(\"Type: {0}\", citationDelta.Citation.Type); break; case TextDelta textDelta: Console.Write(textDelta.Text); break; } break; } } Message Batches Anthropic provides a feature called Message Batches that allows you to send multiple messages in a single request. This feature is covered in depth in Anthropic's API Documentation. Create a message batch You can create a message batch that will consist of one or more requests to create messages. using AnthropicClient; using AnthropicClient.Models; var request = new MessageBatchRequest([ new( Guid.NewGuid().ToString(), new( model: AnthropicModels.Claude3Haiku, messages: [new(MessageRole.User, [new TextContent(\"Hello!\")])] ) ), ]); var response = await client.CreateMessageBatchAsync(request); if (response.IsFailure) { Console.WriteLine(\"Failed to create message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id); Get a message batch You can retrieve a message batch by its id. using AnthropicClient; using AnthropicClient.Models; var response = await client.GetMessageBatchAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to get message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id); Get a message batch results You can retrieve the results of a message batch by its id. The results are returned as an IAsyncEnumerable collection so that they can be streamed and processed as they are received. using AnthropicClient; using AnthropicClient.Models; var response = await client.GetMessageBatchResultsAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to get message batch results\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } await foreach (var item in response.Value) { Console.WriteLine(\"Item Custom Id: {0}\", result.CustomId); switch (item.Result) { case SucceededMessageBatchResult successResult: foreach (var content in successResult.Message.Content) { if (content is TextContent textContent) { Console.WriteLine(\"Message Batch Result: {0}\", textContent.Text); } } break; default: Console.WriteLine(\"Message Batch Result: {0}\", item.Result.Type); break; } } List message batches You can retrieve a page of message batches. using AnthropicClient; using AnthropicClient.Models; var response = await client.ListMessageBatchesAsync(); if (response.IsFailure) { Console.WriteLine(\"Failed to list message batches\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var batch in response.Value.Data) { Console.WriteLine(\"Message Batch Id: {0}\", batch.Id); } List all message batches You can also retrieve all the pages of message batches without having to implement pagination yourself. This is done by returning an IAsyncEnumerable collection that can be streamed and processed as the pages are received. using AnthropicClient; using AnthropicClient.Models; var pageResponses = client.ListAllMessageBatchesAsync(); await foreach (var response in pageResponses) { if (response.IsFailure) { Console.WriteLine(\"Failed to list message batches\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var batch in response.Value.Data) { Console.WriteLine(\"Message Batch Id: {0}\", batch.Id); } } Cancel a message batch You can cancel a message batch by its id. using AnthropicClient; using AnthropicClient.Models; var response = await client.CancelMessageBatchAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to cancel message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id); Console.WriteLine(\"Message Batch Status: {0}\", response.Value.ProcessingStatus); Delete a message batch You can delete a message batch that is no longer being processed by its id. using AnthropicClient; using AnthropicClient.Models; var response = await client.DeleteMessageBatchAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to delete message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id);" + "summary": "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. \uD83D\uDCDD Issues If you encounter any issues while using this library please open an issue here. \uD83D\uDCDC License This library is licensed under the MIT License and is free to use and modify. \uD83D\uDCDD Contributing If you would like to contribute to this library please open a pull request here. \uD83D\uDEE0️ Dependencies Microsoft.Bcl.AsyncInterfaces Used to support async interfaces when streaming messages System.Text.Json Used for JSON serialization and deserialization \uD83D\uDCBE Installation Install the package from NuGet using the following command: dotnet add package AnthropicClient \uD83D\uDD11 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. \uD83D\uDC68\uD83C\uDFFB‍\uD83D\uDCBB 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. Count Message Tokens The AnthropicApiClient exposes a method named CountMessageTokensAsync that can be used to count the number of tokens in a message. The method requires a CountMessageTokensRequest instance as a parameter. using AnthropicClient; using AnthropicClient.Models; var response = await client.CountMessageTokensAsync(new CountMessageTokensRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"Please write a haiku about the ocean.\")] ) ] )); if (response.IsFailure) { Console.WriteLine(\"Failed to count message tokens\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Token Count: {0}\", response.Value.InputTokens); List Models The AnthropicApiClient exposes a method named ListModelsAsync that can be used to list the available models. The method takes an optional PagingRequest instance as a parameter. using AnthropicClient; var response = await client.ListModelsAsync(); if (response.IsFailure) { Console.WriteLine(\"Failed to list models\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var model in response.Value.Data) { Console.WriteLine(\"Model Id: {0}\", model.Id); Console.WriteLine(\"Model Name: {0}\", model.DisplayName); } Using the PagingRequest instance allows you to specify the number of models to return and the page of models to return. using AnthropicClient; using AnthropicClient.Models; var response = await client.ListModelsAsync(new PagingRequest(afterId: \"claude-3-5-sonnet-20241022\", limit: 2)); if (response.IsFailure) { Console.WriteLine(\"Failed to list models\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var model in response.Value.Data) { Console.WriteLine(\"Model Id: {0}\", model.Id); Console.WriteLine(\"Model Name: {0}\", model.DisplayName); } Get Model The AnthropicApiClient exposes a method named GetModelAsync that can be used to get a model by its id. using AnthropicClient; var response = await client.GetModelAsync(\"claude-3-5-sonnet-20241022\"); if (response.IsFailure) { Console.WriteLine(\"Failed to get model\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Model Id: {0}\", response.Value.Id); Files API The AnthropicApiClient provides support for the Anthropic Files API, which allows you to upload and manage files for use with the Anthropic API. Note The Files API is currently in beta. To use the Files API, you’ll need to include the beta feature header: anthropic-beta: files-api-2025-04-14 Create a File You can create a file using the Files API in several ways: From a Byte Array var fileBytes = await File.ReadAllBytesAsync(\"path/to/file.txt\"); var request = new CreateFileRequest(fileBytes, \"file.txt\", \"text/plain\"); var result = await client.CreateFileAsync(request); if (result.IsSuccess) { var file = result.Value; Console.WriteLine($\"Created file: {file.Name} (ID: {file.Id})\"); } From a Stream using var fileStream = File.OpenRead(\"path/to/file.txt\"); var request = new CreateFileRequest(fileStream, \"file.txt\", \"text/plain\"); var result = await client.CreateFileAsync(request); if (result.IsSuccess) { var file = result.Value; Console.WriteLine($\"Created file: {file.Name} (ID: {file.Id})\"); } List Files You can list files in your account using pagination: Single Page var result = await client.ListFilesAsync(); if (result.IsSuccess) { var page = result.Value; Console.WriteLine($\"Found {page.Data.Count} files\"); foreach (var file in page.Data) { Console.WriteLine($\"- {file.Name} (ID: {file.Id}, Size: {file.Size} bytes)\"); } if (page.HasMore) { Console.WriteLine(\"More files available...\"); } } With Pagination Options var pagingRequest = new PagingRequest(afterId: \"file_12345\", limit: 10); var result = await client.ListFilesAsync(pagingRequest); All Files (Multiple Pages) await foreach (var pageResult in client.ListAllFilesAsync(limit: 20)) { if (pageResult.IsSuccess) { var page = pageResult.Value; foreach (var file in page.Data) { Console.WriteLine($\"- {file.Name} (ID: {file.Id})\"); } } } Get File Information Retrieve metadata about a specific file: var result = await client.GetFileInfoAsync(\"file_12345\"); if (result.IsSuccess) { var file = result.Value; Console.WriteLine($\"File: {file.Name}\"); Console.WriteLine($\"ID: {file.Id}\"); Console.WriteLine($\"MIME Type: {file.MimeType}\"); Console.WriteLine($\"Size: {file.Size} bytes\"); Console.WriteLine($\"Created: {file.CreatedAt}\"); Console.WriteLine($\"Downloadable: {file.Downloadable}\"); } Get File Content Download the content of a file as a stream: var result = await client.GetFileAsync(\"file_12345\"); if (result.IsSuccess) { using var contentStream = result.Value; using var reader = new StreamReader(contentStream); var content = await reader.ReadToEndAsync(); Console.WriteLine(\"File content:\"); Console.WriteLine(content); } Delete a File Remove a file from your account: var result = await client.DeleteFileAsync(\"file_12345\"); if (result.IsSuccess) { var deleteResponse = result.Value; Console.WriteLine($\"Deleted file: {deleteResponse.Id}\"); Console.WriteLine($\"Type: {deleteResponse.Type}\"); } Note The Files API has certain limitations on file size, supported file types, and usage quotas. Please refer to the Anthropic API Documentation for the most up-to-date information on these limitations. Create a message The AnthropicApiClient exposes a 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() .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(); 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, Func, or Func. 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 messages = [ new( MessageRole.User, [new TextContent(\"What is the weather in New York?\")] ) ]; List tools = [Tool.CreateFromClass()]; 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; } messages.Add(new(MessageRole.Assistant, response.Content)); foreach (var content in response.Value.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 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; } messages.Add(new(MessageRole.Assistant, response.Content)); if (response?.ToolCall is not null) { var toolCallResult = await response.ToolCall.InvokeAsync(); 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. System Prompt Anthropic's models support the use of system prompts to provide additional context to the user. This can be used to provide additional information to the user or to ask for additional information from the user. This feature is covered in depth in Anthropic's API Documentation. This library aims to make using system prompts convenient by allowing you to provide the system prompts you want Anthropic's models to consider for use when creating a message. System Message You can create a system prompt by providing a string as the system parameter in the MessageRequest or StreamMessageRequest constructor. 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.\")] ) ], system: \"You are a internationally renowned poet. You excel at writing haikus. )); 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; } } System Messages You can create a more complex system prompt by providing a List as the systemMessages parameter in the MessageRequest or StreamMessageRequest constructor. 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.\")] ) ], systemMessages: [ new TextContent(\"You are a internationally renowned poet. You excel at writing haikus.\"), new TextContent(\"You have been asked to 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; } } Prompt Caching Anthropic provides a feature called Prompt Caching that allows you to cache all or part of the prompt you send to the model. This can be used to improve the performance of your application by reducing latency and token usage. This feature is covered in depth in Anthropic's API Documentation. Prompt caching can be used to cache all parts of the prompt including system messages, user messages, and tools. You should refer to the Anthropic API Documentation for specifics on limitations and requirements for using prompt caching. This library aims to make using prompt caching convenient and give you complete control over what parts of the prompt are cached. Currently there is only one type of cache control available - EphemeralCacheControl. Caching System Messages System messages can be cached by providing a List as the systemMessages parameter in the MessageRequest or StreamMessageRequest constructor and having one or more of the TextContent instances have the CacheControl property set. 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.\")] ) ], systemMessages: [ new TextContent(\"You are a internationally renowned poet. You excel at writing haikus. Please use the following as examples.\"), new TextContent(exampleHaikus, new EphemeralCacheControl()) ] )); 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; } } Caching User Messages User messages can be cached by providing a List as the messages parameter in the MessageRequest or StreamMessageRequest constructor and having one or more of the Content instances have the CacheControl property set. 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. Here are some examples of haikus I like.\"), new TextContent(exampleHaikus, new EphemeralCacheControl()) ] ), ] )); 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; } } Caching Tools Tools can be cached by providing a List as the tools parameter in the MessageRequest or StreamMessageRequest constructor and having one or more of the Tool instances have the CacheControl property set. This property can be set after the tool is created manually or by using one of the static methods on the Tool class. using AnthropicClient; 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, new EphemeralCacheControl() ); var response = await client.CreateMessageAsync(new MessageRequest( AnthropicModels.Claude3Haiku, [ new( MessageRole.User, [new TextContent(\"What is the weather in New York?\")] ) ], tools: [ // Lots of other tools // ... getWeatherTool ] )); 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; case ToolUseContent toolUseContent: Console.WriteLine(toolUseContent.Name); break; } } PDF Support Anthropic provides a feature called PDF Support that allows Claude to support PDF input and understand both text and visual content within documents. This feature is covered in depth in Anthropic's API Documentation. PDF support can be used to provide a PDF document as input to the model. This can be used to provide additional context to the model or to ask for additional information from the model. This library aims to make using PDF support convenient by allowing you to provide the PDF document you want Anthropic's models to consider for use when creating a message. PDF Document You can provide a PDF document by providing its base64 encoded content as a DocumentContent instance in the list of messages in the MessageRequest or StreamMessageRequest constructor. using AnthropicClient; using AnthropicClient.Models; var request = new MessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [new TextContent(\"What is the title of this paper?\")]), new(MessageRole.User, [new DocumentContent(\"application/pdf\", base64Data)]) ] ); var response = await client.CreateMessageAsync(request); 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; } } Citations Anthropic provides a feature called Citations that allows Claude to provide citations for information extracted from documents. This feature enables Claude to reference specific parts of the source material when answering questions, making it easier to verify information and understand the context of responses. Citations can be enabled for documents and will return references to the specific locations in the source material where information was found. This library provides comprehensive support for citations through strongly-typed models that represent different types of citation locations. Enabling Citations for Documents You can enable citations for documents by setting the Citations property on DocumentContent instances: using AnthropicClient; using AnthropicClient.Models; var request = new MessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [ new DocumentContent(new TextSource(\"The grass is green. The sky is blue.\")) { Title = \"My Document\", Context = \"This is a trustworthy document.\", Citations = new() { Enabled = true } }, new TextContent(\"What color is the grass and sky?\") ]) ] ); var response = await client.CreateMessageAsync(request); 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(\"Response: {0}\", textContent.Text); if (textContent.Citations is not null) { Console.WriteLine(\"Citations:\"); foreach (var citation in textContent.Citations) { Console.WriteLine(\" - Cited Text: {0}\", citation.CitedText); Console.WriteLine(\" Document: {0}\", citation.DocumentTitle); Console.WriteLine(\" Type: {0}\", citation.Type); switch (citation) { case CharacterLocationCitation charCitation: Console.WriteLine( \" Character Range: {0}-{1}\", charCitation.StartCharIndex, charCitation.EndCharIndex ); break; case PageLocationCitation pageCitation: Console.WriteLine( \" Page Range: {0}-{1}\", pageCitation.StartPageNumber, pageCitation.EndPageNumber ); break; case ContentBlockLocationCitation blockCitation: Console.WriteLine( \" Block Range: {0}-{1}\", blockCitation.StartBlockIndex, blockCitation.EndBlockIndex ); break; } } } break; } } Citations with PDF Documents Citations work particularly well with PDF documents, providing page-level references: using AnthropicClient; using AnthropicClient.Models; var pdfBytes = await File.ReadAllBytesAsync(\"document.pdf\"); var base64Data = Convert.ToBase64String(pdfBytes); var request = new MessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [ new DocumentContent(\"application/pdf\", base64Data) { Title = \"Research Paper\", Citations = new() { Enabled = true } }, new TextContent(\"Summarize the key findings from this research paper.\") ]) ] ); var response = await client.CreateMessageAsync(request); 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(\"Summary: {0}\", textContent.Text); if (textContent.Citations is not null) { Console.WriteLine(\"\\nCitations:\"); foreach (var citation in textContent.Citations.OfType()) { Console.WriteLine( \" - \\\"{0}\\\" (Pages {1}-{2})\", citation.CitedText, citation.StartPageNumber, citation.EndPageNumber ); } } break; } } Citations in Streaming Responses Citations are also supported in streaming responses through the CitationDelta events: using AnthropicClient; using AnthropicClient.Models; var request = new StreamMessageRequest( model: AnthropicModels.Claude35Sonnet, messages: [ new(MessageRole.User, [ new DocumentContent(new TextSource(\"The grass is green. The sky is blue.\")) { Citations = new() { Enabled = true } }, new TextContent(\"What color is the grass?\") ]) ] ); var events = client.CreateMessageAsync(request); await foreach (var e in events) { switch (e.Data) { case ContentDeltaEventData contentData: switch (contentData.Delta) { case CitationDelta citationDelta: Console.WriteLine(\"Citation: {0}\", citationDelta.Citation.CitedText); Console.WriteLine(\"Type: {0}\", citationDelta.Citation.Type); break; case TextDelta textDelta: Console.Write(textDelta.Text); break; } break; } } Message Batches Anthropic provides a feature called Message Batches that allows you to send multiple messages in a single request. This feature is covered in depth in Anthropic's API Documentation. Create a message batch You can create a message batch that will consist of one or more requests to create messages. using AnthropicClient; using AnthropicClient.Models; var request = new MessageBatchRequest([ new( Guid.NewGuid().ToString(), new( model: AnthropicModels.Claude3Haiku, messages: [new(MessageRole.User, [new TextContent(\"Hello!\")])] ) ), ]); var response = await client.CreateMessageBatchAsync(request); if (response.IsFailure) { Console.WriteLine(\"Failed to create message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id); Get a message batch You can retrieve a message batch by its id. using AnthropicClient; using AnthropicClient.Models; var response = await client.GetMessageBatchAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to get message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id); Get a message batch results You can retrieve the results of a message batch by its id. The results are returned as an IAsyncEnumerable collection so that they can be streamed and processed as they are received. using AnthropicClient; using AnthropicClient.Models; var response = await client.GetMessageBatchResultsAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to get message batch results\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } await foreach (var item in response.Value) { Console.WriteLine(\"Item Custom Id: {0}\", result.CustomId); switch (item.Result) { case SucceededMessageBatchResult successResult: foreach (var content in successResult.Message.Content) { if (content is TextContent textContent) { Console.WriteLine(\"Message Batch Result: {0}\", textContent.Text); } } break; default: Console.WriteLine(\"Message Batch Result: {0}\", item.Result.Type); break; } } List message batches You can retrieve a page of message batches. using AnthropicClient; using AnthropicClient.Models; var response = await client.ListMessageBatchesAsync(); if (response.IsFailure) { Console.WriteLine(\"Failed to list message batches\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var batch in response.Value.Data) { Console.WriteLine(\"Message Batch Id: {0}\", batch.Id); } List all message batches You can also retrieve all the pages of message batches without having to implement pagination yourself. This is done by returning an IAsyncEnumerable collection that can be streamed and processed as the pages are received. using AnthropicClient; using AnthropicClient.Models; var pageResponses = client.ListAllMessageBatchesAsync(); await foreach (var response in pageResponses) { if (response.IsFailure) { Console.WriteLine(\"Failed to list message batches\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } foreach (var batch in response.Value.Data) { Console.WriteLine(\"Message Batch Id: {0}\", batch.Id); } } Cancel a message batch You can cancel a message batch by its id. using AnthropicClient; using AnthropicClient.Models; var response = await client.CancelMessageBatchAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to cancel message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id); Console.WriteLine(\"Message Batch Status: {0}\", response.Value.ProcessingStatus); Delete a message batch You can delete a message batch that is no longer being processed by its id. using AnthropicClient; using AnthropicClient.Models; var response = await client.DeleteMessageBatchAsync(\"batch-id\"); if (response.IsFailure) { Console.WriteLine(\"Failed to delete message batch\"); Console.WriteLine(\"Error Type: {0}\", response.Error.Error.Type); Console.WriteLine(\"Error Message: {0}\", response.Error.Error.Message); return; } Console.WriteLine(\"Message Batch Id: {0}\", response.Value.Id);" } } \ No newline at end of file diff --git a/docs/manifest.json b/docs/manifest.json index f5fbbc6..9403c5a 100644 --- a/docs/manifest.json +++ b/docs/manifest.json @@ -66,6 +66,34 @@ "Title": "AnthropicClient.Models.AnthropicEvent", "Summary": "

    Represents an event from the Anthropic API.

    \n" }, + { + "type": "ManagedReference", + "source_relative_path": "api/AnthropicClient.Models.AnthropicFile.yml", + "output": { + ".html": { + "relative_path": "api/AnthropicClient.Models.AnthropicFile.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "AnthropicClient.Models.AnthropicFile", + "Summary": "

    Represents a file object from the Anthropic Files API.

    \n" + }, + { + "type": "ManagedReference", + "source_relative_path": "api/AnthropicClient.Models.AnthropicFileDeleteResponse.yml", + "output": { + ".html": { + "relative_path": "api/AnthropicClient.Models.AnthropicFileDeleteResponse.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "AnthropicClient.Models.AnthropicFileDeleteResponse", + "Summary": "

    Represents the response from deleting a file in the Anthropic API.

    \n" + }, { "type": "ManagedReference", "source_relative_path": "api/AnthropicClient.Models.AnthropicFunction.yml", @@ -444,6 +472,20 @@ "Title": "AnthropicClient.Models.CountMessageTokensRequest", "Summary": "

    Represents a request to count the number of tokens in a message.

    \n" }, + { + "type": "ManagedReference", + "source_relative_path": "api/AnthropicClient.Models.CreateFileRequest.yml", + "output": { + ".html": { + "relative_path": "api/AnthropicClient.Models.CreateFileRequest.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "AnthropicClient.Models.CreateFileRequest", + "Summary": "

    Represents a request to create a file via the Anthropic Files API.

    \n" + }, { "type": "ManagedReference", "source_relative_path": "api/AnthropicClient.Models.CustomSource.yml", @@ -598,6 +640,20 @@ "Title": "AnthropicClient.Models.ExpiredMessageBatchResult", "Summary": "

    Represents a message batch result that has expired.

    \n" }, + { + "type": "ManagedReference", + "source_relative_path": "api/AnthropicClient.Models.FileSource.yml", + "output": { + ".html": { + "relative_path": "api/AnthropicClient.Models.FileSource.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "AnthropicClient.Models.FileSource", + "Summary": "

    Represents a file source in the Anthropic API.

    \n" + }, { "type": "ManagedReference", "source_relative_path": "api/AnthropicClient.Models.FunctionParameterAttribute.yml", @@ -1354,6 +1410,20 @@ "Title": "AnthropicClient.Models.ToolUseContent", "Summary": "

    Represents tool use content that is part of a message.

    \n" }, + { + "type": "ManagedReference", + "source_relative_path": "api/AnthropicClient.Models.UrlSource.yml", + "output": { + ".html": { + "relative_path": "api/AnthropicClient.Models.UrlSource.html" + } + }, + "version": "", + "Uid": null, + "IsMRef": true, + "Title": "AnthropicClient.Models.UrlSource", + "Summary": "

    Represents a URL source in the Anthropic API.

    \n" + }, { "type": "ManagedReference", "source_relative_path": "api/AnthropicClient.Models.Usage.yml", diff --git a/docs/xrefmap.yml b/docs/xrefmap.yml index 44a9800..7a9e5e0 100644 --- a/docs/xrefmap.yml +++ b/docs/xrefmap.yml @@ -61,6 +61,19 @@ references: isSpec: "True" fullName: AnthropicClient.AnthropicApiClient.CountMessageTokensAsync nameWithType: AnthropicApiClient.CountMessageTokensAsync +- uid: AnthropicClient.AnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest,System.Threading.CancellationToken) + name: CreateFileAsync(CreateFileRequest, CancellationToken) + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_CreateFileAsync_AnthropicClient_Models_CreateFileRequest_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.AnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest,System.Threading.CancellationToken) + fullName: AnthropicClient.AnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest, System.Threading.CancellationToken) + nameWithType: AnthropicApiClient.CreateFileAsync(CreateFileRequest, CancellationToken) +- uid: AnthropicClient.AnthropicApiClient.CreateFileAsync* + name: CreateFileAsync + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_CreateFileAsync_ + commentId: Overload:AnthropicClient.AnthropicApiClient.CreateFileAsync + isSpec: "True" + fullName: AnthropicClient.AnthropicApiClient.CreateFileAsync + nameWithType: AnthropicApiClient.CreateFileAsync - uid: AnthropicClient.AnthropicApiClient.CreateMessageAsync(AnthropicClient.Models.MessageRequest,System.Threading.CancellationToken) name: CreateMessageAsync(MessageRequest, CancellationToken) href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_CreateMessageAsync_AnthropicClient_Models_MessageRequest_System_Threading_CancellationToken_ @@ -93,6 +106,22 @@ references: isSpec: "True" fullName: AnthropicClient.AnthropicApiClient.CreateMessageBatchAsync nameWithType: AnthropicApiClient.CreateMessageBatchAsync +- uid: AnthropicClient.AnthropicApiClient.DeleteFileAsync(System.String,System.Threading.CancellationToken) + name: DeleteFileAsync(string, CancellationToken) + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_DeleteFileAsync_System_String_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.AnthropicApiClient.DeleteFileAsync(System.String,System.Threading.CancellationToken) + name.vb: DeleteFileAsync(String, CancellationToken) + fullName: AnthropicClient.AnthropicApiClient.DeleteFileAsync(string, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.AnthropicApiClient.DeleteFileAsync(String, System.Threading.CancellationToken) + nameWithType: AnthropicApiClient.DeleteFileAsync(string, CancellationToken) + nameWithType.vb: AnthropicApiClient.DeleteFileAsync(String, CancellationToken) +- uid: AnthropicClient.AnthropicApiClient.DeleteFileAsync* + name: DeleteFileAsync + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_DeleteFileAsync_ + commentId: Overload:AnthropicClient.AnthropicApiClient.DeleteFileAsync + isSpec: "True" + fullName: AnthropicClient.AnthropicApiClient.DeleteFileAsync + nameWithType: AnthropicApiClient.DeleteFileAsync - uid: AnthropicClient.AnthropicApiClient.DeleteMessageBatchAsync(System.String,System.Threading.CancellationToken) name: DeleteMessageBatchAsync(string, CancellationToken) href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_DeleteMessageBatchAsync_System_String_System_Threading_CancellationToken_ @@ -109,6 +138,38 @@ references: isSpec: "True" fullName: AnthropicClient.AnthropicApiClient.DeleteMessageBatchAsync nameWithType: AnthropicApiClient.DeleteMessageBatchAsync +- uid: AnthropicClient.AnthropicApiClient.GetFileAsync(System.String,System.Threading.CancellationToken) + name: GetFileAsync(string, CancellationToken) + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_GetFileAsync_System_String_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.AnthropicApiClient.GetFileAsync(System.String,System.Threading.CancellationToken) + name.vb: GetFileAsync(String, CancellationToken) + fullName: AnthropicClient.AnthropicApiClient.GetFileAsync(string, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.AnthropicApiClient.GetFileAsync(String, System.Threading.CancellationToken) + nameWithType: AnthropicApiClient.GetFileAsync(string, CancellationToken) + nameWithType.vb: AnthropicApiClient.GetFileAsync(String, CancellationToken) +- uid: AnthropicClient.AnthropicApiClient.GetFileAsync* + name: GetFileAsync + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_GetFileAsync_ + commentId: Overload:AnthropicClient.AnthropicApiClient.GetFileAsync + isSpec: "True" + fullName: AnthropicClient.AnthropicApiClient.GetFileAsync + nameWithType: AnthropicApiClient.GetFileAsync +- uid: AnthropicClient.AnthropicApiClient.GetFileInfoAsync(System.String,System.Threading.CancellationToken) + name: GetFileInfoAsync(string, CancellationToken) + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_GetFileInfoAsync_System_String_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.AnthropicApiClient.GetFileInfoAsync(System.String,System.Threading.CancellationToken) + name.vb: GetFileInfoAsync(String, CancellationToken) + fullName: AnthropicClient.AnthropicApiClient.GetFileInfoAsync(string, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.AnthropicApiClient.GetFileInfoAsync(String, System.Threading.CancellationToken) + nameWithType: AnthropicApiClient.GetFileInfoAsync(string, CancellationToken) + nameWithType.vb: AnthropicApiClient.GetFileInfoAsync(String, CancellationToken) +- uid: AnthropicClient.AnthropicApiClient.GetFileInfoAsync* + name: GetFileInfoAsync + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_GetFileInfoAsync_ + commentId: Overload:AnthropicClient.AnthropicApiClient.GetFileInfoAsync + isSpec: "True" + fullName: AnthropicClient.AnthropicApiClient.GetFileInfoAsync + nameWithType: AnthropicApiClient.GetFileInfoAsync - uid: AnthropicClient.AnthropicApiClient.GetMessageBatchAsync(System.String,System.Threading.CancellationToken) name: GetMessageBatchAsync(string, CancellationToken) href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_GetMessageBatchAsync_System_String_System_Threading_CancellationToken_ @@ -157,6 +218,22 @@ references: isSpec: "True" fullName: AnthropicClient.AnthropicApiClient.GetModelAsync nameWithType: AnthropicApiClient.GetModelAsync +- uid: AnthropicClient.AnthropicApiClient.ListAllFilesAsync(System.Int32,System.Threading.CancellationToken) + name: ListAllFilesAsync(int, CancellationToken) + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_ListAllFilesAsync_System_Int32_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.AnthropicApiClient.ListAllFilesAsync(System.Int32,System.Threading.CancellationToken) + name.vb: ListAllFilesAsync(Integer, CancellationToken) + fullName: AnthropicClient.AnthropicApiClient.ListAllFilesAsync(int, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.AnthropicApiClient.ListAllFilesAsync(Integer, System.Threading.CancellationToken) + nameWithType: AnthropicApiClient.ListAllFilesAsync(int, CancellationToken) + nameWithType.vb: AnthropicApiClient.ListAllFilesAsync(Integer, CancellationToken) +- uid: AnthropicClient.AnthropicApiClient.ListAllFilesAsync* + name: ListAllFilesAsync + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_ListAllFilesAsync_ + commentId: Overload:AnthropicClient.AnthropicApiClient.ListAllFilesAsync + isSpec: "True" + fullName: AnthropicClient.AnthropicApiClient.ListAllFilesAsync + nameWithType: AnthropicApiClient.ListAllFilesAsync - uid: AnthropicClient.AnthropicApiClient.ListAllMessageBatchesAsync(System.Int32,System.Threading.CancellationToken) name: ListAllMessageBatchesAsync(int, CancellationToken) href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_ListAllMessageBatchesAsync_System_Int32_System_Threading_CancellationToken_ @@ -189,6 +266,22 @@ references: isSpec: "True" fullName: AnthropicClient.AnthropicApiClient.ListAllModelsAsync nameWithType: AnthropicApiClient.ListAllModelsAsync +- uid: AnthropicClient.AnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken) + name: ListFilesAsync(PagingRequest?, CancellationToken) + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_ListFilesAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.AnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken) + name.vb: ListFilesAsync(PagingRequest, CancellationToken) + fullName: AnthropicClient.AnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest?, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.AnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest, System.Threading.CancellationToken) + nameWithType: AnthropicApiClient.ListFilesAsync(PagingRequest?, CancellationToken) + nameWithType.vb: AnthropicApiClient.ListFilesAsync(PagingRequest, CancellationToken) +- uid: AnthropicClient.AnthropicApiClient.ListFilesAsync* + name: ListFilesAsync + href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_ListFilesAsync_ + commentId: Overload:AnthropicClient.AnthropicApiClient.ListFilesAsync + isSpec: "True" + fullName: AnthropicClient.AnthropicApiClient.ListFilesAsync + nameWithType: AnthropicApiClient.ListFilesAsync - uid: AnthropicClient.AnthropicApiClient.ListMessageBatchesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken) name: ListMessageBatchesAsync(PagingRequest?, CancellationToken) href: api/AnthropicClient.AnthropicApiClient.html#AnthropicClient_AnthropicApiClient_ListMessageBatchesAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_ @@ -256,6 +349,19 @@ references: isSpec: "True" fullName: AnthropicClient.IAnthropicApiClient.CountMessageTokensAsync nameWithType: IAnthropicApiClient.CountMessageTokensAsync +- uid: AnthropicClient.IAnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest,System.Threading.CancellationToken) + name: CreateFileAsync(CreateFileRequest, CancellationToken) + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_CreateFileAsync_AnthropicClient_Models_CreateFileRequest_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.IAnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest,System.Threading.CancellationToken) + fullName: AnthropicClient.IAnthropicApiClient.CreateFileAsync(AnthropicClient.Models.CreateFileRequest, System.Threading.CancellationToken) + nameWithType: IAnthropicApiClient.CreateFileAsync(CreateFileRequest, CancellationToken) +- uid: AnthropicClient.IAnthropicApiClient.CreateFileAsync* + name: CreateFileAsync + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_CreateFileAsync_ + commentId: Overload:AnthropicClient.IAnthropicApiClient.CreateFileAsync + isSpec: "True" + fullName: AnthropicClient.IAnthropicApiClient.CreateFileAsync + nameWithType: IAnthropicApiClient.CreateFileAsync - uid: AnthropicClient.IAnthropicApiClient.CreateMessageAsync(AnthropicClient.Models.MessageRequest,System.Threading.CancellationToken) name: CreateMessageAsync(MessageRequest, CancellationToken) href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_CreateMessageAsync_AnthropicClient_Models_MessageRequest_System_Threading_CancellationToken_ @@ -288,6 +394,22 @@ references: isSpec: "True" fullName: AnthropicClient.IAnthropicApiClient.CreateMessageBatchAsync nameWithType: IAnthropicApiClient.CreateMessageBatchAsync +- uid: AnthropicClient.IAnthropicApiClient.DeleteFileAsync(System.String,System.Threading.CancellationToken) + name: DeleteFileAsync(string, CancellationToken) + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_DeleteFileAsync_System_String_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.IAnthropicApiClient.DeleteFileAsync(System.String,System.Threading.CancellationToken) + name.vb: DeleteFileAsync(String, CancellationToken) + fullName: AnthropicClient.IAnthropicApiClient.DeleteFileAsync(string, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.IAnthropicApiClient.DeleteFileAsync(String, System.Threading.CancellationToken) + nameWithType: IAnthropicApiClient.DeleteFileAsync(string, CancellationToken) + nameWithType.vb: IAnthropicApiClient.DeleteFileAsync(String, CancellationToken) +- uid: AnthropicClient.IAnthropicApiClient.DeleteFileAsync* + name: DeleteFileAsync + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_DeleteFileAsync_ + commentId: Overload:AnthropicClient.IAnthropicApiClient.DeleteFileAsync + isSpec: "True" + fullName: AnthropicClient.IAnthropicApiClient.DeleteFileAsync + nameWithType: IAnthropicApiClient.DeleteFileAsync - uid: AnthropicClient.IAnthropicApiClient.DeleteMessageBatchAsync(System.String,System.Threading.CancellationToken) name: DeleteMessageBatchAsync(string, CancellationToken) href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_DeleteMessageBatchAsync_System_String_System_Threading_CancellationToken_ @@ -304,6 +426,38 @@ references: isSpec: "True" fullName: AnthropicClient.IAnthropicApiClient.DeleteMessageBatchAsync nameWithType: IAnthropicApiClient.DeleteMessageBatchAsync +- uid: AnthropicClient.IAnthropicApiClient.GetFileAsync(System.String,System.Threading.CancellationToken) + name: GetFileAsync(string, CancellationToken) + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_GetFileAsync_System_String_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.IAnthropicApiClient.GetFileAsync(System.String,System.Threading.CancellationToken) + name.vb: GetFileAsync(String, CancellationToken) + fullName: AnthropicClient.IAnthropicApiClient.GetFileAsync(string, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.IAnthropicApiClient.GetFileAsync(String, System.Threading.CancellationToken) + nameWithType: IAnthropicApiClient.GetFileAsync(string, CancellationToken) + nameWithType.vb: IAnthropicApiClient.GetFileAsync(String, CancellationToken) +- uid: AnthropicClient.IAnthropicApiClient.GetFileAsync* + name: GetFileAsync + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_GetFileAsync_ + commentId: Overload:AnthropicClient.IAnthropicApiClient.GetFileAsync + isSpec: "True" + fullName: AnthropicClient.IAnthropicApiClient.GetFileAsync + nameWithType: IAnthropicApiClient.GetFileAsync +- uid: AnthropicClient.IAnthropicApiClient.GetFileInfoAsync(System.String,System.Threading.CancellationToken) + name: GetFileInfoAsync(string, CancellationToken) + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_GetFileInfoAsync_System_String_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.IAnthropicApiClient.GetFileInfoAsync(System.String,System.Threading.CancellationToken) + name.vb: GetFileInfoAsync(String, CancellationToken) + fullName: AnthropicClient.IAnthropicApiClient.GetFileInfoAsync(string, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.IAnthropicApiClient.GetFileInfoAsync(String, System.Threading.CancellationToken) + nameWithType: IAnthropicApiClient.GetFileInfoAsync(string, CancellationToken) + nameWithType.vb: IAnthropicApiClient.GetFileInfoAsync(String, CancellationToken) +- uid: AnthropicClient.IAnthropicApiClient.GetFileInfoAsync* + name: GetFileInfoAsync + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_GetFileInfoAsync_ + commentId: Overload:AnthropicClient.IAnthropicApiClient.GetFileInfoAsync + isSpec: "True" + fullName: AnthropicClient.IAnthropicApiClient.GetFileInfoAsync + nameWithType: IAnthropicApiClient.GetFileInfoAsync - uid: AnthropicClient.IAnthropicApiClient.GetMessageBatchAsync(System.String,System.Threading.CancellationToken) name: GetMessageBatchAsync(string, CancellationToken) href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_GetMessageBatchAsync_System_String_System_Threading_CancellationToken_ @@ -352,6 +506,22 @@ references: isSpec: "True" fullName: AnthropicClient.IAnthropicApiClient.GetModelAsync nameWithType: IAnthropicApiClient.GetModelAsync +- uid: AnthropicClient.IAnthropicApiClient.ListAllFilesAsync(System.Int32,System.Threading.CancellationToken) + name: ListAllFilesAsync(int, CancellationToken) + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_ListAllFilesAsync_System_Int32_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.IAnthropicApiClient.ListAllFilesAsync(System.Int32,System.Threading.CancellationToken) + name.vb: ListAllFilesAsync(Integer, CancellationToken) + fullName: AnthropicClient.IAnthropicApiClient.ListAllFilesAsync(int, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.IAnthropicApiClient.ListAllFilesAsync(Integer, System.Threading.CancellationToken) + nameWithType: IAnthropicApiClient.ListAllFilesAsync(int, CancellationToken) + nameWithType.vb: IAnthropicApiClient.ListAllFilesAsync(Integer, CancellationToken) +- uid: AnthropicClient.IAnthropicApiClient.ListAllFilesAsync* + name: ListAllFilesAsync + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_ListAllFilesAsync_ + commentId: Overload:AnthropicClient.IAnthropicApiClient.ListAllFilesAsync + isSpec: "True" + fullName: AnthropicClient.IAnthropicApiClient.ListAllFilesAsync + nameWithType: IAnthropicApiClient.ListAllFilesAsync - uid: AnthropicClient.IAnthropicApiClient.ListAllMessageBatchesAsync(System.Int32,System.Threading.CancellationToken) name: ListAllMessageBatchesAsync(int, CancellationToken) href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_ListAllMessageBatchesAsync_System_Int32_System_Threading_CancellationToken_ @@ -384,6 +554,22 @@ references: isSpec: "True" fullName: AnthropicClient.IAnthropicApiClient.ListAllModelsAsync nameWithType: IAnthropicApiClient.ListAllModelsAsync +- uid: AnthropicClient.IAnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken) + name: ListFilesAsync(PagingRequest?, CancellationToken) + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_ListFilesAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_ + commentId: M:AnthropicClient.IAnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken) + name.vb: ListFilesAsync(PagingRequest, CancellationToken) + fullName: AnthropicClient.IAnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest?, System.Threading.CancellationToken) + fullName.vb: AnthropicClient.IAnthropicApiClient.ListFilesAsync(AnthropicClient.Models.PagingRequest, System.Threading.CancellationToken) + nameWithType: IAnthropicApiClient.ListFilesAsync(PagingRequest?, CancellationToken) + nameWithType.vb: IAnthropicApiClient.ListFilesAsync(PagingRequest, CancellationToken) +- uid: AnthropicClient.IAnthropicApiClient.ListFilesAsync* + name: ListFilesAsync + href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_ListFilesAsync_ + commentId: Overload:AnthropicClient.IAnthropicApiClient.ListFilesAsync + isSpec: "True" + fullName: AnthropicClient.IAnthropicApiClient.ListFilesAsync + nameWithType: IAnthropicApiClient.ListFilesAsync - uid: AnthropicClient.IAnthropicApiClient.ListMessageBatchesAsync(AnthropicClient.Models.PagingRequest,System.Threading.CancellationToken) name: ListMessageBatchesAsync(PagingRequest?, CancellationToken) href: api/AnthropicClient.IAnthropicApiClient.html#AnthropicClient_IAnthropicApiClient_ListMessageBatchesAsync_AnthropicClient_Models_PagingRequest_System_Threading_CancellationToken_ @@ -524,6 +710,135 @@ references: isSpec: "True" fullName: AnthropicClient.Models.AnthropicEvent.Type nameWithType: AnthropicEvent.Type +- uid: AnthropicClient.Models.AnthropicFile + name: AnthropicFile + href: api/AnthropicClient.Models.AnthropicFile.html + commentId: T:AnthropicClient.Models.AnthropicFile + fullName: AnthropicClient.Models.AnthropicFile + nameWithType: AnthropicFile +- uid: AnthropicClient.Models.AnthropicFile.CreatedAt + name: CreatedAt + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_CreatedAt + commentId: P:AnthropicClient.Models.AnthropicFile.CreatedAt + fullName: AnthropicClient.Models.AnthropicFile.CreatedAt + nameWithType: AnthropicFile.CreatedAt +- uid: AnthropicClient.Models.AnthropicFile.CreatedAt* + name: CreatedAt + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_CreatedAt_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.CreatedAt + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.CreatedAt + nameWithType: AnthropicFile.CreatedAt +- uid: AnthropicClient.Models.AnthropicFile.Downloadable + name: Downloadable + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Downloadable + commentId: P:AnthropicClient.Models.AnthropicFile.Downloadable + fullName: AnthropicClient.Models.AnthropicFile.Downloadable + nameWithType: AnthropicFile.Downloadable +- uid: AnthropicClient.Models.AnthropicFile.Downloadable* + name: Downloadable + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Downloadable_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.Downloadable + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.Downloadable + nameWithType: AnthropicFile.Downloadable +- uid: AnthropicClient.Models.AnthropicFile.Id + name: Id + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Id + commentId: P:AnthropicClient.Models.AnthropicFile.Id + fullName: AnthropicClient.Models.AnthropicFile.Id + nameWithType: AnthropicFile.Id +- uid: AnthropicClient.Models.AnthropicFile.Id* + name: Id + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Id_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.Id + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.Id + nameWithType: AnthropicFile.Id +- uid: AnthropicClient.Models.AnthropicFile.MimeType + name: MimeType + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_MimeType + commentId: P:AnthropicClient.Models.AnthropicFile.MimeType + fullName: AnthropicClient.Models.AnthropicFile.MimeType + nameWithType: AnthropicFile.MimeType +- uid: AnthropicClient.Models.AnthropicFile.MimeType* + name: MimeType + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_MimeType_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.MimeType + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.MimeType + nameWithType: AnthropicFile.MimeType +- uid: AnthropicClient.Models.AnthropicFile.Name + name: Name + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Name + commentId: P:AnthropicClient.Models.AnthropicFile.Name + fullName: AnthropicClient.Models.AnthropicFile.Name + nameWithType: AnthropicFile.Name +- uid: AnthropicClient.Models.AnthropicFile.Name* + name: Name + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Name_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.Name + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.Name + nameWithType: AnthropicFile.Name +- uid: AnthropicClient.Models.AnthropicFile.Size + name: Size + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Size + commentId: P:AnthropicClient.Models.AnthropicFile.Size + fullName: AnthropicClient.Models.AnthropicFile.Size + nameWithType: AnthropicFile.Size +- uid: AnthropicClient.Models.AnthropicFile.Size* + name: Size + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Size_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.Size + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.Size + nameWithType: AnthropicFile.Size +- uid: AnthropicClient.Models.AnthropicFile.Type + name: Type + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Type + commentId: P:AnthropicClient.Models.AnthropicFile.Type + fullName: AnthropicClient.Models.AnthropicFile.Type + nameWithType: AnthropicFile.Type +- uid: AnthropicClient.Models.AnthropicFile.Type* + name: Type + href: api/AnthropicClient.Models.AnthropicFile.html#AnthropicClient_Models_AnthropicFile_Type_ + commentId: Overload:AnthropicClient.Models.AnthropicFile.Type + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFile.Type + nameWithType: AnthropicFile.Type +- uid: AnthropicClient.Models.AnthropicFileDeleteResponse + name: AnthropicFileDeleteResponse + href: api/AnthropicClient.Models.AnthropicFileDeleteResponse.html + commentId: T:AnthropicClient.Models.AnthropicFileDeleteResponse + fullName: AnthropicClient.Models.AnthropicFileDeleteResponse + nameWithType: AnthropicFileDeleteResponse +- uid: AnthropicClient.Models.AnthropicFileDeleteResponse.Id + name: Id + href: api/AnthropicClient.Models.AnthropicFileDeleteResponse.html#AnthropicClient_Models_AnthropicFileDeleteResponse_Id + commentId: P:AnthropicClient.Models.AnthropicFileDeleteResponse.Id + fullName: AnthropicClient.Models.AnthropicFileDeleteResponse.Id + nameWithType: AnthropicFileDeleteResponse.Id +- uid: AnthropicClient.Models.AnthropicFileDeleteResponse.Id* + name: Id + href: api/AnthropicClient.Models.AnthropicFileDeleteResponse.html#AnthropicClient_Models_AnthropicFileDeleteResponse_Id_ + commentId: Overload:AnthropicClient.Models.AnthropicFileDeleteResponse.Id + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFileDeleteResponse.Id + nameWithType: AnthropicFileDeleteResponse.Id +- uid: AnthropicClient.Models.AnthropicFileDeleteResponse.Type + name: Type + href: api/AnthropicClient.Models.AnthropicFileDeleteResponse.html#AnthropicClient_Models_AnthropicFileDeleteResponse_Type + commentId: P:AnthropicClient.Models.AnthropicFileDeleteResponse.Type + fullName: AnthropicClient.Models.AnthropicFileDeleteResponse.Type + nameWithType: AnthropicFileDeleteResponse.Type +- uid: AnthropicClient.Models.AnthropicFileDeleteResponse.Type* + name: Type + href: api/AnthropicClient.Models.AnthropicFileDeleteResponse.html#AnthropicClient_Models_AnthropicFileDeleteResponse_Type_ + commentId: Overload:AnthropicClient.Models.AnthropicFileDeleteResponse.Type + isSpec: "True" + fullName: AnthropicClient.Models.AnthropicFileDeleteResponse.Type + nameWithType: AnthropicFileDeleteResponse.Type - uid: AnthropicClient.Models.AnthropicFunction name: AnthropicFunction href: api/AnthropicClient.Models.AnthropicFunction.html @@ -785,6 +1100,18 @@ references: commentId: F:AnthropicClient.Models.AnthropicModels.Claude35SonnetLatest fullName: AnthropicClient.Models.AnthropicModels.Claude35SonnetLatest nameWithType: AnthropicModels.Claude35SonnetLatest +- uid: AnthropicClient.Models.AnthropicModels.Claude37Sonnet20250219 + name: Claude37Sonnet20250219 + href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_Claude37Sonnet20250219 + commentId: F:AnthropicClient.Models.AnthropicModels.Claude37Sonnet20250219 + fullName: AnthropicClient.Models.AnthropicModels.Claude37Sonnet20250219 + nameWithType: AnthropicModels.Claude37Sonnet20250219 +- uid: AnthropicClient.Models.AnthropicModels.Claude37SonnetLatest + name: Claude37SonnetLatest + href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_Claude37SonnetLatest + commentId: F:AnthropicClient.Models.AnthropicModels.Claude37SonnetLatest + fullName: AnthropicClient.Models.AnthropicModels.Claude37SonnetLatest + nameWithType: AnthropicModels.Claude37SonnetLatest - uid: AnthropicClient.Models.AnthropicModels.Claude3Haiku name: Claude3Haiku href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_Claude3Haiku @@ -827,6 +1154,30 @@ references: commentId: F:AnthropicClient.Models.AnthropicModels.Claude3Sonnet20240229 fullName: AnthropicClient.Models.AnthropicModels.Claude3Sonnet20240229 nameWithType: AnthropicModels.Claude3Sonnet20240229 +- uid: AnthropicClient.Models.AnthropicModels.ClaudeOpus40 + name: ClaudeOpus40 + href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_ClaudeOpus40 + commentId: F:AnthropicClient.Models.AnthropicModels.ClaudeOpus40 + fullName: AnthropicClient.Models.AnthropicModels.ClaudeOpus40 + nameWithType: AnthropicModels.ClaudeOpus40 +- uid: AnthropicClient.Models.AnthropicModels.ClaudeOpus420250514 + name: ClaudeOpus420250514 + href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_ClaudeOpus420250514 + commentId: F:AnthropicClient.Models.AnthropicModels.ClaudeOpus420250514 + fullName: AnthropicClient.Models.AnthropicModels.ClaudeOpus420250514 + nameWithType: AnthropicModels.ClaudeOpus420250514 +- uid: AnthropicClient.Models.AnthropicModels.ClaudeSonnet40 + name: ClaudeSonnet40 + href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_ClaudeSonnet40 + commentId: F:AnthropicClient.Models.AnthropicModels.ClaudeSonnet40 + fullName: AnthropicClient.Models.AnthropicModels.ClaudeSonnet40 + nameWithType: AnthropicModels.ClaudeSonnet40 +- uid: AnthropicClient.Models.AnthropicModels.ClaudeSonnet420250514 + name: ClaudeSonnet420250514 + href: api/AnthropicClient.Models.AnthropicModels.html#AnthropicClient_Models_AnthropicModels_ClaudeSonnet420250514 + commentId: F:AnthropicClient.Models.AnthropicModels.ClaudeSonnet420250514 + fullName: AnthropicClient.Models.AnthropicModels.ClaudeSonnet420250514 + nameWithType: AnthropicModels.ClaudeSonnet420250514 - uid: AnthropicClient.Models.AnyToolChoice name: AnyToolChoice href: api/AnthropicClient.Models.AnyToolChoice.html @@ -1908,6 +2259,79 @@ references: isSpec: "True" fullName: AnthropicClient.Models.CountMessageTokensRequest.Tools nameWithType: CountMessageTokensRequest.Tools +- uid: AnthropicClient.Models.CreateFileRequest + name: CreateFileRequest + href: api/AnthropicClient.Models.CreateFileRequest.html + commentId: T:AnthropicClient.Models.CreateFileRequest + fullName: AnthropicClient.Models.CreateFileRequest + nameWithType: CreateFileRequest +- uid: AnthropicClient.Models.CreateFileRequest.#ctor(System.Byte[],System.String,System.String) + name: CreateFileRequest(byte[], string, string) + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest__ctor_System_Byte___System_String_System_String_ + commentId: M:AnthropicClient.Models.CreateFileRequest.#ctor(System.Byte[],System.String,System.String) + name.vb: New(Byte(), String, String) + fullName: AnthropicClient.Models.CreateFileRequest.CreateFileRequest(byte[], string, string) + fullName.vb: AnthropicClient.Models.CreateFileRequest.New(Byte(), String, String) + nameWithType: CreateFileRequest.CreateFileRequest(byte[], string, string) + nameWithType.vb: CreateFileRequest.New(Byte(), String, String) +- uid: AnthropicClient.Models.CreateFileRequest.#ctor(System.IO.Stream,System.String,System.String) + name: CreateFileRequest(Stream, string, string) + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest__ctor_System_IO_Stream_System_String_System_String_ + commentId: M:AnthropicClient.Models.CreateFileRequest.#ctor(System.IO.Stream,System.String,System.String) + name.vb: New(Stream, String, String) + fullName: AnthropicClient.Models.CreateFileRequest.CreateFileRequest(System.IO.Stream, string, string) + fullName.vb: AnthropicClient.Models.CreateFileRequest.New(System.IO.Stream, String, String) + nameWithType: CreateFileRequest.CreateFileRequest(Stream, string, string) + nameWithType.vb: CreateFileRequest.New(Stream, String, String) +- uid: AnthropicClient.Models.CreateFileRequest.#ctor* + name: CreateFileRequest + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest__ctor_ + commentId: Overload:AnthropicClient.Models.CreateFileRequest.#ctor + isSpec: "True" + name.vb: New + fullName: AnthropicClient.Models.CreateFileRequest.CreateFileRequest + fullName.vb: AnthropicClient.Models.CreateFileRequest.New + nameWithType: CreateFileRequest.CreateFileRequest + nameWithType.vb: CreateFileRequest.New +- uid: AnthropicClient.Models.CreateFileRequest.File + name: File + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest_File + commentId: P:AnthropicClient.Models.CreateFileRequest.File + fullName: AnthropicClient.Models.CreateFileRequest.File + nameWithType: CreateFileRequest.File +- uid: AnthropicClient.Models.CreateFileRequest.File* + name: File + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest_File_ + commentId: Overload:AnthropicClient.Models.CreateFileRequest.File + isSpec: "True" + fullName: AnthropicClient.Models.CreateFileRequest.File + nameWithType: CreateFileRequest.File +- uid: AnthropicClient.Models.CreateFileRequest.FileName + name: FileName + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest_FileName + commentId: P:AnthropicClient.Models.CreateFileRequest.FileName + fullName: AnthropicClient.Models.CreateFileRequest.FileName + nameWithType: CreateFileRequest.FileName +- uid: AnthropicClient.Models.CreateFileRequest.FileName* + name: FileName + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest_FileName_ + commentId: Overload:AnthropicClient.Models.CreateFileRequest.FileName + isSpec: "True" + fullName: AnthropicClient.Models.CreateFileRequest.FileName + nameWithType: CreateFileRequest.FileName +- uid: AnthropicClient.Models.CreateFileRequest.FileType + name: FileType + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest_FileType + commentId: P:AnthropicClient.Models.CreateFileRequest.FileType + fullName: AnthropicClient.Models.CreateFileRequest.FileType + nameWithType: CreateFileRequest.FileType +- uid: AnthropicClient.Models.CreateFileRequest.FileType* + name: FileType + href: api/AnthropicClient.Models.CreateFileRequest.html#AnthropicClient_Models_CreateFileRequest_FileType_ + commentId: Overload:AnthropicClient.Models.CreateFileRequest.FileType + isSpec: "True" + fullName: AnthropicClient.Models.CreateFileRequest.FileType + nameWithType: CreateFileRequest.FileType - uid: AnthropicClient.Models.CustomSource name: CustomSource href: api/AnthropicClient.Models.CustomSource.html @@ -2398,6 +2822,53 @@ references: fullName.vb: AnthropicClient.Models.ExpiredMessageBatchResult.New nameWithType: ExpiredMessageBatchResult.ExpiredMessageBatchResult nameWithType.vb: ExpiredMessageBatchResult.New +- uid: AnthropicClient.Models.FileSource + name: FileSource + href: api/AnthropicClient.Models.FileSource.html + commentId: T:AnthropicClient.Models.FileSource + fullName: AnthropicClient.Models.FileSource + nameWithType: FileSource +- uid: AnthropicClient.Models.FileSource.#ctor + name: FileSource() + href: api/AnthropicClient.Models.FileSource.html#AnthropicClient_Models_FileSource__ctor + commentId: M:AnthropicClient.Models.FileSource.#ctor + name.vb: New() + fullName: AnthropicClient.Models.FileSource.FileSource() + fullName.vb: AnthropicClient.Models.FileSource.New() + nameWithType: FileSource.FileSource() + nameWithType.vb: FileSource.New() +- uid: AnthropicClient.Models.FileSource.#ctor(System.String) + name: FileSource(string) + href: api/AnthropicClient.Models.FileSource.html#AnthropicClient_Models_FileSource__ctor_System_String_ + commentId: M:AnthropicClient.Models.FileSource.#ctor(System.String) + name.vb: New(String) + fullName: AnthropicClient.Models.FileSource.FileSource(string) + fullName.vb: AnthropicClient.Models.FileSource.New(String) + nameWithType: FileSource.FileSource(string) + nameWithType.vb: FileSource.New(String) +- uid: AnthropicClient.Models.FileSource.#ctor* + name: FileSource + href: api/AnthropicClient.Models.FileSource.html#AnthropicClient_Models_FileSource__ctor_ + commentId: Overload:AnthropicClient.Models.FileSource.#ctor + isSpec: "True" + name.vb: New + fullName: AnthropicClient.Models.FileSource.FileSource + fullName.vb: AnthropicClient.Models.FileSource.New + nameWithType: FileSource.FileSource + nameWithType.vb: FileSource.New +- uid: AnthropicClient.Models.FileSource.Id + name: Id + href: api/AnthropicClient.Models.FileSource.html#AnthropicClient_Models_FileSource_Id + commentId: P:AnthropicClient.Models.FileSource.Id + fullName: AnthropicClient.Models.FileSource.Id + nameWithType: FileSource.Id +- uid: AnthropicClient.Models.FileSource.Id* + name: Id + href: api/AnthropicClient.Models.FileSource.html#AnthropicClient_Models_FileSource_Id_ + commentId: Overload:AnthropicClient.Models.FileSource.Id + isSpec: "True" + fullName: AnthropicClient.Models.FileSource.Id + nameWithType: FileSource.Id - uid: AnthropicClient.Models.FunctionParameterAttribute name: FunctionParameterAttribute href: api/AnthropicClient.Models.FunctionParameterAttribute.html @@ -2590,6 +3061,24 @@ references: commentId: T:AnthropicClient.Models.ImageContent fullName: AnthropicClient.Models.ImageContent nameWithType: ImageContent +- uid: AnthropicClient.Models.ImageContent.#ctor(AnthropicClient.Models.Source) + name: ImageContent(Source) + href: api/AnthropicClient.Models.ImageContent.html#AnthropicClient_Models_ImageContent__ctor_AnthropicClient_Models_Source_ + commentId: M:AnthropicClient.Models.ImageContent.#ctor(AnthropicClient.Models.Source) + name.vb: New(Source) + fullName: AnthropicClient.Models.ImageContent.ImageContent(AnthropicClient.Models.Source) + fullName.vb: AnthropicClient.Models.ImageContent.New(AnthropicClient.Models.Source) + nameWithType: ImageContent.ImageContent(Source) + nameWithType.vb: ImageContent.New(Source) +- uid: AnthropicClient.Models.ImageContent.#ctor(AnthropicClient.Models.Source,AnthropicClient.Models.CacheControl) + name: ImageContent(Source, CacheControl) + href: api/AnthropicClient.Models.ImageContent.html#AnthropicClient_Models_ImageContent__ctor_AnthropicClient_Models_Source_AnthropicClient_Models_CacheControl_ + commentId: M:AnthropicClient.Models.ImageContent.#ctor(AnthropicClient.Models.Source,AnthropicClient.Models.CacheControl) + name.vb: New(Source, CacheControl) + fullName: AnthropicClient.Models.ImageContent.ImageContent(AnthropicClient.Models.Source, AnthropicClient.Models.CacheControl) + fullName.vb: AnthropicClient.Models.ImageContent.New(AnthropicClient.Models.Source, AnthropicClient.Models.CacheControl) + nameWithType: ImageContent.ImageContent(Source, CacheControl) + nameWithType.vb: ImageContent.New(Source, CacheControl) - uid: AnthropicClient.Models.ImageContent.#ctor(System.String,System.String) name: ImageContent(string, string) href: api/AnthropicClient.Models.ImageContent.html#AnthropicClient_Models_ImageContent__ctor_System_String_System_String_ @@ -4129,12 +4618,24 @@ references: commentId: F:AnthropicClient.Models.SourceType.Content fullName: AnthropicClient.Models.SourceType.Content nameWithType: SourceType.Content +- uid: AnthropicClient.Models.SourceType.File + name: File + href: api/AnthropicClient.Models.SourceType.html#AnthropicClient_Models_SourceType_File + commentId: F:AnthropicClient.Models.SourceType.File + fullName: AnthropicClient.Models.SourceType.File + nameWithType: SourceType.File - uid: AnthropicClient.Models.SourceType.Text name: Text href: api/AnthropicClient.Models.SourceType.html#AnthropicClient_Models_SourceType_Text commentId: F:AnthropicClient.Models.SourceType.Text fullName: AnthropicClient.Models.SourceType.Text nameWithType: SourceType.Text +- uid: AnthropicClient.Models.SourceType.Url + name: Url + href: api/AnthropicClient.Models.SourceType.html#AnthropicClient_Models_SourceType_Url + commentId: F:AnthropicClient.Models.SourceType.Url + fullName: AnthropicClient.Models.SourceType.Url + nameWithType: SourceType.Url - uid: AnthropicClient.Models.SpecificToolChoice name: SpecificToolChoice href: api/AnthropicClient.Models.SpecificToolChoice.html @@ -4990,6 +5491,53 @@ references: isSpec: "True" fullName: AnthropicClient.Models.ToolUseContent.Name nameWithType: ToolUseContent.Name +- uid: AnthropicClient.Models.UrlSource + name: UrlSource + href: api/AnthropicClient.Models.UrlSource.html + commentId: T:AnthropicClient.Models.UrlSource + fullName: AnthropicClient.Models.UrlSource + nameWithType: UrlSource +- uid: AnthropicClient.Models.UrlSource.#ctor + name: UrlSource() + href: api/AnthropicClient.Models.UrlSource.html#AnthropicClient_Models_UrlSource__ctor + commentId: M:AnthropicClient.Models.UrlSource.#ctor + name.vb: New() + fullName: AnthropicClient.Models.UrlSource.UrlSource() + fullName.vb: AnthropicClient.Models.UrlSource.New() + nameWithType: UrlSource.UrlSource() + nameWithType.vb: UrlSource.New() +- uid: AnthropicClient.Models.UrlSource.#ctor(System.String) + name: UrlSource(string) + href: api/AnthropicClient.Models.UrlSource.html#AnthropicClient_Models_UrlSource__ctor_System_String_ + commentId: M:AnthropicClient.Models.UrlSource.#ctor(System.String) + name.vb: New(String) + fullName: AnthropicClient.Models.UrlSource.UrlSource(string) + fullName.vb: AnthropicClient.Models.UrlSource.New(String) + nameWithType: UrlSource.UrlSource(string) + nameWithType.vb: UrlSource.New(String) +- uid: AnthropicClient.Models.UrlSource.#ctor* + name: UrlSource + href: api/AnthropicClient.Models.UrlSource.html#AnthropicClient_Models_UrlSource__ctor_ + commentId: Overload:AnthropicClient.Models.UrlSource.#ctor + isSpec: "True" + name.vb: New + fullName: AnthropicClient.Models.UrlSource.UrlSource + fullName.vb: AnthropicClient.Models.UrlSource.New + nameWithType: UrlSource.UrlSource + nameWithType.vb: UrlSource.New +- uid: AnthropicClient.Models.UrlSource.Url + name: Url + href: api/AnthropicClient.Models.UrlSource.html#AnthropicClient_Models_UrlSource_Url + commentId: P:AnthropicClient.Models.UrlSource.Url + fullName: AnthropicClient.Models.UrlSource.Url + nameWithType: UrlSource.Url +- uid: AnthropicClient.Models.UrlSource.Url* + name: Url + href: api/AnthropicClient.Models.UrlSource.html#AnthropicClient_Models_UrlSource_Url_ + commentId: Overload:AnthropicClient.Models.UrlSource.Url + isSpec: "True" + fullName: AnthropicClient.Models.UrlSource.Url + nameWithType: UrlSource.Url - uid: AnthropicClient.Models.Usage name: Usage href: api/AnthropicClient.Models.Usage.html