Table of Contents

Interface IClientFactoryService

Namespace
FoundationaLLM.Common.Interfaces
Assembly
FoundationaLLM.Common.dll

Defines a service for creating client instances used to process requests and responses.

public interface IClientFactoryService
Extension Methods

Methods

CreateClient<T>(string, string, UnifiedUserIdentity, Func<Dictionary<string, object>, T>, Dictionary<string, object>?)

Creates a T client instance based on the client name and a client builder delegate.

Task<T> CreateClient<T>(string instanceId, string clientName, UnifiedUserIdentity userIdentity, Func<Dictionary<string, object>, T> clientBuilder, Dictionary<string, object>? clientBuilderParameters = null)

Parameters

instanceId string

The FoundationaLLM instance identifier.

clientName string

The name of the HTTP client to create. This name must be registered as an APIEndpointConfiguration resource in the FoundationaLLM.Configuration resource provider.

userIdentity UnifiedUserIdentity

The UnifiedUserIdentity of the caller requesting the client.

clientBuilder Func<Dictionary<string, object>, T>

A delegate that creates the T client instance based on a dictionary of values. The keys available in the dictionary are defined in HttpClientFactoryServiceKeyNames.

clientBuilderParameters Dictionary<string, object>

A dictionary of parameters to pass to the client builder delegate.

Returns

Task<T>

A T client instance.

Type Parameters

T

The type of the client to create.