using AnthropicClient.Models; namespace AnthropicClient; /// /// Represents a client for interacting with the Anthropic API. /// public interface IAnthropicApiClient { /// /// Creates a message asynchronously. /// /// The message request to create. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an . Task> CreateMessageAsync(MessageRequest request, CancellationToken cancellationToken = default); /// /// Creates a message asynchronously and streams the response. /// /// The message request to create. /// A token to cancel the asynchronous operation. /// An asynchronous enumerable that yields the response event by event. IAsyncEnumerable CreateMessageAsync(StreamMessageRequest request, CancellationToken cancellationToken = default); /// /// Creates a batch of messages asynchronously. /// /// The message batch request to create. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> CreateMessageBatchAsync(MessageBatchRequest request, CancellationToken cancellationToken = default); /// /// Gets a message batch asynchronously. /// /// The ID of the message batch to get. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> GetMessageBatchAsync(string batchId, CancellationToken cancellationToken = default); /// /// Lists the message batches asynchronously. /// /// The paging request to use for listing the message batches. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is where T is . Task>> ListMessageBatchesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default); /// /// Lists all message batches asynchronously. /// /// The maximum number of message batches to return in each page. /// A token to cancel the asynchronous operation. /// An asynchronous enumerable that yields the response as an where T is where T is . IAsyncEnumerable>> ListAllMessageBatchesAsync(int limit = 20, CancellationToken cancellationToken = default); /// /// Cancels a message batch asynchronously. /// /// The ID of the message batch to cancel. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> CancelMessageBatchAsync(string batchId, CancellationToken cancellationToken = default); /// /// Deletes a message batch asynchronously. /// /// The ID of the message batch to delete. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> DeleteMessageBatchAsync(string batchId, CancellationToken cancellationToken = default); /// /// Gets the results of a message batch asynchronously. /// /// The ID of the message batch to get the results for. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is where T is . Task>> GetMessageBatchResultsAsync(string batchId, CancellationToken cancellationToken = default); /// /// Counts the tokens in a message asynchronously. /// /// The count message tokens request. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> CountMessageTokensAsync(CountMessageTokensRequest request, CancellationToken cancellationToken = default); /// /// Lists models asynchronously, returning a single page of results. /// /// The paging request to use for listing the models. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is where T is . Task>> ListModelsAsync(PagingRequest? request = null, CancellationToken cancellationToken = default); /// /// Lists all models asynchronously, returning every page of results. /// /// The maximum number of models to return in each page. /// A token to cancel the asynchronous operation. /// An asynchronous enumerable that yields the response as an where T is where T is . /// IAsyncEnumerable>> ListAllModelsAsync(int limit = 20, CancellationToken cancellationToken = default); /// /// Gets a model by its ID asynchronously. /// /// The ID of the model to get. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> GetModelAsync(string modelId, CancellationToken cancellationToken = default); /// /// Creates a file asynchronously using the Files API. /// /// The file creation request. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> CreateFileAsync(CreateFileRequest request, CancellationToken cancellationToken = default); /// /// Lists files asynchronously, returning a single page of results. /// /// The paging request to use for listing the files. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is where T is . Task>> ListFilesAsync(PagingRequest? request = null, CancellationToken cancellationToken = default); /// /// Lists all files asynchronously, returning every page of results. /// /// The maximum number of files to return in each page. /// A token to cancel the asynchronous operation. /// An asynchronous enumerable that yields the response as an where T is where T is . IAsyncEnumerable>> ListAllFilesAsync(int limit = 20, CancellationToken cancellationToken = default); /// /// Gets a file's metadata by its ID asynchronously. /// /// The ID of the file to get. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> GetFileInfoAsync(string fileId, CancellationToken cancellationToken = default); /// /// Gets a file's content by its ID asynchronously. /// /// The ID of the file to get the content for. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is a stream containing the file content. Task> GetFileAsync(string fileId, CancellationToken cancellationToken = default); /// /// Deletes a file by its ID asynchronously. /// /// The ID of the file to delete. /// A token to cancel the asynchronous operation. /// A task that represents the asynchronous operation. The task result contains the response as an where T is . Task> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default); }