Skip to content

MockEmbeddingModelV4

Namespace: Vercel.AI.Testing

public sealed class MockEmbeddingModelV4

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

Inheritance: object

View source

MockEmbeddingModelV4(string, string, int?, int?, bool, IReadOnlyList<MockEmbedResult>?)

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

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

Parameters

Name Type Description
provider string
modelId string
maxEmbeddingsPerCall int?
maxInputBytesPerCall int?
supportsParallelCalls bool
doEmbed IReadOnlyList<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 int? MaxInputBytesPerCall { get; }

Maximum input bytes 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