@opencode/ai 0.0.0-dev-1068 → 0.0.0-dev-1111
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/README.md +94 -4
- package/dist/ai-client.d.ts +2 -2
- package/dist/ai-client.js +2 -1
- package/dist/effect.d.ts +6 -0
- package/dist/effect.js +4 -0
- package/dist/embedding-client.d.ts +21 -0
- package/dist/embedding-client.js +30 -0
- package/dist/embedding.d.ts +111 -0
- package/dist/embedding.js +75 -0
- package/dist/image.d.ts +0 -1
- package/dist/image.js +0 -3
- package/dist/index.d.ts +7 -2
- package/dist/index.js +5 -0
- package/dist/protocols/google-embed-content.d.ts +34 -0
- package/dist/protocols/google-embed-content.js +110 -0
- package/dist/protocols/google-vertex-predict-embeddings.d.ts +18 -0
- package/dist/protocols/google-vertex-predict-embeddings.js +74 -0
- package/dist/protocols/index.d.ts +3 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/openai-embeddings.d.ts +16 -0
- package/dist/protocols/openai-embeddings.js +76 -0
- package/dist/providers/alibaba/embeddings.d.ts +2 -0
- package/dist/providers/alibaba/embeddings.js +1 -0
- package/dist/providers/alibaba.d.ts +2 -0
- package/dist/providers/alibaba.js +14 -1
- package/dist/providers/azure/embeddings.d.ts +2 -0
- package/dist/providers/azure/embeddings.js +1 -0
- package/dist/providers/azure.d.ts +2 -0
- package/dist/providers/azure.js +15 -0
- package/dist/providers/cohere/embeddings.d.ts +2 -0
- package/dist/providers/cohere/embeddings.js +1 -0
- package/dist/providers/cohere.d.ts +6 -0
- package/dist/providers/cohere.js +17 -1
- package/dist/providers/deepinfra/embeddings.d.ts +2 -0
- package/dist/providers/deepinfra/embeddings.js +1 -0
- package/dist/providers/deepinfra.d.ts +4 -1
- package/dist/providers/deepinfra.js +15 -1
- package/dist/providers/digitalocean/embeddings.d.ts +2 -0
- package/dist/providers/digitalocean/embeddings.js +1 -0
- package/dist/providers/digitalocean.d.ts +4 -0
- package/dist/providers/digitalocean.js +15 -0
- package/dist/providers/fireworks/embeddings.d.ts +2 -0
- package/dist/providers/fireworks/embeddings.js +1 -0
- package/dist/providers/fireworks.d.ts +4 -1
- package/dist/providers/fireworks.js +15 -1
- package/dist/providers/google/embeddings.d.ts +2 -0
- package/dist/providers/google/embeddings.js +1 -0
- package/dist/providers/google-vertex/embeddings.d.ts +2 -0
- package/dist/providers/google-vertex/embeddings.js +1 -0
- package/dist/providers/google-vertex.d.ts +7 -0
- package/dist/providers/google-vertex.js +52 -0
- package/dist/providers/google.d.ts +6 -0
- package/dist/providers/google.js +14 -0
- package/dist/providers/openai/embeddings.d.ts +2 -0
- package/dist/providers/openai/embeddings.js +1 -0
- package/dist/providers/openai-compatible/embeddings.d.ts +2 -0
- package/dist/providers/openai-compatible/embeddings.js +1 -0
- package/dist/providers/openai-compatible.d.ts +3 -0
- package/dist/providers/openai-compatible.js +13 -0
- package/dist/providers/openai.d.ts +6 -0
- package/dist/providers/openai.js +14 -0
- package/dist/providers/openrouter/embeddings.d.ts +2 -0
- package/dist/providers/openrouter/embeddings.js +1 -0
- package/dist/providers/openrouter.d.ts +9 -0
- package/dist/providers/openrouter.js +15 -0
- package/dist/providers/vercel-ai-gateway/embeddings.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/embeddings.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +4 -0
- package/dist/providers/vercel-ai-gateway.js +15 -1
- package/dist/public.d.ts +2 -0
- package/dist/public.js +1 -0
- package/dist/route/embedding.d.ts +61 -0
- package/dist/route/embedding.js +88 -0
- package/package.json +55 -3
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
2
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
2
3
|
import { OpenAIImages } from "../protocols/openai-images.js";
|
|
3
4
|
import { OpenResponses } from "../protocols/open-responses.js";
|
|
4
5
|
import { SystemOne } from "../protocols/system-one.js";
|
|
@@ -53,6 +54,14 @@ export const configure = (input = {}) => {
|
|
|
53
54
|
const decision = (modelID, providerOptions) => decisionRoute.model({ id: modelID, providerOptions });
|
|
54
55
|
const media = MediaRoute.deployment({ ...input, baseURL: options.endpoint.baseURL }, options.auth);
|
|
55
56
|
const image = (modelID, providerOptions) => OpenAIImages.model({ ...media, id: modelID, provider: id, providerOptions });
|
|
57
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
58
|
+
provider: id,
|
|
59
|
+
endpoint: options.endpoint,
|
|
60
|
+
auth: options.auth,
|
|
61
|
+
headers: input.headers,
|
|
62
|
+
http: input.http,
|
|
63
|
+
});
|
|
64
|
+
const embedding = (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions });
|
|
56
65
|
const chat = (modelID) => configured.model({
|
|
57
66
|
id: modelID,
|
|
58
67
|
capabilities: { promptCacheKey: true },
|
|
@@ -64,11 +73,13 @@ export const configure = (input = {}) => {
|
|
|
64
73
|
responses: (modelID) => configuredResponses.model({ id: modelID }),
|
|
65
74
|
image,
|
|
66
75
|
decision,
|
|
76
|
+
embedding,
|
|
67
77
|
configure,
|
|
68
78
|
};
|
|
69
79
|
};
|
|
70
80
|
export const provider = configure();
|
|
71
81
|
export const decision = provider.decision;
|
|
82
|
+
export const embedding = provider.embedding;
|
|
72
83
|
export const image = provider.image;
|
|
73
84
|
export const chat = provider.chat;
|
|
74
85
|
export const responses = provider.responses;
|
|
@@ -82,6 +93,10 @@ export const decisionModel = (modelID, settings) => {
|
|
|
82
93
|
const input = config(settings);
|
|
83
94
|
return configure(input).decision(modelID, input.providerOptions);
|
|
84
95
|
};
|
|
96
|
+
export const embeddingModel = (modelID, settings) => {
|
|
97
|
+
const input = config(settings);
|
|
98
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
99
|
+
};
|
|
85
100
|
function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
|
|
86
101
|
return {
|
|
87
102
|
apiKey,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../fireworks.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import type { ProviderAuthOption } from "../route/auth-options.js";
|
|
3
3
|
import { Route } from "../route/client.js";
|
|
4
|
-
import { type ModelID, type RequestOptions } from "../schema/index.js";
|
|
4
|
+
import { type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
7
|
export type Config = Omit<RequestOptions, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
@@ -365,12 +365,15 @@ export declare const routes: Route<{
|
|
|
365
365
|
export declare const configure: (input?: Config) => {
|
|
366
366
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
367
367
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
368
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
368
369
|
configure: typeof configure;
|
|
369
370
|
};
|
|
370
371
|
export declare const provider: {
|
|
371
372
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
372
373
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
374
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
373
375
|
configure: typeof configure;
|
|
374
376
|
};
|
|
375
377
|
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
378
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
376
379
|
export * as Fireworks from "./fireworks.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
2
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
2
3
|
import { Route } from "../route/client.js";
|
|
3
4
|
import { Endpoint } from "../route/endpoint.js";
|
|
4
5
|
import { ProviderID } from "../schema/index.js";
|
|
@@ -15,13 +16,26 @@ export const route = Route.make({
|
|
|
15
16
|
});
|
|
16
17
|
export const routes = [route];
|
|
17
18
|
export const configure = (input = {}) => {
|
|
18
|
-
const
|
|
19
|
+
const options = bearerRouteDefaults(input, "FIREWORKS_API_KEY", baseURL);
|
|
20
|
+
const configured = route.with(options);
|
|
21
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
22
|
+
provider: id,
|
|
23
|
+
endpoint: options.endpoint,
|
|
24
|
+
auth: options.auth,
|
|
25
|
+
headers: input.headers,
|
|
26
|
+
http: input.http,
|
|
27
|
+
});
|
|
19
28
|
return {
|
|
20
29
|
id,
|
|
21
30
|
model: (modelID) => configured.model({ id: modelID, capabilities: { promptCacheKey: true } }),
|
|
31
|
+
embedding: (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions }),
|
|
22
32
|
configure,
|
|
23
33
|
};
|
|
24
34
|
};
|
|
25
35
|
export const provider = configure();
|
|
26
36
|
export const model = (modelID, settings) => configure(toConfig(settings)).model(modelID);
|
|
37
|
+
export const embeddingModel = (modelID, settings) => {
|
|
38
|
+
const input = toConfig(settings);
|
|
39
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
40
|
+
};
|
|
27
41
|
export * as Fireworks from "./fireworks.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../google.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../google-vertex.js";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import { Gemini } from "../protocols/gemini.js";
|
|
3
|
+
import { type VertexOptionsInput } from "../protocols/google-embed-content.js";
|
|
4
|
+
import { type OptionsInput as PredictOptionsInput } from "../protocols/google-vertex-predict-embeddings.js";
|
|
3
5
|
import { Route } from "../route/client.js";
|
|
4
6
|
import { type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js";
|
|
5
7
|
import { GoogleVertexShared } from "./google-vertex-shared.js";
|
|
@@ -111,10 +113,14 @@ export declare const routes: Route<{
|
|
|
111
113
|
} | undefined;
|
|
112
114
|
readonly continuationToken?: string | undefined;
|
|
113
115
|
}, Gemini.Prepared, import("../route/client.js").CompactionOperations | undefined>[];
|
|
116
|
+
export type { VertexOptionsInput as GoogleVertexEmbeddingOptions } from "../protocols/google-embed-content.js";
|
|
117
|
+
export type { OptionsInput as GoogleVertexPredictEmbeddingOptions } from "../protocols/google-vertex-predict-embeddings.js";
|
|
114
118
|
export declare const configure: (input?: Config) => {
|
|
115
119
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
116
120
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<GeminiOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
117
121
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
122
|
+
/** `gemini-embedding-2*` through `embedContent`, other models through `:predict`; see `embeddingTarget`. */
|
|
123
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<VertexOptionsInput & PredictOptionsInput>;
|
|
118
124
|
configure: typeof configure;
|
|
119
125
|
};
|
|
120
126
|
export declare const provider: {
|
|
@@ -123,3 +129,4 @@ export declare const provider: {
|
|
|
123
129
|
};
|
|
124
130
|
export declare const model: ProviderPackage.Model<Settings, GeminiProviderOptionsInput>;
|
|
125
131
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
132
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<VertexOptionsInput & PredictOptionsInput>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { Gemini } from "../protocols/gemini.js";
|
|
3
|
+
import { GoogleEmbedContent } from "../protocols/google-embed-content.js";
|
|
3
4
|
import { GoogleImages } from "../protocols/google-images.js";
|
|
5
|
+
import { GoogleVertexPredictEmbeddings, MAX_INSTANCES, } from "../protocols/google-vertex-predict-embeddings.js";
|
|
4
6
|
import { ProviderShared } from "../protocols/shared.js";
|
|
5
7
|
import { Auth } from "../route/auth.js";
|
|
6
8
|
import { Route } from "../route/client.js";
|
|
9
|
+
import { EmbeddingRoute } from "../route/embedding.js";
|
|
7
10
|
import { Endpoint } from "../route/endpoint.js";
|
|
8
11
|
import { MediaRoute } from "../route/media.js";
|
|
9
12
|
import { ProviderConfigurationError, ProviderID, } from "../schema/index.js";
|
|
@@ -41,6 +44,38 @@ const route = Route.make({
|
|
|
41
44
|
transport: Gemini.transport,
|
|
42
45
|
});
|
|
43
46
|
export const routes = [route];
|
|
47
|
+
const embedContentRoute = EmbeddingRoute.make({
|
|
48
|
+
id: "google-vertex-embed-content",
|
|
49
|
+
provider: id,
|
|
50
|
+
providerMetadataKey: "vertex",
|
|
51
|
+
protocol: GoogleEmbedContent.vertexProtocol,
|
|
52
|
+
endpoint: Endpoint.path(({ request }) => `/models/${request.model.id}:embedContent`),
|
|
53
|
+
// Vertex embedContent embeds one content per request.
|
|
54
|
+
maxValues: 1,
|
|
55
|
+
});
|
|
56
|
+
const predictRoute = EmbeddingRoute.make({
|
|
57
|
+
id: "google-vertex-predict-embeddings",
|
|
58
|
+
provider: id,
|
|
59
|
+
providerMetadataKey: "vertex",
|
|
60
|
+
protocol: GoogleVertexPredictEmbeddings.protocol,
|
|
61
|
+
// Tuned embedding models are deployed to `endpoints/{id}`, which serve `:predict` outside `publishers/google`.
|
|
62
|
+
endpoint: Endpoint.path(({ request }) => {
|
|
63
|
+
const model = request.model.id;
|
|
64
|
+
return `/${model.startsWith("endpoints/") ? model : `models/${model}`}:predict`;
|
|
65
|
+
}),
|
|
66
|
+
maxValues: MAX_INSTANCES,
|
|
67
|
+
});
|
|
68
|
+
/**
|
|
69
|
+
* `gemini-embedding-2*` models use `embedContent`, which takes media; every other embedding model uses the older
|
|
70
|
+
* text-only `:predict` API. `gemini-embedding-001` takes one text per `:predict` request.
|
|
71
|
+
*/
|
|
72
|
+
const embeddingTarget = (modelID) => {
|
|
73
|
+
if (modelID.startsWith("gemini-embedding-2"))
|
|
74
|
+
return { route: embedContentRoute, embedContent: true };
|
|
75
|
+
if (modelID.startsWith("gemini-embedding-001"))
|
|
76
|
+
return { route: predictRoute.with({ maxValues: 1 }), embedContent: false };
|
|
77
|
+
return { route: predictRoute, embedContent: false };
|
|
78
|
+
};
|
|
44
79
|
const configuredRoute = (input, modelID) => {
|
|
45
80
|
const { accessToken: _accessToken, apiKey: _apiKey, auth: _auth, baseURL: _baseURL, location: _location, project: _project, ...rest } = input;
|
|
46
81
|
return route.with({ ...rest, ...connection(input, modelID) });
|
|
@@ -76,6 +111,19 @@ export const configure = (input = {}) => {
|
|
|
76
111
|
providerOptions,
|
|
77
112
|
});
|
|
78
113
|
},
|
|
114
|
+
/** `gemini-embedding-2*` through `embedContent`, other models through `:predict`; see `embeddingTarget`. */
|
|
115
|
+
embedding: (modelID, providerOptions) => {
|
|
116
|
+
const target = connection(input, modelID);
|
|
117
|
+
const selected = embeddingTarget(modelID);
|
|
118
|
+
if (selected.embedContent && GoogleVertexShared.apiKey(input) !== undefined && input.baseURL === undefined)
|
|
119
|
+
throw new ProviderConfigurationError({
|
|
120
|
+
provider: id,
|
|
121
|
+
message: "Google Vertex embedContent does not support Express Mode API keys; use project credentials",
|
|
122
|
+
});
|
|
123
|
+
return selected.route
|
|
124
|
+
.with({ endpoint: target.endpoint, auth: target.auth, headers: input.headers, http: input.http })
|
|
125
|
+
.model({ id: modelID, providerOptions });
|
|
126
|
+
},
|
|
79
127
|
configure,
|
|
80
128
|
};
|
|
81
129
|
};
|
|
@@ -88,6 +136,10 @@ export const imageModel = (modelID, settings) => {
|
|
|
88
136
|
const input = config(settings);
|
|
89
137
|
return configure(input).image(modelID, input.providerOptions);
|
|
90
138
|
};
|
|
139
|
+
export const embeddingModel = (modelID, settings) => {
|
|
140
|
+
const input = config(settings);
|
|
141
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
142
|
+
};
|
|
91
143
|
function config({ accessToken, apiKey, baseURL, body, headers, location, project, ...providerOptions } = {}) {
|
|
92
144
|
if (apiKey !== undefined && accessToken !== undefined)
|
|
93
145
|
throw new ProviderConfigurationError({
|
|
@@ -2,7 +2,9 @@ import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
|
2
2
|
import type { ProviderPackage } from "../provider-package.js";
|
|
3
3
|
import { type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js";
|
|
4
4
|
import { Gemini } from "../protocols/gemini.js";
|
|
5
|
+
import { type OptionsInput as GoogleEmbeddingOptionsInput } from "../protocols/google-embed-content.js";
|
|
5
6
|
import { GoogleInteractions } from "../protocols/google-interactions.js";
|
|
7
|
+
export type { OptionsInput as GoogleEmbeddingOptions } from "../protocols/google-embed-content.js";
|
|
6
8
|
export type { GoogleImageOptions } from "../protocols/google-images.js";
|
|
7
9
|
export type { GoogleSpeechOptions } from "../protocols/google-speech.js";
|
|
8
10
|
export type { GoogleTranscriptionOptions } from "../protocols/google-transcription.js";
|
|
@@ -181,6 +183,7 @@ export declare const configure: (input?: Config) => {
|
|
|
181
183
|
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
182
184
|
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
183
185
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
186
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
184
187
|
configure: typeof configure;
|
|
185
188
|
};
|
|
186
189
|
export declare const provider: {
|
|
@@ -198,11 +201,14 @@ export declare const provider: {
|
|
|
198
201
|
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
199
202
|
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
200
203
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
204
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
201
205
|
configure: typeof configure;
|
|
202
206
|
};
|
|
203
207
|
export declare const model: ProviderPackage.Model<Settings, Gemini.ProviderOptionsInput>;
|
|
204
208
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
209
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
205
210
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
211
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
206
212
|
export declare const gemini: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.OptionsInput, import("../route.js").CompactionOperations | undefined>;
|
|
207
213
|
export declare const interactions: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
208
214
|
readonly previousInteractionId?: string | undefined;
|
package/dist/providers/google.js
CHANGED
|
@@ -3,6 +3,7 @@ import { AuthOptions } from "../route/auth-options.js";
|
|
|
3
3
|
import { MediaRoute } from "../route/media.js";
|
|
4
4
|
import { ProviderID } from "../schema/index.js";
|
|
5
5
|
import { Gemini } from "../protocols/gemini.js";
|
|
6
|
+
import { GoogleEmbedContent, } from "../protocols/google-embed-content.js";
|
|
6
7
|
import { GoogleInteractions } from "../protocols/google-interactions.js";
|
|
7
8
|
import { GoogleImages } from "../protocols/google-images.js";
|
|
8
9
|
import { GoogleSpeech } from "../protocols/google-speech.js";
|
|
@@ -24,6 +25,13 @@ export const configure = (input = {}) => {
|
|
|
24
25
|
const route = configuredRoute(input);
|
|
25
26
|
const media = MediaRoute.deployment(input, auth(input));
|
|
26
27
|
const gemini = (modelID) => route.model({ id: modelID });
|
|
28
|
+
const embeddingRoute = GoogleEmbedContent.route.with({
|
|
29
|
+
provider: id,
|
|
30
|
+
endpoint: { baseURL: input.baseURL },
|
|
31
|
+
auth: auth(input),
|
|
32
|
+
headers: input.headers,
|
|
33
|
+
http: input.http,
|
|
34
|
+
});
|
|
27
35
|
return {
|
|
28
36
|
id,
|
|
29
37
|
model: gemini,
|
|
@@ -33,6 +41,7 @@ export const configure = (input = {}) => {
|
|
|
33
41
|
video: (modelID) => GoogleVideo.model({ ...media, id: modelID }),
|
|
34
42
|
speech: (modelID) => GoogleSpeech.model({ ...media, id: modelID }),
|
|
35
43
|
transcription: (modelID) => GoogleTranscription.model({ ...media, id: modelID }),
|
|
44
|
+
embedding: (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions }),
|
|
36
45
|
configure,
|
|
37
46
|
};
|
|
38
47
|
};
|
|
@@ -42,7 +51,12 @@ export const imageModel = (modelID, settings) => {
|
|
|
42
51
|
const input = toConfig(settings);
|
|
43
52
|
return configure(input).image(modelID, input.providerOptions);
|
|
44
53
|
};
|
|
54
|
+
export const embeddingModel = (modelID, settings) => {
|
|
55
|
+
const input = toConfig(settings);
|
|
56
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
57
|
+
};
|
|
45
58
|
export const image = provider.image;
|
|
59
|
+
export const embedding = provider.embedding;
|
|
46
60
|
export const gemini = provider.gemini;
|
|
47
61
|
export const interactions = provider.interactions;
|
|
48
62
|
export const video = provider.video;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../openai.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../openai-compatible.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js";
|
|
2
|
+
import { type OptionsInput as OpenAIEmbeddingOptionsInput } from "../protocols/openai-embeddings.js";
|
|
2
3
|
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
3
4
|
import type { ProviderPackage } from "../provider-package.js";
|
|
4
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
@@ -192,6 +193,7 @@ export declare const configure: (input: Config) => {
|
|
|
192
193
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
193
194
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route.js").CompactionOperations | undefined>;
|
|
194
195
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
196
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
|
195
197
|
configure: typeof configure;
|
|
196
198
|
};
|
|
197
199
|
export declare const provider: {
|
|
@@ -200,4 +202,5 @@ export declare const provider: {
|
|
|
200
202
|
};
|
|
201
203
|
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
202
204
|
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
205
|
+
export declare const embeddingModel: (modelID: string, settings: Settings) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
|
203
206
|
export * as OpenAICompatible from "./openai-compatible.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { mergeProviderOptions, ProviderID, } from "../schema/index.js";
|
|
2
2
|
import { OpenAICompatibleChat } from "../protocols/openai-compatible-chat.js";
|
|
3
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
3
4
|
import { OpenAIImages } from "../protocols/openai-images.js";
|
|
4
5
|
import { MediaRoute } from "../route/media.js";
|
|
5
6
|
import { AuthOptions } from "../route/auth-options.js";
|
|
@@ -17,6 +18,13 @@ export const configure = (input) => {
|
|
|
17
18
|
auth,
|
|
18
19
|
});
|
|
19
20
|
const media = MediaRoute.deployment(input, auth);
|
|
21
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
22
|
+
provider,
|
|
23
|
+
endpoint: { baseURL },
|
|
24
|
+
auth,
|
|
25
|
+
headers: input.headers,
|
|
26
|
+
http: input.http,
|
|
27
|
+
});
|
|
20
28
|
return {
|
|
21
29
|
id: ProviderID.make(provider),
|
|
22
30
|
model: (modelID) => route.model({ id: modelID }),
|
|
@@ -28,6 +36,7 @@ export const configure = (input) => {
|
|
|
28
36
|
provider,
|
|
29
37
|
providerOptions: mergeProviderOptions(/gpt-image|chatgpt-image/.test(modelID) ? undefined : { response_format: "b64_json" }, providerOptions),
|
|
30
38
|
}),
|
|
39
|
+
embedding: (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions }),
|
|
31
40
|
configure,
|
|
32
41
|
};
|
|
33
42
|
};
|
|
@@ -40,6 +49,10 @@ export const imageModel = (modelID, settings) => {
|
|
|
40
49
|
const input = config(settings);
|
|
41
50
|
return configure(input).image(modelID, input.providerOptions);
|
|
42
51
|
};
|
|
52
|
+
export const embeddingModel = (modelID, settings) => {
|
|
53
|
+
const input = config(settings);
|
|
54
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
55
|
+
};
|
|
43
56
|
function config({ provider, ...settings }) {
|
|
44
57
|
return { ...toConfig(settings), provider };
|
|
45
58
|
}
|
|
@@ -5,11 +5,13 @@ import { ToolDefinition, type ModelID, type OpenString, type ProviderOptions, ty
|
|
|
5
5
|
import * as OpenAIResponses from "../protocols/openai-responses.js";
|
|
6
6
|
import { type OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
7
7
|
import { type OptionsInput as OpenAIDecisionOptionsInput } from "../protocols/openai-decisions.js";
|
|
8
|
+
import { type OptionsInput as OpenAIEmbeddingOptionsInput } from "../protocols/openai-embeddings.js";
|
|
8
9
|
export type { OpenAIOptionsInput, OpenAIResponseIncludable, OpenAIServiceTier } from "./openai-options.js";
|
|
9
10
|
export type { OpenAIImageOptions } from "../protocols/openai-images.js";
|
|
10
11
|
export type { OpenAISpeechOptions } from "../protocols/openai-speech.js";
|
|
11
12
|
export type { OpenAITranscriptionOptions } from "../protocols/openai-transcription.js";
|
|
12
13
|
export type { OptionsInput as OpenAIDecisionOptions } from "../protocols/openai-decisions.js";
|
|
14
|
+
export type { OptionsInput as OpenAIEmbeddingOptions } from "../protocols/openai-embeddings.js";
|
|
13
15
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
14
16
|
export declare const routes: (Route<{
|
|
15
17
|
readonly model: string;
|
|
@@ -456,6 +458,7 @@ export declare const configure: (input?: Config) => {
|
|
|
456
458
|
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/openai-speech.js").OpenAISpeechOptions>;
|
|
457
459
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/openai-transcription.js").OpenAITranscriptionOptions>;
|
|
458
460
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenAIDecisionOptionsInput>;
|
|
461
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
|
459
462
|
configure: typeof configure;
|
|
460
463
|
};
|
|
461
464
|
export declare const provider: {
|
|
@@ -473,12 +476,14 @@ export declare const provider: {
|
|
|
473
476
|
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/openai-speech.js").OpenAISpeechOptions>;
|
|
474
477
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/openai-transcription.js").OpenAITranscriptionOptions>;
|
|
475
478
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenAIDecisionOptionsInput>;
|
|
479
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
|
476
480
|
configure: typeof configure;
|
|
477
481
|
};
|
|
478
482
|
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput, typeof OpenAIResponses.route.compact>;
|
|
479
483
|
export declare const chatModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
480
484
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
481
485
|
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<OpenAIDecisionOptionsInput>;
|
|
486
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
|
482
487
|
export declare const responses: (id: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, {
|
|
483
488
|
endpoint: import("../route/client.js").CompactOperation;
|
|
484
489
|
trigger: import("../route/client.js").TriggerCompactOperation;
|
|
@@ -488,3 +493,4 @@ export declare const image: (modelID: string | ModelID, providerOptions?: Provid
|
|
|
488
493
|
export declare const speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/openai-speech.js").OpenAISpeechOptions>;
|
|
489
494
|
export declare const transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/openai-transcription.js").OpenAITranscriptionOptions>;
|
|
490
495
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenAIDecisionOptionsInput>;
|
|
496
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
package/dist/providers/openai.js
CHANGED
|
@@ -8,6 +8,7 @@ import { OpenAIImages } from "../protocols/openai-images.js";
|
|
|
8
8
|
import { OpenAISpeech } from "../protocols/openai-speech.js";
|
|
9
9
|
import { OpenAITranscription } from "../protocols/openai-transcription.js";
|
|
10
10
|
import { OpenAIDecisions } from "../protocols/openai-decisions.js";
|
|
11
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
11
12
|
export const id = ProviderID.make("openai");
|
|
12
13
|
export const routes = [OpenAIResponses.route, OpenAIChat.route];
|
|
13
14
|
export const imageGeneration = (options = {}) => ToolDefinition.make({
|
|
@@ -63,6 +64,13 @@ export const configure = (input = {}) => {
|
|
|
63
64
|
http: media.http,
|
|
64
65
|
});
|
|
65
66
|
const decision = (modelID, providerOptions) => decisionRoute.model({ id: modelID, providerOptions });
|
|
67
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
68
|
+
endpoint: { baseURL: media.baseURL },
|
|
69
|
+
auth: media.auth,
|
|
70
|
+
headers: media.headers,
|
|
71
|
+
http: media.http,
|
|
72
|
+
});
|
|
73
|
+
const embedding = (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions });
|
|
66
74
|
return {
|
|
67
75
|
id,
|
|
68
76
|
model: responses,
|
|
@@ -72,6 +80,7 @@ export const configure = (input = {}) => {
|
|
|
72
80
|
speech,
|
|
73
81
|
transcription,
|
|
74
82
|
decision,
|
|
83
|
+
embedding,
|
|
75
84
|
configure,
|
|
76
85
|
};
|
|
77
86
|
};
|
|
@@ -103,9 +112,14 @@ export const decisionModel = (modelID, settings) => {
|
|
|
103
112
|
const input = config(settings);
|
|
104
113
|
return configure(input).decision(modelID, input.providerOptions);
|
|
105
114
|
};
|
|
115
|
+
export const embeddingModel = (modelID, settings) => {
|
|
116
|
+
const input = config(settings);
|
|
117
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
118
|
+
};
|
|
106
119
|
export const responses = provider.responses;
|
|
107
120
|
export const chat = provider.chat;
|
|
108
121
|
export const image = provider.image;
|
|
109
122
|
export const speech = provider.speech;
|
|
110
123
|
export const transcription = provider.transcription;
|
|
111
124
|
export const decision = provider.decision;
|
|
125
|
+
export const embedding = provider.embedding;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../openrouter.js";
|
|
@@ -82,6 +82,11 @@ export interface OpenRouterDecisionOptions {
|
|
|
82
82
|
readonly trace?: Readonly<Record<string, unknown>>;
|
|
83
83
|
readonly user?: string;
|
|
84
84
|
}
|
|
85
|
+
export interface OpenRouterEmbeddingOptions {
|
|
86
|
+
readonly [key: string]: unknown;
|
|
87
|
+
readonly provider?: OpenRouterProviderRouting;
|
|
88
|
+
readonly user?: string;
|
|
89
|
+
}
|
|
85
90
|
export type Config = Omit<RequestOptions, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
86
91
|
readonly baseURL?: string;
|
|
87
92
|
readonly providerOptions?: OpenRouterProviderOptionsInput | OpenRouterResponsesProviderOptionsInput;
|
|
@@ -1142,6 +1147,7 @@ export declare const configure: (input?: Config) => {
|
|
|
1142
1147
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterResponsesProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
1143
1148
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1144
1149
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1150
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenRouterEmbeddingOptions>;
|
|
1145
1151
|
configure: typeof configure;
|
|
1146
1152
|
};
|
|
1147
1153
|
export declare const provider: {
|
|
@@ -1151,9 +1157,11 @@ export declare const provider: {
|
|
|
1151
1157
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterResponsesProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
1152
1158
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1153
1159
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1160
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenRouterEmbeddingOptions>;
|
|
1154
1161
|
configure: typeof configure;
|
|
1155
1162
|
};
|
|
1156
1163
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1164
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<OpenRouterEmbeddingOptions>;
|
|
1157
1165
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1158
1166
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterOptions, import("../route/client.js").CompactionOperations | undefined>;
|
|
1159
1167
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<OpenRouterResponsesProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
@@ -1161,4 +1169,5 @@ export declare const model: ProviderPackage.Model<Settings, OpenRouterProviderOp
|
|
|
1161
1169
|
export declare const responsesModel: ProviderPackage.Model<Settings<OpenRouterResponsesProviderOptionsInput>, OpenRouterResponsesProviderOptionsInput>;
|
|
1162
1170
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
1163
1171
|
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<OpenRouterDecisionOptions>;
|
|
1172
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<OpenRouterEmbeddingOptions>;
|
|
1164
1173
|
export * as OpenRouter from "./openrouter.js";
|
|
@@ -4,6 +4,7 @@ import { Endpoint } from "../route/endpoint.js";
|
|
|
4
4
|
import { Protocol } from "../route/protocol.js";
|
|
5
5
|
import { ProviderID, } from "../schema/index.js";
|
|
6
6
|
import { SystemOne } from "../protocols/system-one.js";
|
|
7
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
7
8
|
import { OpenAIImages } from "../protocols/openai-images.js";
|
|
8
9
|
import { MediaRoute } from "../route/media.js";
|
|
9
10
|
import { HttpTransport } from "../route/transport/index.js";
|
|
@@ -159,6 +160,14 @@ export const configure = (input = {}) => {
|
|
|
159
160
|
compatibility: { mediaInput: "state" },
|
|
160
161
|
providerOptions,
|
|
161
162
|
});
|
|
163
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
164
|
+
provider: id,
|
|
165
|
+
endpoint: options.endpoint,
|
|
166
|
+
auth: options.auth,
|
|
167
|
+
headers: input.headers,
|
|
168
|
+
http: input.http,
|
|
169
|
+
});
|
|
170
|
+
const embedding = (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions });
|
|
162
171
|
const chat = (modelID) => chatRoute.model({ id: modelID, capabilities: { promptCacheKey: true } });
|
|
163
172
|
return {
|
|
164
173
|
id,
|
|
@@ -167,11 +176,13 @@ export const configure = (input = {}) => {
|
|
|
167
176
|
responses: (modelID) => configuredResponses.model({ id: modelID }),
|
|
168
177
|
image,
|
|
169
178
|
decision,
|
|
179
|
+
embedding,
|
|
170
180
|
configure,
|
|
171
181
|
};
|
|
172
182
|
};
|
|
173
183
|
export const provider = configure();
|
|
174
184
|
export const decision = provider.decision;
|
|
185
|
+
export const embedding = provider.embedding;
|
|
175
186
|
export const image = provider.image;
|
|
176
187
|
export const chat = provider.chat;
|
|
177
188
|
export const responses = provider.responses;
|
|
@@ -185,4 +196,8 @@ export const decisionModel = (modelID, settings) => {
|
|
|
185
196
|
const input = toConfig(settings);
|
|
186
197
|
return configure(input).decision(modelID, input.providerOptions);
|
|
187
198
|
};
|
|
199
|
+
export const embeddingModel = (modelID, settings) => {
|
|
200
|
+
const input = toConfig(settings);
|
|
201
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
202
|
+
};
|
|
188
203
|
export * as OpenRouter from "./openrouter.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../vercel-ai-gateway.js";
|
|
@@ -81,6 +81,7 @@ export declare const configure: (input?: Config) => {
|
|
|
81
81
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
82
82
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
83
83
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
84
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
84
85
|
configure: typeof configure;
|
|
85
86
|
};
|
|
86
87
|
export declare const provider: {
|
|
@@ -91,9 +92,11 @@ export declare const provider: {
|
|
|
91
92
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
92
93
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
93
94
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
95
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
94
96
|
configure: typeof configure;
|
|
95
97
|
};
|
|
96
98
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
99
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
97
100
|
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
98
101
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
99
102
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
@@ -104,4 +107,5 @@ export declare const responsesModel: ProviderPackage.Model<Settings, ProviderOpt
|
|
|
104
107
|
export declare const chatModel: ProviderPackage.Model<Settings, ProviderOptionsInput>;
|
|
105
108
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
106
109
|
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
110
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
107
111
|
export * as VercelAIGateway from "./vercel-ai-gateway.js";
|