Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/xAI.Protocol/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public async Task<IEnumerable<LanguageModel>> ListLanguageModelsAsync(Cancellati
}

/// <summary>Lists available embedding models.</summary>
public async Task<IEnumerable<EmbeddingModel>> ListEmbeddingModelsAsync(CancellationToken cancellation)
public async Task<IEnumerable<EmbeddingModel>> ListEmbeddingModelsAsync(CancellationToken cancellation = default)
{
var models = await client.ListEmbeddingModelsAsync(new Empty(), cancellationToken: cancellation);
return models.Models;
Expand Down
15 changes: 15 additions & 0 deletions src/xAI.Tests/SanityChecks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ namespace xAI.Tests;

public class SanityChecks(ITestOutputHelper output)
{
[SecretsFact("CI_XAI_API_KEY")]
public async Task NoEmbeddingModels()
{
var services = new ServiceCollection()
.AddxAIProtocol(Environment.GetEnvironmentVariable("CI_XAI_API_KEY")!)
.BuildServiceProvider();

var client = services.GetRequiredService<Models.ModelsClient>();

var embeddings = await client.ListEmbeddingModelsAsync();

Assert.NotNull(embeddings);
Assert.Empty(embeddings);
}

[SecretsFact("CI_XAI_API_KEY")]
public async Task ListModelsAsync()
{
Expand Down