Skip to main content

Class LLMEmbeddingClient

Provides methods for generating embeddings using language models.

Namespace: Workspace.XBR.Xperiflow.LanguageModels

Assembly: Xperiflow.dll

Declaration
public class LLMEmbeddingClient

Methods

GenerateEmbeddingsAsync(string, List<string>, CancellationToken)

Generates embeddings for the specified text inputs using the given model.

Declaration
public Task<IEnumerable<IEnumerable<float>>> GenerateEmbeddingsAsync(string modelName, List<string> inputTexts, CancellationToken cancellationToken = default)
Returns

Task<System.Collections.Generic.IEnumerable{System.Collections.Generic.IEnumerable{System.Single}}>

A list of embeddings corresponding to the input texts.

Parameters
TypeNameDescription
System.StringmodelNameThe name of the embedding model to use.
System.Collections.Generic.List<System.String>inputTextsA list of texts to generate embeddings for.
System.Threading.CancellationTokencancellationTokenA token to monitor for cancellation requests. Optional.
Exceptions

System.ArgumentException Thrown when input texts are null or empty. System.NotSupportedException Thrown if the specified model is not supported. Workspace.XBR.Xperiflow.LanguageModels.LlmEmbeddingClientException Thrown when an error occurs during the request to the embedding service. OneStream.Shared.Common.XFException Thrown when an exception occurs during execution.

GenerateEmbeddingAsync(string, string, CancellationToken)

Generates an embedding for a single text input using the specified model.

Declaration
public Task<IEnumerable<float>> GenerateEmbeddingAsync(string modelName, string inputText, CancellationToken cancellationToken = default)
Returns

Task<System.Collections.Generic.IEnumerable{System.Single}>

The embedding for the input text as an array of floats.

Parameters
TypeNameDescription
System.StringmodelNameThe name of the embedding model to use.
System.StringinputTextThe text to generate an embedding for.
System.Threading.CancellationTokencancellationTokenA token to monitor for cancellation requests. Optional.
Exceptions

System.ArgumentException Thrown when the input text is null or empty. System.NotSupportedException Thrown if the specified model is not supported. Workspace.XBR.Xperiflow.LanguageModels.LlmEmbeddingClientException Thrown when an error occurs during the request to the embedding service. OneStream.Shared.Common.XFException Thrown when an exception occurs during execution.

Inherited Members

  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object,System.Object)
  • System.Object.GetHashCode
  • System.Object.GetType
  • System.Object.MemberwiseClone
  • System.Object.ReferenceEquals(System.Object,System.Object)
  • System.Object.ToString

Was this page helpful?