@ai-sdk/gateway 4.0.56 → 4.0.59
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 +18 -0
- package/dist/index.d.ts +47 -23
- package/dist/index.js +614 -217
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/errors/create-gateway-error.ts +8 -0
- package/src/errors/gateway-not-found-error.ts +35 -0
- package/src/errors/index.ts +1 -0
- package/src/gateway-image-model-settings.ts +0 -3
- package/src/gateway-language-model-batch.ts +526 -0
- package/src/gateway-language-model-settings.ts +0 -2
- package/src/gateway-language-model.ts +5 -3
- package/src/gateway-provider-options.ts +6 -0
- package/src/gateway-provider.ts +6 -6
- package/src/gateway-speech-model-settings.ts +3 -0
- package/src/gateway-transcription-model-settings.ts +1 -0
- package/src/index.ts +1 -0
package/src/gateway-provider.ts
CHANGED
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
type GatewayGenerationInfoParams,
|
|
32
32
|
type GatewayGenerationInfo,
|
|
33
33
|
} from './gateway-generation-info';
|
|
34
|
-
import {
|
|
34
|
+
import { GatewayBatchLanguageModel } from './gateway-language-model-batch';
|
|
35
35
|
import { GatewayEmbeddingModel } from './gateway-embedding-model';
|
|
36
36
|
import { GatewayImageModel } from './gateway-image-model';
|
|
37
37
|
import { GatewayVideoModel } from './gateway-video-model';
|
|
@@ -53,8 +53,8 @@ import { gatewayTools } from './gateway-tools';
|
|
|
53
53
|
import { getVercelOidcToken, getVercelRequestId } from './vercel-environment';
|
|
54
54
|
import type { GatewayModelId } from './gateway-language-model-settings';
|
|
55
55
|
import type {
|
|
56
|
-
LanguageModelV4,
|
|
57
56
|
EmbeddingModelV4,
|
|
57
|
+
Experimental_BatchLanguageModelV4 as BatchLanguageModelV4,
|
|
58
58
|
ImageModelV4,
|
|
59
59
|
RerankingModelV4,
|
|
60
60
|
SpeechModelV4,
|
|
@@ -67,17 +67,17 @@ import type {
|
|
|
67
67
|
import { VERSION } from './version';
|
|
68
68
|
|
|
69
69
|
export interface GatewayProvider extends ProviderV4 {
|
|
70
|
-
(modelId: GatewayModelId):
|
|
70
|
+
(modelId: GatewayModelId): BatchLanguageModelV4;
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
73
|
* Creates a model for text generation.
|
|
74
74
|
*/
|
|
75
|
-
chat(modelId: GatewayModelId):
|
|
75
|
+
chat(modelId: GatewayModelId): BatchLanguageModelV4;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Creates a model for text generation.
|
|
79
79
|
*/
|
|
80
|
-
languageModel(modelId: GatewayModelId):
|
|
80
|
+
languageModel(modelId: GatewayModelId): BatchLanguageModelV4;
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Returns available providers and models for use with the remote provider.
|
|
@@ -417,7 +417,7 @@ export function createGateway(
|
|
|
417
417
|
};
|
|
418
418
|
|
|
419
419
|
const createLanguageModel = (modelId: GatewayModelId) => {
|
|
420
|
-
return new
|
|
420
|
+
return new GatewayBatchLanguageModel(modelId, {
|
|
421
421
|
provider: 'gateway',
|
|
422
422
|
baseURL,
|
|
423
423
|
headers: getHeaders,
|