Skip to content

MockEmbeddingModelV3

Namespace: Vercel.AI.Testing

public sealed class MockEmbeddingModelV3

Embedding model v3 test double. Array-backed results are returned in order, starting at the first entry.

Inheritance: object

View source

MockEmbeddingModelV3(string, string, int?, bool, IReadOnlyList<MockEmbedResult>?, Func<MockEmbedOptions?, Task<MockEmbedResult>>?)

Section titled “MockEmbeddingModelV3(string, string, int?, bool, IReadOnlyList<MockEmbedResult>?, Func<MockEmbedOptions?, Task<MockEmbedResult>>?)”
public MockEmbeddingModelV3(string provider = "mock-provider", string modelId = "mock-model-id", int? maxEmbeddingsPerCall = 1, bool supportsParallelCalls = false, IReadOnlyList<MockEmbedResult>? doEmbed = null, Func<MockEmbedOptions?, Task<MockEmbedResult>>? embed = null)

Creates a model. List results are consumed from the first entry.

Parameters

Name Type Description
provider string
modelId string
maxEmbeddingsPerCall int?
supportsParallelCalls bool
doEmbed IReadOnlyList<MockEmbedResult>
embed Func<MockEmbedOptions, Task<MockEmbedResult>>

View source

public List<MockEmbedOptions> DoEmbedCalls { get; }

Embed calls in order.

Value: List<MockEmbedOptions>

View source

public int? MaxEmbeddingsPerCall { get; }

Maximum embeddings per call.

Value: int?

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

public string SpecificationVersion { get; }

Specification version.

Value: string

View source

public bool SupportsParallelCalls { get; }

Whether calls may run in parallel.

Value: bool

View source

public Task<MockEmbedResult> DoEmbedAsync(MockEmbedOptions? options)

Returns the next scripted embed result.

Parameters

Name Type Description
options MockEmbedOptions

Returns: Task<MockEmbedResult>

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product