Skip to content

Commit 3550d97

Browse files
committed
Rename extension method to add xAI protocol clients
Since they are not strictly Grok-specific.
1 parent cd7e2c6 commit 3550d97

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/xAI.Protocol/GrokServiceCollectionExtensions.cs renamed to src/xAI.Protocol/ProtocolServiceCollectionExtensions.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44

55
namespace Microsoft.Extensions.DependencyInjection;
66

7-
/// <summary>Registration extensions for Grok gRPC clients.</summary>
7+
/// <summary>Registration extensions for xAI gRPC clients.</summary>
88
[EditorBrowsable(EditorBrowsableState.Never)]
9-
public static class GrokServiceCollectionExtensions
9+
public static class ProtocolServiceCollectionExtensions
1010
{
1111
/// <summary>
12-
/// Registers Grok gRPC clients with the specified API key.
12+
/// Registers xAI gRPC protocol clients with the specified API key.
1313
/// </summary>
14-
public static IServiceCollection AddGrokClient(this IServiceCollection services, string apiKey,
14+
public static IServiceCollection AddxAIProtocol(this IServiceCollection services, string apiKey,
1515
Action<GrpcClientFactoryOptions>? configureClient = null,
1616
Action<IHttpClientBuilder>? configureHttp = null)
1717
{
1818
var address = new Uri("https://api.x.ai/");
19-
2019
var builder = services.AddGrpcClient<Auth.AuthClient>(options =>
2120
{
2221
options.Address = address;

src/xAI.Tests/SanityChecks.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class SanityChecks(ITestOutputHelper output)
1111
public async Task ListModelsAsync()
1212
{
1313
var services = new ServiceCollection()
14-
.AddGrokClient(Environment.GetEnvironmentVariable("XAI_API_KEY")!)
14+
.AddxAIProtocol(Environment.GetEnvironmentVariable("XAI_API_KEY")!)
1515
.BuildServiceProvider();
1616

1717
var client = services.GetRequiredService<Models.ModelsClient>();
@@ -28,7 +28,7 @@ public async Task ListModelsAsync()
2828
public async Task ExecuteLocalFunctionWithWebSearch()
2929
{
3030
var services = new ServiceCollection()
31-
.AddGrokClient(Environment.GetEnvironmentVariable("XAI_API_KEY")!)
31+
.AddxAIProtocol(Environment.GetEnvironmentVariable("XAI_API_KEY")!)
3232
.BuildServiceProvider();
3333

3434
var client = services.GetRequiredService<Chat.ChatClient>();

0 commit comments

Comments
 (0)