@ai-sdk/provider 2.1.0-beta.1 → 2.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.d.mts +209 -2
- package/dist/index.d.ts +209 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
@@ -485,6 +485,158 @@ declare function isJSONValue(value: unknown): value is JSONValue;
|
|
485
485
|
declare function isJSONArray(value: unknown): value is JSONArray;
|
486
486
|
declare function isJSONObject(value: unknown): value is JSONObject;
|
487
487
|
|
488
|
+
type ImageModelV3CallOptions = {
|
489
|
+
/**
|
490
|
+
Prompt for the image generation.
|
491
|
+
*/
|
492
|
+
prompt: string;
|
493
|
+
/**
|
494
|
+
Number of images to generate.
|
495
|
+
*/
|
496
|
+
n: number;
|
497
|
+
/**
|
498
|
+
Size of the images to generate.
|
499
|
+
Must have the format `{width}x{height}`.
|
500
|
+
`undefined` will use the provider's default size.
|
501
|
+
*/
|
502
|
+
size: `${number}x${number}` | undefined;
|
503
|
+
/**
|
504
|
+
Aspect ratio of the images to generate.
|
505
|
+
Must have the format `{width}:{height}`.
|
506
|
+
`undefined` will use the provider's default aspect ratio.
|
507
|
+
*/
|
508
|
+
aspectRatio: `${number}:${number}` | undefined;
|
509
|
+
/**
|
510
|
+
Seed for the image generation.
|
511
|
+
`undefined` will use the provider's default seed.
|
512
|
+
*/
|
513
|
+
seed: number | undefined;
|
514
|
+
/**
|
515
|
+
Additional provider-specific options that are passed through to the provider
|
516
|
+
as body parameters.
|
517
|
+
|
518
|
+
The outer record is keyed by the provider name, and the inner
|
519
|
+
record is keyed by the provider-specific metadata key.
|
520
|
+
```ts
|
521
|
+
{
|
522
|
+
"openai": {
|
523
|
+
"style": "vivid"
|
524
|
+
}
|
525
|
+
}
|
526
|
+
```
|
527
|
+
*/
|
528
|
+
providerOptions: SharedV2ProviderOptions;
|
529
|
+
/**
|
530
|
+
Abort signal for cancelling the operation.
|
531
|
+
*/
|
532
|
+
abortSignal?: AbortSignal;
|
533
|
+
/**
|
534
|
+
Additional HTTP headers to be sent with the request.
|
535
|
+
Only applicable for HTTP-based providers.
|
536
|
+
*/
|
537
|
+
headers?: Record<string, string | undefined>;
|
538
|
+
};
|
539
|
+
|
540
|
+
/**
|
541
|
+
Warning from the model provider for this call. The call will proceed, but e.g.
|
542
|
+
some settings might not be supported, which can lead to suboptimal results.
|
543
|
+
*/
|
544
|
+
type ImageModelV3CallWarning = {
|
545
|
+
type: 'unsupported-setting';
|
546
|
+
setting: keyof ImageModelV3CallOptions;
|
547
|
+
details?: string;
|
548
|
+
} | {
|
549
|
+
type: 'other';
|
550
|
+
message: string;
|
551
|
+
};
|
552
|
+
|
553
|
+
type ImageModelV3ProviderMetadata = Record<string, {
|
554
|
+
images: JSONArray;
|
555
|
+
} & JSONValue>;
|
556
|
+
type GetMaxImagesPerCallFunction$1 = (options: {
|
557
|
+
modelId: string;
|
558
|
+
}) => PromiseLike<number | undefined> | number | undefined;
|
559
|
+
/**
|
560
|
+
Image generation model specification version 3.
|
561
|
+
*/
|
562
|
+
type ImageModelV3 = {
|
563
|
+
/**
|
564
|
+
The image model must specify which image model interface
|
565
|
+
version it implements. This will allow us to evolve the image
|
566
|
+
model interface and retain backwards compatibility. The different
|
567
|
+
implementation versions can be handled as a discriminated union
|
568
|
+
on our side.
|
569
|
+
*/
|
570
|
+
readonly specificationVersion: 'v3';
|
571
|
+
/**
|
572
|
+
Name of the provider for logging purposes.
|
573
|
+
*/
|
574
|
+
readonly provider: string;
|
575
|
+
/**
|
576
|
+
Provider-specific model ID for logging purposes.
|
577
|
+
*/
|
578
|
+
readonly modelId: string;
|
579
|
+
/**
|
580
|
+
Limit of how many images can be generated in a single API call.
|
581
|
+
Can be set to a number for a fixed limit, to undefined to use
|
582
|
+
the global limit, or a function that returns a number or undefined,
|
583
|
+
optionally as a promise.
|
584
|
+
*/
|
585
|
+
readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$1;
|
586
|
+
/**
|
587
|
+
Generates an array of images.
|
588
|
+
*/
|
589
|
+
doGenerate(options: ImageModelV3CallOptions): PromiseLike<{
|
590
|
+
/**
|
591
|
+
Generated images as base64 encoded strings or binary data.
|
592
|
+
The images should be returned without any unnecessary conversion.
|
593
|
+
If the API returns base64 encoded strings, the images should be returned
|
594
|
+
as base64 encoded strings. If the API returns binary data, the images should
|
595
|
+
be returned as binary data.
|
596
|
+
*/
|
597
|
+
images: Array<string> | Array<Uint8Array>;
|
598
|
+
/**
|
599
|
+
Warnings for the call, e.g. unsupported settings.
|
600
|
+
*/
|
601
|
+
warnings: Array<ImageModelV3CallWarning>;
|
602
|
+
/**
|
603
|
+
Additional provider-specific metadata. They are passed through
|
604
|
+
from the provider to the AI SDK and enable provider-specific
|
605
|
+
results that can be fully encapsulated in the provider.
|
606
|
+
|
607
|
+
The outer record is keyed by the provider name, and the inner
|
608
|
+
record is provider-specific metadata. It always includes an
|
609
|
+
`images` key with image-specific metadata
|
610
|
+
|
611
|
+
```ts
|
612
|
+
{
|
613
|
+
"openai": {
|
614
|
+
"images": ["revisedPrompt": "Revised prompt here."]
|
615
|
+
}
|
616
|
+
}
|
617
|
+
```
|
618
|
+
*/
|
619
|
+
providerMetadata?: ImageModelV3ProviderMetadata;
|
620
|
+
/**
|
621
|
+
Response information for telemetry and debugging purposes.
|
622
|
+
*/
|
623
|
+
response: {
|
624
|
+
/**
|
625
|
+
Timestamp for the start of the generated response.
|
626
|
+
*/
|
627
|
+
timestamp: Date;
|
628
|
+
/**
|
629
|
+
The ID of the response model that was used to generate the response.
|
630
|
+
*/
|
631
|
+
modelId: string;
|
632
|
+
/**
|
633
|
+
Response headers.
|
634
|
+
*/
|
635
|
+
headers: Record<string, string> | undefined;
|
636
|
+
};
|
637
|
+
}>;
|
638
|
+
};
|
639
|
+
|
488
640
|
type ImageModelV2CallOptions = {
|
489
641
|
/**
|
490
642
|
Prompt for the image generation.
|
@@ -1770,7 +1922,7 @@ type TranscriptionModelV2 = {
|
|
1770
1922
|
/**
|
1771
1923
|
* Provider for language, text embedding, and image generation models.
|
1772
1924
|
*/
|
1773
|
-
interface
|
1925
|
+
interface ProviderV3 {
|
1774
1926
|
/**
|
1775
1927
|
Returns the language model with the given id.
|
1776
1928
|
The model id is then passed to the provider function to get the model.
|
@@ -1799,6 +1951,61 @@ interface ProviderV2 {
|
|
1799
1951
|
|
1800
1952
|
@param {string} modelId - The id of the model to return.
|
1801
1953
|
|
1954
|
+
@returns {ImageModel} The image model associated with the id
|
1955
|
+
*/
|
1956
|
+
imageModel(modelId: string): ImageModelV3;
|
1957
|
+
/**
|
1958
|
+
Returns the transcription model with the given id.
|
1959
|
+
The model id is then passed to the provider function to get the model.
|
1960
|
+
|
1961
|
+
@param {string} modelId - The id of the model to return.
|
1962
|
+
|
1963
|
+
@returns {TranscriptionModel} The transcription model associated with the id
|
1964
|
+
*/
|
1965
|
+
transcriptionModel?(modelId: string): TranscriptionModelV2;
|
1966
|
+
/**
|
1967
|
+
Returns the speech model with the given id.
|
1968
|
+
The model id is then passed to the provider function to get the model.
|
1969
|
+
|
1970
|
+
@param {string} modelId - The id of the model to return.
|
1971
|
+
|
1972
|
+
@returns {SpeechModel} The speech model associated with the id
|
1973
|
+
*/
|
1974
|
+
speechModel?(modelId: string): SpeechModelV2;
|
1975
|
+
}
|
1976
|
+
|
1977
|
+
/**
|
1978
|
+
* Provider for language, text embedding, and image generation models.
|
1979
|
+
*/
|
1980
|
+
interface ProviderV2 {
|
1981
|
+
/**
|
1982
|
+
Returns the language model with the given id.
|
1983
|
+
The model id is then passed to the provider function to get the model.
|
1984
|
+
|
1985
|
+
@param {string} modelId - The id of the model to return.
|
1986
|
+
|
1987
|
+
@returns {LanguageModel} The language model associated with the id
|
1988
|
+
|
1989
|
+
@throws {NoSuchModelError} If no such model exists.
|
1990
|
+
*/
|
1991
|
+
languageModel(modelId: string): LanguageModelV2;
|
1992
|
+
/**
|
1993
|
+
Returns the text embedding model with the given id.
|
1994
|
+
The model id is then passed to the provider function to get the model.
|
1995
|
+
|
1996
|
+
@param {string} modelId - The id of the model to return.
|
1997
|
+
|
1998
|
+
@returns {LanguageModel} The language model associated with the id
|
1999
|
+
|
2000
|
+
@throws {NoSuchModelError} If no such model exists.
|
2001
|
+
*/
|
2002
|
+
textEmbeddingModel(modelId: string): EmbeddingModelV2<string>;
|
2003
|
+
/**
|
2004
|
+
Returns the image model with the given id.
|
2005
|
+
The model id is then passed to the provider function to get the model.
|
2006
|
+
|
2007
|
+
@param {string} modelId - The id of the model to return.
|
2008
|
+
|
1802
2009
|
@returns {ImageModel} The image model associated with the id
|
1803
2010
|
*/
|
1804
2011
|
imageModel(modelId: string): ImageModelV2;
|
@@ -1822,4 +2029,4 @@ interface ProviderV2 {
|
|
1822
2029
|
speechModel?(modelId: string): SpeechModelV2;
|
1823
2030
|
}
|
1824
2031
|
|
1825
|
-
export { AISDKError, APICallError, type EmbeddingModelV2, type EmbeddingModelV2Embedding, type EmbeddingModelV3, type EmbeddingModelV3Embedding, EmptyResponseBodyError, type ImageModelV2, type ImageModelV2CallOptions, type ImageModelV2CallWarning, type ImageModelV2ProviderMetadata, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV2, type LanguageModelV2CallOptions, type LanguageModelV2CallWarning, type LanguageModelV2Content, type LanguageModelV2DataContent, type LanguageModelV2File, type LanguageModelV2FilePart, type LanguageModelV2FinishReason, type LanguageModelV2FunctionTool, type LanguageModelV2Message, type LanguageModelV2Middleware, type LanguageModelV2Prompt, type LanguageModelV2ProviderDefinedTool, type LanguageModelV2Reasoning, type LanguageModelV2ReasoningPart, type LanguageModelV2ResponseMetadata, type LanguageModelV2Source, type LanguageModelV2StreamPart, type LanguageModelV2Text, type LanguageModelV2TextPart, type LanguageModelV2ToolCall, type LanguageModelV2ToolCallPart, type LanguageModelV2ToolChoice, type LanguageModelV2ToolResultOutput, type LanguageModelV2ToolResultPart, type LanguageModelV2Usage, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV2, type SharedV2Headers, type SharedV2ProviderMetadata, type SharedV2ProviderOptions, type SpeechModelV2, type SpeechModelV2CallOptions, type SpeechModelV2CallWarning, TooManyEmbeddingValuesForCallError, type TranscriptionModelV2, type TranscriptionModelV2CallOptions, type TranscriptionModelV2CallWarning, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
|
2032
|
+
export { AISDKError, APICallError, type EmbeddingModelV2, type EmbeddingModelV2Embedding, type EmbeddingModelV3, type EmbeddingModelV3Embedding, EmptyResponseBodyError, type ImageModelV2, type ImageModelV2CallOptions, type ImageModelV2CallWarning, type ImageModelV2ProviderMetadata, type ImageModelV3, type ImageModelV3CallOptions, type ImageModelV3CallWarning, type ImageModelV3ProviderMetadata, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV2, type LanguageModelV2CallOptions, type LanguageModelV2CallWarning, type LanguageModelV2Content, type LanguageModelV2DataContent, type LanguageModelV2File, type LanguageModelV2FilePart, type LanguageModelV2FinishReason, type LanguageModelV2FunctionTool, type LanguageModelV2Message, type LanguageModelV2Middleware, type LanguageModelV2Prompt, type LanguageModelV2ProviderDefinedTool, type LanguageModelV2Reasoning, type LanguageModelV2ReasoningPart, type LanguageModelV2ResponseMetadata, type LanguageModelV2Source, type LanguageModelV2StreamPart, type LanguageModelV2Text, type LanguageModelV2TextPart, type LanguageModelV2ToolCall, type LanguageModelV2ToolCallPart, type LanguageModelV2ToolChoice, type LanguageModelV2ToolResultOutput, type LanguageModelV2ToolResultPart, type LanguageModelV2Usage, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV2, type ProviderV3, type SharedV2Headers, type SharedV2ProviderMetadata, type SharedV2ProviderOptions, type SpeechModelV2, type SpeechModelV2CallOptions, type SpeechModelV2CallWarning, TooManyEmbeddingValuesForCallError, type TranscriptionModelV2, type TranscriptionModelV2CallOptions, type TranscriptionModelV2CallWarning, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
|
package/dist/index.d.ts
CHANGED
@@ -485,6 +485,158 @@ declare function isJSONValue(value: unknown): value is JSONValue;
|
|
485
485
|
declare function isJSONArray(value: unknown): value is JSONArray;
|
486
486
|
declare function isJSONObject(value: unknown): value is JSONObject;
|
487
487
|
|
488
|
+
type ImageModelV3CallOptions = {
|
489
|
+
/**
|
490
|
+
Prompt for the image generation.
|
491
|
+
*/
|
492
|
+
prompt: string;
|
493
|
+
/**
|
494
|
+
Number of images to generate.
|
495
|
+
*/
|
496
|
+
n: number;
|
497
|
+
/**
|
498
|
+
Size of the images to generate.
|
499
|
+
Must have the format `{width}x{height}`.
|
500
|
+
`undefined` will use the provider's default size.
|
501
|
+
*/
|
502
|
+
size: `${number}x${number}` | undefined;
|
503
|
+
/**
|
504
|
+
Aspect ratio of the images to generate.
|
505
|
+
Must have the format `{width}:{height}`.
|
506
|
+
`undefined` will use the provider's default aspect ratio.
|
507
|
+
*/
|
508
|
+
aspectRatio: `${number}:${number}` | undefined;
|
509
|
+
/**
|
510
|
+
Seed for the image generation.
|
511
|
+
`undefined` will use the provider's default seed.
|
512
|
+
*/
|
513
|
+
seed: number | undefined;
|
514
|
+
/**
|
515
|
+
Additional provider-specific options that are passed through to the provider
|
516
|
+
as body parameters.
|
517
|
+
|
518
|
+
The outer record is keyed by the provider name, and the inner
|
519
|
+
record is keyed by the provider-specific metadata key.
|
520
|
+
```ts
|
521
|
+
{
|
522
|
+
"openai": {
|
523
|
+
"style": "vivid"
|
524
|
+
}
|
525
|
+
}
|
526
|
+
```
|
527
|
+
*/
|
528
|
+
providerOptions: SharedV2ProviderOptions;
|
529
|
+
/**
|
530
|
+
Abort signal for cancelling the operation.
|
531
|
+
*/
|
532
|
+
abortSignal?: AbortSignal;
|
533
|
+
/**
|
534
|
+
Additional HTTP headers to be sent with the request.
|
535
|
+
Only applicable for HTTP-based providers.
|
536
|
+
*/
|
537
|
+
headers?: Record<string, string | undefined>;
|
538
|
+
};
|
539
|
+
|
540
|
+
/**
|
541
|
+
Warning from the model provider for this call. The call will proceed, but e.g.
|
542
|
+
some settings might not be supported, which can lead to suboptimal results.
|
543
|
+
*/
|
544
|
+
type ImageModelV3CallWarning = {
|
545
|
+
type: 'unsupported-setting';
|
546
|
+
setting: keyof ImageModelV3CallOptions;
|
547
|
+
details?: string;
|
548
|
+
} | {
|
549
|
+
type: 'other';
|
550
|
+
message: string;
|
551
|
+
};
|
552
|
+
|
553
|
+
type ImageModelV3ProviderMetadata = Record<string, {
|
554
|
+
images: JSONArray;
|
555
|
+
} & JSONValue>;
|
556
|
+
type GetMaxImagesPerCallFunction$1 = (options: {
|
557
|
+
modelId: string;
|
558
|
+
}) => PromiseLike<number | undefined> | number | undefined;
|
559
|
+
/**
|
560
|
+
Image generation model specification version 3.
|
561
|
+
*/
|
562
|
+
type ImageModelV3 = {
|
563
|
+
/**
|
564
|
+
The image model must specify which image model interface
|
565
|
+
version it implements. This will allow us to evolve the image
|
566
|
+
model interface and retain backwards compatibility. The different
|
567
|
+
implementation versions can be handled as a discriminated union
|
568
|
+
on our side.
|
569
|
+
*/
|
570
|
+
readonly specificationVersion: 'v3';
|
571
|
+
/**
|
572
|
+
Name of the provider for logging purposes.
|
573
|
+
*/
|
574
|
+
readonly provider: string;
|
575
|
+
/**
|
576
|
+
Provider-specific model ID for logging purposes.
|
577
|
+
*/
|
578
|
+
readonly modelId: string;
|
579
|
+
/**
|
580
|
+
Limit of how many images can be generated in a single API call.
|
581
|
+
Can be set to a number for a fixed limit, to undefined to use
|
582
|
+
the global limit, or a function that returns a number or undefined,
|
583
|
+
optionally as a promise.
|
584
|
+
*/
|
585
|
+
readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$1;
|
586
|
+
/**
|
587
|
+
Generates an array of images.
|
588
|
+
*/
|
589
|
+
doGenerate(options: ImageModelV3CallOptions): PromiseLike<{
|
590
|
+
/**
|
591
|
+
Generated images as base64 encoded strings or binary data.
|
592
|
+
The images should be returned without any unnecessary conversion.
|
593
|
+
If the API returns base64 encoded strings, the images should be returned
|
594
|
+
as base64 encoded strings. If the API returns binary data, the images should
|
595
|
+
be returned as binary data.
|
596
|
+
*/
|
597
|
+
images: Array<string> | Array<Uint8Array>;
|
598
|
+
/**
|
599
|
+
Warnings for the call, e.g. unsupported settings.
|
600
|
+
*/
|
601
|
+
warnings: Array<ImageModelV3CallWarning>;
|
602
|
+
/**
|
603
|
+
Additional provider-specific metadata. They are passed through
|
604
|
+
from the provider to the AI SDK and enable provider-specific
|
605
|
+
results that can be fully encapsulated in the provider.
|
606
|
+
|
607
|
+
The outer record is keyed by the provider name, and the inner
|
608
|
+
record is provider-specific metadata. It always includes an
|
609
|
+
`images` key with image-specific metadata
|
610
|
+
|
611
|
+
```ts
|
612
|
+
{
|
613
|
+
"openai": {
|
614
|
+
"images": ["revisedPrompt": "Revised prompt here."]
|
615
|
+
}
|
616
|
+
}
|
617
|
+
```
|
618
|
+
*/
|
619
|
+
providerMetadata?: ImageModelV3ProviderMetadata;
|
620
|
+
/**
|
621
|
+
Response information for telemetry and debugging purposes.
|
622
|
+
*/
|
623
|
+
response: {
|
624
|
+
/**
|
625
|
+
Timestamp for the start of the generated response.
|
626
|
+
*/
|
627
|
+
timestamp: Date;
|
628
|
+
/**
|
629
|
+
The ID of the response model that was used to generate the response.
|
630
|
+
*/
|
631
|
+
modelId: string;
|
632
|
+
/**
|
633
|
+
Response headers.
|
634
|
+
*/
|
635
|
+
headers: Record<string, string> | undefined;
|
636
|
+
};
|
637
|
+
}>;
|
638
|
+
};
|
639
|
+
|
488
640
|
type ImageModelV2CallOptions = {
|
489
641
|
/**
|
490
642
|
Prompt for the image generation.
|
@@ -1770,7 +1922,7 @@ type TranscriptionModelV2 = {
|
|
1770
1922
|
/**
|
1771
1923
|
* Provider for language, text embedding, and image generation models.
|
1772
1924
|
*/
|
1773
|
-
interface
|
1925
|
+
interface ProviderV3 {
|
1774
1926
|
/**
|
1775
1927
|
Returns the language model with the given id.
|
1776
1928
|
The model id is then passed to the provider function to get the model.
|
@@ -1799,6 +1951,61 @@ interface ProviderV2 {
|
|
1799
1951
|
|
1800
1952
|
@param {string} modelId - The id of the model to return.
|
1801
1953
|
|
1954
|
+
@returns {ImageModel} The image model associated with the id
|
1955
|
+
*/
|
1956
|
+
imageModel(modelId: string): ImageModelV3;
|
1957
|
+
/**
|
1958
|
+
Returns the transcription model with the given id.
|
1959
|
+
The model id is then passed to the provider function to get the model.
|
1960
|
+
|
1961
|
+
@param {string} modelId - The id of the model to return.
|
1962
|
+
|
1963
|
+
@returns {TranscriptionModel} The transcription model associated with the id
|
1964
|
+
*/
|
1965
|
+
transcriptionModel?(modelId: string): TranscriptionModelV2;
|
1966
|
+
/**
|
1967
|
+
Returns the speech model with the given id.
|
1968
|
+
The model id is then passed to the provider function to get the model.
|
1969
|
+
|
1970
|
+
@param {string} modelId - The id of the model to return.
|
1971
|
+
|
1972
|
+
@returns {SpeechModel} The speech model associated with the id
|
1973
|
+
*/
|
1974
|
+
speechModel?(modelId: string): SpeechModelV2;
|
1975
|
+
}
|
1976
|
+
|
1977
|
+
/**
|
1978
|
+
* Provider for language, text embedding, and image generation models.
|
1979
|
+
*/
|
1980
|
+
interface ProviderV2 {
|
1981
|
+
/**
|
1982
|
+
Returns the language model with the given id.
|
1983
|
+
The model id is then passed to the provider function to get the model.
|
1984
|
+
|
1985
|
+
@param {string} modelId - The id of the model to return.
|
1986
|
+
|
1987
|
+
@returns {LanguageModel} The language model associated with the id
|
1988
|
+
|
1989
|
+
@throws {NoSuchModelError} If no such model exists.
|
1990
|
+
*/
|
1991
|
+
languageModel(modelId: string): LanguageModelV2;
|
1992
|
+
/**
|
1993
|
+
Returns the text embedding model with the given id.
|
1994
|
+
The model id is then passed to the provider function to get the model.
|
1995
|
+
|
1996
|
+
@param {string} modelId - The id of the model to return.
|
1997
|
+
|
1998
|
+
@returns {LanguageModel} The language model associated with the id
|
1999
|
+
|
2000
|
+
@throws {NoSuchModelError} If no such model exists.
|
2001
|
+
*/
|
2002
|
+
textEmbeddingModel(modelId: string): EmbeddingModelV2<string>;
|
2003
|
+
/**
|
2004
|
+
Returns the image model with the given id.
|
2005
|
+
The model id is then passed to the provider function to get the model.
|
2006
|
+
|
2007
|
+
@param {string} modelId - The id of the model to return.
|
2008
|
+
|
1802
2009
|
@returns {ImageModel} The image model associated with the id
|
1803
2010
|
*/
|
1804
2011
|
imageModel(modelId: string): ImageModelV2;
|
@@ -1822,4 +2029,4 @@ interface ProviderV2 {
|
|
1822
2029
|
speechModel?(modelId: string): SpeechModelV2;
|
1823
2030
|
}
|
1824
2031
|
|
1825
|
-
export { AISDKError, APICallError, type EmbeddingModelV2, type EmbeddingModelV2Embedding, type EmbeddingModelV3, type EmbeddingModelV3Embedding, EmptyResponseBodyError, type ImageModelV2, type ImageModelV2CallOptions, type ImageModelV2CallWarning, type ImageModelV2ProviderMetadata, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV2, type LanguageModelV2CallOptions, type LanguageModelV2CallWarning, type LanguageModelV2Content, type LanguageModelV2DataContent, type LanguageModelV2File, type LanguageModelV2FilePart, type LanguageModelV2FinishReason, type LanguageModelV2FunctionTool, type LanguageModelV2Message, type LanguageModelV2Middleware, type LanguageModelV2Prompt, type LanguageModelV2ProviderDefinedTool, type LanguageModelV2Reasoning, type LanguageModelV2ReasoningPart, type LanguageModelV2ResponseMetadata, type LanguageModelV2Source, type LanguageModelV2StreamPart, type LanguageModelV2Text, type LanguageModelV2TextPart, type LanguageModelV2ToolCall, type LanguageModelV2ToolCallPart, type LanguageModelV2ToolChoice, type LanguageModelV2ToolResultOutput, type LanguageModelV2ToolResultPart, type LanguageModelV2Usage, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV2, type SharedV2Headers, type SharedV2ProviderMetadata, type SharedV2ProviderOptions, type SpeechModelV2, type SpeechModelV2CallOptions, type SpeechModelV2CallWarning, TooManyEmbeddingValuesForCallError, type TranscriptionModelV2, type TranscriptionModelV2CallOptions, type TranscriptionModelV2CallWarning, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
|
2032
|
+
export { AISDKError, APICallError, type EmbeddingModelV2, type EmbeddingModelV2Embedding, type EmbeddingModelV3, type EmbeddingModelV3Embedding, EmptyResponseBodyError, type ImageModelV2, type ImageModelV2CallOptions, type ImageModelV2CallWarning, type ImageModelV2ProviderMetadata, type ImageModelV3, type ImageModelV3CallOptions, type ImageModelV3CallWarning, type ImageModelV3ProviderMetadata, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV2, type LanguageModelV2CallOptions, type LanguageModelV2CallWarning, type LanguageModelV2Content, type LanguageModelV2DataContent, type LanguageModelV2File, type LanguageModelV2FilePart, type LanguageModelV2FinishReason, type LanguageModelV2FunctionTool, type LanguageModelV2Message, type LanguageModelV2Middleware, type LanguageModelV2Prompt, type LanguageModelV2ProviderDefinedTool, type LanguageModelV2Reasoning, type LanguageModelV2ReasoningPart, type LanguageModelV2ResponseMetadata, type LanguageModelV2Source, type LanguageModelV2StreamPart, type LanguageModelV2Text, type LanguageModelV2TextPart, type LanguageModelV2ToolCall, type LanguageModelV2ToolCallPart, type LanguageModelV2ToolChoice, type LanguageModelV2ToolResultOutput, type LanguageModelV2ToolResultPart, type LanguageModelV2Usage, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, type ProviderV2, type ProviderV3, type SharedV2Headers, type SharedV2ProviderMetadata, type SharedV2ProviderOptions, type SpeechModelV2, type SpeechModelV2CallOptions, type SpeechModelV2CallWarning, TooManyEmbeddingValuesForCallError, type TranscriptionModelV2, type TranscriptionModelV2CallOptions, type TranscriptionModelV2CallWarning, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
|