feat: implement ListAllModelsAsync and ListModelsAsync

This commit is contained in:
Stevan Freeborn
2025-01-05 21:20:27 -06:00
parent 9d341011df
commit 8e0443a6bb
7 changed files with 507 additions and 43 deletions
@@ -303,4 +303,32 @@ public class ClientTests(ConfigurationFixture configFixture) : EndToEndTest(conf
result.Value.Should().BeOfType<TokenCountResponse>();
result.Value.InputTokens.Should().BeGreaterThan(0);
}
[Fact]
public async Task ListModelsAsync_WhenCalled_ItShouldReturnResponse()
{
var result = await _client.ListModelsAsync();
result.IsSuccess.Should().BeTrue();
result.Value.Should().BeOfType<Page<AnthropicModel>>();
result.Value.Data.Should().HaveCountGreaterThan(0);
}
[Fact]
public async Task ListModelsAsync_WhenCalledWithPagination_ItShouldReturnResponse()
{
var result = await _client.ListModelsAsync(new PagingRequest(limit: 1));
result.IsSuccess.Should().BeTrue();
result.Value.Should().BeOfType<Page<AnthropicModel>>();
result.Value.Data.Should().HaveCount(1);
}
[Fact]
public async Task ListAllModelsAsync_WhenCalled_ItShouldReturnResponse()
{
var responses = await _client.ListAllModelsAsync(limit: 1).ToListAsync();
responses.Should().HaveCountGreaterThan(0);
}
}