Skip to content

Commit 3a183a1

Browse files
committed
Add package readme, API docs
1 parent 96bd2e2 commit 3a183a1

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

src/GrokClient/Extensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,29 @@
66

77
namespace Devlooped.Grok;
88

9+
/// <summary>
10+
/// Usability extensions for Grok gRPC clients.
11+
/// </summary>
912
[EditorBrowsable(EditorBrowsableState.Never)]
1013
public static class GrpcExtensions
1114
{
1215
extension(Models.ModelsClient client)
1316
{
17+
/// <summary>Lists available language models.</summary>
1418
public async Task<IEnumerable<LanguageModel>> ListLanguageModelsAsync(CancellationToken cancellation = default)
1519
{
1620
var models = await client.ListLanguageModelsAsync(new Empty(), cancellationToken: cancellation);
1721
return models.Models;
1822
}
1923

24+
/// <summary>Lists available embedding models.</summary>
2025
public async Task<IEnumerable<EmbeddingModel>> ListEmbeddingModelsAsync(CancellationToken cancellation)
2126
{
2227
var models = await client.ListEmbeddingModelsAsync(new Empty(), cancellationToken: cancellation);
2328
return models.Models;
2429
}
2530

31+
/// <summary>Lists available image generation models.</summary>
2632
public async Task<IEnumerable<ImageGenerationModel>> ListImageGenerationModelsAsync(CancellationToken cancellation = default)
2733
{
2834
var models = await client.ListImageGenerationModelsAsync(new Empty(), cancellationToken: cancellation);

src/GrokClient/GrokClient.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<AssemblyName>Devlooped.Grok</AssemblyName>
77
<PackageId>GrokClient</PackageId>
88
<Description>Grok gRPC client based on the official protocol buffers from xAI.</Description>
9+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
910
</PropertyGroup>
1011

1112
<ItemGroup>

src/GrokClient/GrokServiceCollectionExtensions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
using System;
2-
using System.Net.Http;
3-
using System.Threading.Tasks;
1+
using System.ComponentModel;
2+
using Devlooped.Grok;
43
using Grpc.Net.ClientFactory;
5-
using Microsoft.Extensions.DependencyInjection;
64

7-
namespace Devlooped.Grok;
5+
namespace Microsoft.Extensions.DependencyInjection;
86

7+
/// <summary>Registration extensions for Grok gRPC clients.</summary>
8+
[EditorBrowsable(EditorBrowsableState.Never)]
99
public static class GrokServiceCollectionExtensions
1010
{
11+
/// <summary>
12+
/// Registers Grok gRPC clients with the specified API key.
13+
/// </summary>
1114
public static IServiceCollection AddGrokClient(this IServiceCollection services, string apiKey,
1215
Action<GrpcClientFactoryOptions>? configureClient = null,
1316
Action<IHttpClientBuilder>? configureHttp = null)

src/GrokClient/readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[![EULA](https://img.shields.io/badge/EULA-OSMF-blue?labelColor=black&color=C9FF30)](osmfeula.txt)
2+
[![OSS](https://img.shields.io/github/license/devlooped/oss.svg?color=blue)](license.txt)
3+
[![GitHub](https://img.shields.io/badge/-source-181717.svg?logo=GitHub)](https://github.com/devlooped/GrokClient)
4+
5+
A full XAI/Grok client based on the official full gRPC API.
6+
7+
<!-- include https://github.com/devlooped/.github/raw/main/osmf.md -->
8+
<!-- include ../../readme.md#content -->
9+
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
10+
<!-- exclude -->

0 commit comments

Comments
 (0)