MockLanguageModelV4
Namespace: Vercel.AI.Testing
public sealed class MockLanguageModelV4Language model v4 test double. Array-backed results are returned in order, starting at the first entry.
Inheritance: object
Constructors
Section titled “Constructors”MockLanguageModelV4(string, string, IReadOnlyList<MockGenerateResult>?, IReadOnlyList<MockStreamResult>?)
Section titled “MockLanguageModelV4(string, string, IReadOnlyList<MockGenerateResult>?, IReadOnlyList<MockStreamResult>?)”public MockLanguageModelV4(string provider = "mock-provider", string modelId = "mock-model-id", IReadOnlyList<MockGenerateResult>? doGenerate = null, IReadOnlyList<MockStreamResult>? doStream = null)Creates a model. List results are consumed from the first entry.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
string | |
modelId |
string | |
doGenerate |
IReadOnlyList<MockGenerateResult> | |
doStream |
IReadOnlyList<MockStreamResult> |
Properties
Section titled “Properties”DoGenerateCalls
Section titled “DoGenerateCalls”public List<MockLanguageModelCallOptions> DoGenerateCalls { get; }Generate calls in order.
Value: List<MockLanguageModelCallOptions>
DoStreamCalls
Section titled “DoStreamCalls”public List<MockLanguageModelCallOptions> DoStreamCalls { get; }Stream calls in order.
Value: List<MockLanguageModelCallOptions>
ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version.
Value: string
Methods
Section titled “Methods”DoGenerateAsync(MockLanguageModelCallOptions)
Section titled “DoGenerateAsync(MockLanguageModelCallOptions)”public Task<MockGenerateResult> DoGenerateAsync(MockLanguageModelCallOptions options)Returns the next scripted generate result.
Parameters
| Name | Type | Description |
|---|---|---|
options |
MockLanguageModelCallOptions |
Returns: Task<MockGenerateResult>
DoStreamAsync(MockLanguageModelCallOptions)
Section titled “DoStreamAsync(MockLanguageModelCallOptions)”public Task<MockStreamResult> DoStreamAsync(MockLanguageModelCallOptions options)Returns the next scripted stream result.
Parameters
| Name | Type | Description |
|---|---|---|
options |
MockLanguageModelCallOptions |
Returns: Task<MockStreamResult>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product