Class LLMEmbeddingClient
Provides methods for generating embeddings using language models.
Namespace: Workspace.XBR.Xperiflow.LanguageModels
Assembly: Xperiflow.dll
public class LLMEmbeddingClient
Methods
GenerateEmbeddingsAsync(string, List<string>, CancellationToken)
Generates embeddings for the specified text inputs using the given model.
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
Type | Name | Description |
---|---|---|
System.String | modelName | The name of the embedding model to use. |
System.Collections.Generic.List<System.String> | inputTexts | A list of texts to generate embeddings for. |
System.Threading.CancellationToken | cancellationToken | A 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.
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
Type | Name | Description |
---|---|---|
System.String | modelName | The name of the embedding model to use. |
System.String | inputText | The text to generate an embedding for. |
System.Threading.CancellationToken | cancellationToken | A 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