Table of Contents

Class PerplexityEmbeddingProvider

Namespace
Mythosia.AI.Rag.Embeddings
Assembly
Mythosia.AI.Rag.dll
public sealed class PerplexityEmbeddingProvider : IEmbeddingProvider
Inheritance
PerplexityEmbeddingProvider
Implements
Inherited Members

Constructors

PerplexityEmbeddingProvider(string, HttpClient, string, int?)

public PerplexityEmbeddingProvider(string apiKey, HttpClient httpClient, string model = "pplx-embed-v1-0.6b", int? dimensions = null)

Parameters

apiKey string
httpClient HttpClient
model string
dimensions int?

Properties

Dimensions

public int Dimensions { get; }

Property Value

int

Model

public string Model { get; }

Property Value

string

Methods

GetBinaryEmbeddingAsync(string, CancellationToken)

public Task<PerplexityBinaryEmbedding> GetBinaryEmbeddingAsync(string text, CancellationToken cancellationToken = default)

Parameters

text string
cancellationToken CancellationToken

Returns

Task<PerplexityBinaryEmbedding>

GetBinaryEmbeddingsAsync(IEnumerable<string>, CancellationToken)

public Task<IReadOnlyList<PerplexityBinaryEmbedding>> GetBinaryEmbeddingsAsync(IEnumerable<string> texts, CancellationToken cancellationToken = default)

Parameters

texts IEnumerable<string>
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<PerplexityBinaryEmbedding>>

GetEmbeddingAsync(string, CancellationToken)

public Task<float[]> GetEmbeddingAsync(string text, CancellationToken cancellationToken = default)

Parameters

text string
cancellationToken CancellationToken

Returns

Task<float[]>

GetEmbeddingsAsync(IEnumerable<string>, CancellationToken)

public Task<IReadOnlyList<float[]>> GetEmbeddingsAsync(IEnumerable<string> texts, CancellationToken cancellationToken = default)

Parameters

texts IEnumerable<string>
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<float[]>>