feat: implement GetMessageBatchAsync method

This commit is contained in:
Stevan Freeborn
2025-01-08 23:15:24 -06:00
parent f8e01bf487
commit c5f3c5eca5
4 changed files with 172 additions and 1 deletions
@@ -361,4 +361,25 @@ public class ClientTests(ConfigurationFixture configFixture) : EndToEndTest(conf
result.Value.Should().BeOfType<MessageBatchResponse>();
result.Value.Id.Should().NotBeNullOrEmpty();
}
[Fact]
public async Task GetMessageBatchAsync_WhenCalled_ItShouldReturnResponse()
{
var request = new MessageBatchRequest([
new(
Guid.NewGuid().ToString(),
new(
model: AnthropicModels.Claude3Haiku,
messages: [new(MessageRole.User, [new TextContent("Hello!")])]
)
),
]);
var createResult = await _client.CreateMessageBatchAsync(request);
var getResult = await _client.GetMessageBatchAsync(createResult.Value.Id);
getResult.IsSuccess.Should().BeTrue();
getResult.Value.Should().BeOfType<MessageBatchResponse>();
getResult.Value.Id.Should().Be(createResult.Value.Id);
}
}