feat: implement CreateMessageBatchAsync method

This commit is contained in:
Stevan Freeborn
2025-01-08 20:37:58 -06:00
parent fe39f10382
commit 9548754d6c
9 changed files with 487 additions and 1 deletions
@@ -0,0 +1,28 @@
namespace AnthropicClient.Models;
/// <summary>
/// Represents a request to create a batch of messages.
/// </summary>
public class MessageBatchRequest
{
/// <summary>
/// Gets the requests to create messages.
/// </summary>
public List<MessageBatchRequestItem> Requests { get; init; } = [];
/// <summary>
/// Initializes a new instance of the <see cref="MessageBatchRequest"/> class.
/// </summary>
/// <param name="requests">The requests to create messages.</param>
/// <exception cref="ArgumentException">Thrown when <paramref name="requests"/> is empty.</exception>
/// <returns>An instance of the <see cref="MessageBatchRequest"/> class.</returns>
public MessageBatchRequest(List<MessageBatchRequestItem> requests)
{
if (requests.Count == 0)
{
throw new ArgumentException($"{nameof(requests)} must not be empty.", nameof(requests));
}
Requests = requests;
}
}