File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed
Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 66
77namespace Devlooped . Grok ;
88
9+ /// <summary>
10+ /// Usability extensions for Grok gRPC clients.
11+ /// </summary>
912[ EditorBrowsable ( EditorBrowsableState . Never ) ]
1013public 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 ) ;
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Net . Http ;
3- using System . Threading . Tasks ;
1+ using System . ComponentModel ;
2+ using Devlooped . Grok ;
43using 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 ) ]
99public 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 )
Original file line number Diff line number Diff line change 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 -->
You can’t perform that action at this time.
0 commit comments