@opencode/ai 2.2.6 → 2.3.0
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 +208 -98
- package/dist/ai-client.d.ts +2 -2
- package/dist/ai-client.js +2 -1
- package/dist/decision.d.ts +10 -0
- package/dist/decision.js +2 -0
- package/dist/effect.d.ts +14 -7
- package/dist/effect.js +6 -1
- 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/experimental.d.ts +0 -4
- package/dist/experimental.js +0 -3
- package/dist/image-client.d.ts +1 -1
- package/dist/image-client.js +2 -6
- package/dist/image.d.ts +0 -1
- package/dist/image.js +0 -3
- package/dist/index.d.ts +18 -50
- package/dist/index.js +35 -13
- package/dist/media-model.d.ts +2 -0
- package/dist/media-model.js +3 -1
- package/dist/media.d.ts +9 -3
- package/dist/media.js +27 -7
- package/dist/protocols/alibaba-chat.d.ts +4 -0
- package/dist/protocols/anthropic-messages.js +3 -3
- package/dist/protocols/google-decisions.d.ts +13 -0
- package/dist/protocols/google-decisions.js +133 -0
- package/dist/protocols/google-embed-content.d.ts +34 -0
- package/dist/protocols/google-embed-content.js +110 -0
- package/dist/protocols/google-interactions-video.d.ts +43 -0
- package/dist/protocols/google-interactions-video.js +186 -0
- package/dist/protocols/google-interactions.d.ts +14 -1
- package/dist/protocols/google-interactions.js +1 -1
- 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 +4 -0
- package/dist/protocols/index.js +4 -0
- package/dist/protocols/minimax-video.d.ts +54 -0
- package/dist/protocols/minimax-video.js +292 -0
- package/dist/protocols/open-responses.d.ts +1 -1
- package/dist/protocols/open-responses.js +31 -8
- package/dist/protocols/openai-chat.d.ts +24 -0
- package/dist/protocols/openai-chat.js +37 -11
- package/dist/protocols/openai-compatible-chat.d.ts +1 -0
- package/dist/protocols/openai-decisions.js +14 -1
- package/dist/protocols/openai-embeddings.d.ts +16 -0
- package/dist/protocols/openai-embeddings.js +76 -0
- package/dist/protocols/openrouter-video.d.ts +41 -0
- package/dist/protocols/openrouter-video.js +138 -0
- package/dist/protocols/seedance-video.d.ts +50 -0
- package/dist/protocols/seedance-video.js +216 -0
- package/dist/protocols/shared.d.ts +13 -3
- package/dist/protocols/shared.js +27 -4
- package/dist/protocols/system-one.d.ts +45 -1
- package/dist/protocols/system-one.js +50 -8
- package/dist/protocols/utils/responses-compaction.js +1 -1
- package/dist/protocols/venice-chat.d.ts +4 -0
- package/dist/protocols/xai-video.d.ts +8 -2
- package/dist/protocols/xai-video.js +20 -15
- package/dist/protocols/zai-chat.d.ts +4 -0
- package/dist/provider-error.js +7 -1
- package/dist/providers/alibaba/embeddings.d.ts +2 -0
- package/dist/providers/alibaba/embeddings.js +1 -0
- package/dist/providers/alibaba.d.ts +3 -0
- package/dist/providers/alibaba.js +14 -1
- package/dist/providers/amazon-bedrock-mantle.d.ts +1 -0
- package/dist/providers/azure/embeddings.d.ts +2 -0
- package/dist/providers/azure/embeddings.js +1 -0
- package/dist/providers/azure.d.ts +3 -0
- package/dist/providers/azure.js +15 -0
- package/dist/providers/baseten.d.ts +2 -0
- package/dist/providers/byteplus/videos.d.ts +2 -0
- package/dist/providers/byteplus/videos.js +1 -0
- package/dist/providers/byteplus.d.ts +26 -0
- package/dist/providers/byteplus.js +21 -0
- package/dist/providers/cerebras.d.ts +2 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +2 -0
- package/dist/providers/cohere/embeddings.d.ts +2 -0
- package/dist/providers/cohere/embeddings.js +1 -0
- package/dist/providers/cohere.d.ts +8 -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 +6 -1
- package/dist/providers/deepinfra.js +15 -1
- package/dist/providers/deepseek.d.ts +2 -0
- package/dist/providers/digitalocean/embeddings.d.ts +2 -0
- package/dist/providers/digitalocean/embeddings.js +1 -0
- package/dist/providers/digitalocean.d.ts +10 -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 +6 -1
- package/dist/providers/fireworks.js +15 -1
- package/dist/providers/google/decisions.d.ts +2 -0
- package/dist/providers/google/decisions.js +1 -0
- package/dist/providers/google/embeddings.d.ts +2 -0
- package/dist/providers/google/embeddings.js +1 -0
- package/dist/providers/google/videos.d.ts +2 -0
- package/dist/providers/google/videos.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-chat.d.ts +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 +17 -4
- package/dist/providers/google.js +27 -3
- package/dist/providers/groq.d.ts +5 -0
- package/dist/providers/index.d.ts +2 -1
- package/dist/providers/index.js +2 -1
- package/dist/providers/meta.d.ts +1 -0
- package/dist/providers/minimax/videos.d.ts +3 -0
- package/dist/providers/minimax/videos.js +1 -0
- package/dist/providers/minimax.d.ts +7 -1
- package/dist/providers/minimax.js +10 -1
- package/dist/providers/moonshot.d.ts +1 -0
- package/dist/providers/openai/embeddings.d.ts +2 -0
- package/dist/providers/openai/embeddings.js +1 -0
- package/dist/providers/openai-compatible/decisions.d.ts +2 -0
- package/dist/providers/openai-compatible/decisions.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 +6 -0
- package/dist/providers/openai-compatible.js +27 -0
- package/dist/providers/openai.d.ts +7 -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/videos.d.ts +2 -0
- package/dist/providers/openrouter/videos.js +1 -0
- package/dist/providers/openrouter.d.ts +21 -0
- package/dist/providers/openrouter.js +23 -0
- package/dist/providers/togetherai.d.ts +2 -0
- package/dist/providers/venice.d.ts +1 -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/providers/volcengine/videos.d.ts +2 -0
- package/dist/providers/volcengine/videos.js +1 -0
- package/dist/providers/volcengine.d.ts +26 -0
- package/dist/providers/volcengine.js +21 -0
- package/dist/providers/xai.d.ts +1 -0
- package/dist/providers/zai-coding-plan.d.ts +1 -0
- package/dist/providers/zai.d.ts +1 -0
- package/dist/public.d.ts +4 -0
- package/dist/public.js +2 -0
- package/dist/route/embedding.d.ts +61 -0
- package/dist/route/embedding.js +88 -0
- package/dist/route/executor-service.d.ts +6 -0
- package/dist/route/executor-service.js +7 -0
- package/dist/route/executor.d.ts +7 -1
- package/dist/route/executor.js +7 -2
- package/dist/route/media-protocol.d.ts +12 -11
- package/dist/route/media.d.ts +2 -0
- package/dist/route/media.js +31 -22
- package/dist/route/transport/http.js +1 -1
- package/dist/schema/messages.d.ts +1 -1
- package/dist/schema/messages.js +1 -5
- package/dist/schema/options.d.ts +8 -0
- package/dist/schema/options.js +1 -0
- package/dist/speech-client.d.ts +1 -1
- package/dist/speech-client.js +4 -4
- package/dist/transcription-client.d.ts +1 -1
- package/dist/transcription-client.js +1 -2
- package/dist/video-client.d.ts +16 -84
- package/dist/video-client.js +28 -13
- package/dist/video.d.ts +56 -1072
- package/dist/video.js +28 -65
- package/package.json +355 -255
- package/dist/protocols/google-video.d.ts +0 -26
- package/dist/protocols/google-video.js +0 -146
- package/dist/protocols/runway-video.d.ts +0 -38
- package/dist/protocols/runway-video.js +0 -141
- package/dist/providers/runway.d.ts +0 -20
- package/dist/providers/runway.js +0 -17
|
@@ -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"> & {
|
|
@@ -112,6 +112,7 @@ export declare const route: Route<{
|
|
|
112
112
|
readonly reasoning?: string | undefined;
|
|
113
113
|
readonly reasoning_text?: string | undefined;
|
|
114
114
|
readonly reasoning_details?: unknown;
|
|
115
|
+
readonly reasoning_opaque?: string | undefined;
|
|
115
116
|
})[];
|
|
116
117
|
readonly tools?: readonly ({
|
|
117
118
|
readonly type: "function";
|
|
@@ -286,6 +287,7 @@ export declare const routes: Route<{
|
|
|
286
287
|
readonly reasoning?: string | undefined;
|
|
287
288
|
readonly reasoning_text?: string | undefined;
|
|
288
289
|
readonly reasoning_details?: unknown;
|
|
290
|
+
readonly reasoning_opaque?: string | undefined;
|
|
289
291
|
})[];
|
|
290
292
|
readonly tools?: readonly ({
|
|
291
293
|
readonly type: "function";
|
|
@@ -363,12 +365,15 @@ export declare const routes: Route<{
|
|
|
363
365
|
export declare const configure: (input?: Config) => {
|
|
364
366
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
365
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>;
|
|
366
369
|
configure: typeof configure;
|
|
367
370
|
};
|
|
368
371
|
export declare const provider: {
|
|
369
372
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
370
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>;
|
|
371
375
|
configure: typeof configure;
|
|
372
376
|
};
|
|
373
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>;
|
|
374
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 { decisionModel as model } from "../google.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../google.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { videoModel as model } from "../google.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../google-vertex.js";
|
|
@@ -117,6 +117,7 @@ export declare const routes: Route<{
|
|
|
117
117
|
readonly reasoning?: string | undefined;
|
|
118
118
|
readonly reasoning_text?: string | undefined;
|
|
119
119
|
readonly reasoning_details?: unknown;
|
|
120
|
+
readonly reasoning_opaque?: string | undefined;
|
|
120
121
|
})[];
|
|
121
122
|
readonly tools?: readonly ({
|
|
122
123
|
readonly type: "function";
|
|
@@ -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,14 +2,18 @@ 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";
|
|
6
|
+
import { GoogleDecisions } from "../protocols/google-decisions.js";
|
|
5
7
|
import { GoogleInteractions } from "../protocols/google-interactions.js";
|
|
8
|
+
export type { OptionsInput as GoogleEmbeddingOptions } from "../protocols/google-embed-content.js";
|
|
6
9
|
export type { GoogleImageOptions } from "../protocols/google-images.js";
|
|
10
|
+
export type { GoogleVideoOptions } from "../protocols/google-interactions-video.js";
|
|
7
11
|
export type { GoogleSpeechOptions } from "../protocols/google-speech.js";
|
|
8
12
|
export type { GoogleTranscriptionOptions } from "../protocols/google-transcription.js";
|
|
9
|
-
export type { GoogleVideoOptions } from "../protocols/google-video.js";
|
|
10
13
|
export type GeminiOptionsInput = Gemini.OptionsInput;
|
|
11
14
|
export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
|
|
12
15
|
export type GoogleInteractionsOptionsInput = GoogleInteractions.OptionsInput;
|
|
16
|
+
export type GoogleDecisionsOptionsInput = GoogleDecisions.OptionsInput;
|
|
13
17
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
14
18
|
export declare const routes: (import("../route.js").Route<{
|
|
15
19
|
readonly cachedContent?: string | undefined;
|
|
@@ -178,9 +182,11 @@ export declare const configure: (input?: Config) => {
|
|
|
178
182
|
readonly serviceTier?: import("../schema/options.js").OpenString<"deferred" | "flex" | "priority" | "standard"> | undefined;
|
|
179
183
|
}, import("../route.js").CompactionOperations | undefined>;
|
|
180
184
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
181
|
-
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
185
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-interactions-video.js").GoogleVideoOptions>;
|
|
182
186
|
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
183
187
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
188
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
189
|
+
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<GoogleDecisions.OptionsInput>;
|
|
184
190
|
configure: typeof configure;
|
|
185
191
|
};
|
|
186
192
|
export declare const provider: {
|
|
@@ -195,14 +201,21 @@ export declare const provider: {
|
|
|
195
201
|
readonly serviceTier?: import("../schema/options.js").OpenString<"deferred" | "flex" | "priority" | "standard"> | undefined;
|
|
196
202
|
}, import("../route.js").CompactionOperations | undefined>;
|
|
197
203
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
198
|
-
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
204
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-interactions-video.js").GoogleVideoOptions>;
|
|
199
205
|
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
200
206
|
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
207
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
208
|
+
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<GoogleDecisions.OptionsInput>;
|
|
201
209
|
configure: typeof configure;
|
|
202
210
|
};
|
|
203
211
|
export declare const model: ProviderPackage.Model<Settings, Gemini.ProviderOptionsInput>;
|
|
204
212
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
213
|
+
export declare const videoModel: (modelID: string, settings?: Settings) => import("../video.js").VideoModel<import("../protocols/google-interactions-video.js").GoogleVideoOptions>;
|
|
214
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
215
|
+
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<GoogleDecisions.OptionsInput>;
|
|
205
216
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
217
|
+
export declare const video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-interactions-video.js").GoogleVideoOptions>;
|
|
218
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<GoogleEmbeddingOptionsInput>;
|
|
206
219
|
export declare const gemini: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.OptionsInput, import("../route.js").CompactionOperations | undefined>;
|
|
207
220
|
export declare const interactions: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
208
221
|
readonly previousInteractionId?: string | undefined;
|
|
@@ -211,6 +224,6 @@ export declare const interactions: (modelID: string | ModelID) => import("../sch
|
|
|
211
224
|
readonly thinkingSummaries?: import("../schema/options.js").OpenString<"auto" | "none"> | undefined;
|
|
212
225
|
readonly serviceTier?: import("../schema/options.js").OpenString<"deferred" | "flex" | "priority" | "standard"> | undefined;
|
|
213
226
|
}, import("../route.js").CompactionOperations | undefined>;
|
|
214
|
-
export declare const video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
215
227
|
export declare const speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
216
228
|
export declare const transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
229
|
+
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<GoogleDecisions.OptionsInput>;
|
package/dist/providers/google.js
CHANGED
|
@@ -3,11 +3,13 @@ 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";
|
|
7
|
+
import { GoogleDecisions } from "../protocols/google-decisions.js";
|
|
6
8
|
import { GoogleInteractions } from "../protocols/google-interactions.js";
|
|
9
|
+
import { GoogleInteractionsVideo } from "../protocols/google-interactions-video.js";
|
|
7
10
|
import { GoogleImages } from "../protocols/google-images.js";
|
|
8
11
|
import { GoogleSpeech } from "../protocols/google-speech.js";
|
|
9
12
|
import { GoogleTranscription } from "../protocols/google-transcription.js";
|
|
10
|
-
import { GoogleVideo } from "../protocols/google-video.js";
|
|
11
13
|
import { toConfig } from "./settings.js";
|
|
12
14
|
export const id = ProviderID.make("google");
|
|
13
15
|
export const routes = [Gemini.route, GoogleInteractions.route];
|
|
@@ -24,15 +26,26 @@ export const configure = (input = {}) => {
|
|
|
24
26
|
const route = configuredRoute(input);
|
|
25
27
|
const media = MediaRoute.deployment(input, auth(input));
|
|
26
28
|
const gemini = (modelID) => route.model({ id: modelID });
|
|
29
|
+
const embeddingRoute = GoogleEmbedContent.route.with({
|
|
30
|
+
provider: id,
|
|
31
|
+
endpoint: { baseURL: input.baseURL },
|
|
32
|
+
auth: auth(input),
|
|
33
|
+
headers: input.headers,
|
|
34
|
+
http: input.http,
|
|
35
|
+
});
|
|
27
36
|
return {
|
|
28
37
|
id,
|
|
29
38
|
model: gemini,
|
|
30
39
|
gemini,
|
|
31
40
|
interactions: (modelID) => interactionsRoute(input).model({ id: modelID }),
|
|
32
41
|
image: (modelID, providerOptions) => GoogleImages.model({ ...media, id: modelID, providerOptions }),
|
|
33
|
-
video: (modelID) =>
|
|
42
|
+
video: (modelID) => GoogleInteractionsVideo.model({ ...media, id: modelID }),
|
|
34
43
|
speech: (modelID) => GoogleSpeech.model({ ...media, id: modelID }),
|
|
35
44
|
transcription: (modelID) => GoogleTranscription.model({ ...media, id: modelID }),
|
|
45
|
+
embedding: (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions }),
|
|
46
|
+
decision: (modelID, providerOptions) => GoogleDecisions.route
|
|
47
|
+
.with({ endpoint: { baseURL: media.baseURL }, auth: media.auth, headers: media.headers, http: media.http })
|
|
48
|
+
.model({ id: modelID, providerOptions }),
|
|
36
49
|
configure,
|
|
37
50
|
};
|
|
38
51
|
};
|
|
@@ -42,9 +55,20 @@ export const imageModel = (modelID, settings) => {
|
|
|
42
55
|
const input = toConfig(settings);
|
|
43
56
|
return configure(input).image(modelID, input.providerOptions);
|
|
44
57
|
};
|
|
58
|
+
export const videoModel = (modelID, settings) => configure(toConfig(settings)).video(modelID);
|
|
59
|
+
export const embeddingModel = (modelID, settings) => {
|
|
60
|
+
const input = toConfig(settings);
|
|
61
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
62
|
+
};
|
|
63
|
+
export const decisionModel = (modelID, settings) => {
|
|
64
|
+
const input = toConfig(settings);
|
|
65
|
+
return configure(input).decision(modelID, input.providerOptions);
|
|
66
|
+
};
|
|
45
67
|
export const image = provider.image;
|
|
68
|
+
export const video = provider.video;
|
|
69
|
+
export const embedding = provider.embedding;
|
|
46
70
|
export const gemini = provider.gemini;
|
|
47
71
|
export const interactions = provider.interactions;
|
|
48
|
-
export const video = provider.video;
|
|
49
72
|
export const speech = provider.speech;
|
|
50
73
|
export const transcription = provider.transcription;
|
|
74
|
+
export const decision = provider.decision;
|
package/dist/providers/groq.d.ts
CHANGED
|
@@ -121,6 +121,7 @@ export declare const protocol: Protocol<{
|
|
|
121
121
|
readonly reasoning?: string | undefined;
|
|
122
122
|
readonly reasoning_text?: string | undefined;
|
|
123
123
|
readonly reasoning_details?: unknown;
|
|
124
|
+
readonly reasoning_opaque?: string | undefined;
|
|
124
125
|
})[];
|
|
125
126
|
readonly tools?: readonly ({
|
|
126
127
|
readonly type: "function";
|
|
@@ -209,6 +210,7 @@ export declare const protocol: Protocol<{
|
|
|
209
210
|
readonly reasoning?: string | null | undefined;
|
|
210
211
|
readonly reasoning_text?: string | null | undefined;
|
|
211
212
|
readonly reasoning_details?: unknown;
|
|
213
|
+
readonly reasoning_opaque?: string | null | undefined;
|
|
212
214
|
readonly tool_calls?: readonly {
|
|
213
215
|
readonly index?: number | null | undefined;
|
|
214
216
|
readonly id?: string | null | undefined;
|
|
@@ -234,6 +236,7 @@ export declare const protocol: Protocol<{
|
|
|
234
236
|
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
235
237
|
readonly cache_read_input_tokens?: number | null | undefined;
|
|
236
238
|
readonly cache_created_input_tokens?: number | null | undefined;
|
|
239
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
237
240
|
readonly prompt_tokens_details?: {
|
|
238
241
|
readonly [x: string]: unknown;
|
|
239
242
|
readonly cached_tokens?: number | null | undefined;
|
|
@@ -256,6 +259,7 @@ export declare const protocol: Protocol<{
|
|
|
256
259
|
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
257
260
|
readonly cache_read_input_tokens?: number | null | undefined;
|
|
258
261
|
readonly cache_created_input_tokens?: number | null | undefined;
|
|
262
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
259
263
|
readonly prompt_tokens_details?: {
|
|
260
264
|
readonly [x: string]: unknown;
|
|
261
265
|
readonly cached_tokens?: number | null | undefined;
|
|
@@ -374,6 +378,7 @@ export declare const route: Route<{
|
|
|
374
378
|
readonly reasoning?: string | undefined;
|
|
375
379
|
readonly reasoning_text?: string | undefined;
|
|
376
380
|
readonly reasoning_details?: unknown;
|
|
381
|
+
readonly reasoning_opaque?: string | undefined;
|
|
377
382
|
})[];
|
|
378
383
|
readonly tools?: readonly ({
|
|
379
384
|
readonly type: "function";
|
|
@@ -6,6 +6,7 @@ export * as AmazonBedrockMantle from "./amazon-bedrock-mantle.js";
|
|
|
6
6
|
export * as AssemblyAI from "./assemblyai.js";
|
|
7
7
|
export * as Azure from "./azure.js";
|
|
8
8
|
export * as Baseten from "./baseten.js";
|
|
9
|
+
export * as BytePlus from "./byteplus.js";
|
|
9
10
|
export * as Cartesia from "./cartesia.js";
|
|
10
11
|
export * as Cerebras from "./cerebras.js";
|
|
11
12
|
export * as Cohere from "./cohere.js";
|
|
@@ -34,11 +35,11 @@ export * as OpenAICompatible from "./openai-compatible.js";
|
|
|
34
35
|
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
35
36
|
export * as OpenCode from "./opencode.js";
|
|
36
37
|
export * as OpenRouter from "./openrouter.js";
|
|
37
|
-
export * as Runway from "./runway.js";
|
|
38
38
|
export * as TogetherAI from "./togetherai.js";
|
|
39
39
|
export * as TypeSafeAI from "./typesafe-ai.js";
|
|
40
40
|
export * as VercelAIGateway from "./vercel-ai-gateway.js";
|
|
41
41
|
export * as Venice from "./venice.js";
|
|
42
|
+
export * as Volcengine from "./volcengine.js";
|
|
42
43
|
export * as XAI from "./xai.js";
|
|
43
44
|
export * as ZAI from "./zai.js";
|
|
44
45
|
export * as ZAICodingPlan from "./zai-coding-plan.js";
|
package/dist/providers/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * as AmazonBedrockMantle from "./amazon-bedrock-mantle.js";
|
|
|
6
6
|
export * as AssemblyAI from "./assemblyai.js";
|
|
7
7
|
export * as Azure from "./azure.js";
|
|
8
8
|
export * as Baseten from "./baseten.js";
|
|
9
|
+
export * as BytePlus from "./byteplus.js";
|
|
9
10
|
export * as Cartesia from "./cartesia.js";
|
|
10
11
|
export * as Cerebras from "./cerebras.js";
|
|
11
12
|
export * as Cohere from "./cohere.js";
|
|
@@ -34,11 +35,11 @@ export * as OpenAICompatible from "./openai-compatible.js";
|
|
|
34
35
|
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
35
36
|
export * as OpenCode from "./opencode.js";
|
|
36
37
|
export * as OpenRouter from "./openrouter.js";
|
|
37
|
-
export * as Runway from "./runway.js";
|
|
38
38
|
export * as TogetherAI from "./togetherai.js";
|
|
39
39
|
export * as TypeSafeAI from "./typesafe-ai.js";
|
|
40
40
|
export * as VercelAIGateway from "./vercel-ai-gateway.js";
|
|
41
41
|
export * as Venice from "./venice.js";
|
|
42
|
+
export * as Volcengine from "./volcengine.js";
|
|
42
43
|
export * as XAI from "./xai.js";
|
|
43
44
|
export * as ZAI from "./zai.js";
|
|
44
45
|
export * as ZAICodingPlan from "./zai-coding-plan.js";
|
package/dist/providers/meta.d.ts
CHANGED
|
@@ -335,6 +335,7 @@ export declare const routes: (Route<{
|
|
|
335
335
|
readonly reasoning?: string | undefined;
|
|
336
336
|
readonly reasoning_text?: string | undefined;
|
|
337
337
|
readonly reasoning_details?: unknown;
|
|
338
|
+
readonly reasoning_opaque?: string | undefined;
|
|
338
339
|
})[];
|
|
339
340
|
readonly tools?: readonly ({
|
|
340
341
|
readonly type: "function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { videoModel as model } from "../minimax.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
3
|
import { type MiniMaxImageOptions } from "../protocols/minimax-images.js";
|
|
4
|
+
import { type MiniMaxVideoOptions } from "../protocols/minimax-video.js";
|
|
4
5
|
import type { ProviderAuthOption } from "../route/auth-options.js";
|
|
5
6
|
import { Route } from "../route/client.js";
|
|
6
7
|
import { type ModelID, type ProviderOptions, type RequestOptions } from "../schema/index.js";
|
|
@@ -34,7 +35,7 @@ export type Settings<Options = MessagesOptionsInput> = ProviderPackage.Settings
|
|
|
34
35
|
readonly apiKey?: string | false;
|
|
35
36
|
readonly baseURL?: string;
|
|
36
37
|
};
|
|
37
|
-
export type { MiniMaxImageOptions };
|
|
38
|
+
export type { MiniMaxImageOptions, MiniMaxVideoOptions };
|
|
38
39
|
export declare const routes: (Route<{
|
|
39
40
|
readonly context_management?: {
|
|
40
41
|
readonly edits: readonly {
|
|
@@ -639,6 +640,7 @@ export declare const routes: (Route<{
|
|
|
639
640
|
readonly reasoning?: string | undefined;
|
|
640
641
|
readonly reasoning_text?: string | undefined;
|
|
641
642
|
readonly reasoning_details?: unknown;
|
|
643
|
+
readonly reasoning_opaque?: string | undefined;
|
|
642
644
|
})[];
|
|
643
645
|
readonly tools?: readonly ({
|
|
644
646
|
readonly type: "function";
|
|
@@ -724,6 +726,7 @@ export declare const configure: (input?: Config) => {
|
|
|
724
726
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
725
727
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
726
728
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
729
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
727
730
|
configure: typeof configure;
|
|
728
731
|
};
|
|
729
732
|
export declare const provider: {
|
|
@@ -733,12 +736,15 @@ export declare const provider: {
|
|
|
733
736
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
734
737
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
735
738
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
739
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
736
740
|
configure: typeof configure;
|
|
737
741
|
};
|
|
738
742
|
export declare const model: ProviderPackage.Model<Settings<MessagesOptionsInput>, MessagesOptionsInput>;
|
|
739
743
|
export declare const imageModel: (modelID: string, settings?: Settings<MiniMaxImageOptions>) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
744
|
+
export declare const videoModel: (modelID: string, settings?: Settings<MiniMaxVideoOptions>) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
740
745
|
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
741
746
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
742
747
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
743
748
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
749
|
+
export declare const video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<MiniMaxVideoOptions>;
|
|
744
750
|
export * as MiniMax from "./minimax.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
3
|
import { MiniMaxImages } from "../protocols/minimax-images.js";
|
|
4
|
+
import { MiniMaxVideo } from "../protocols/minimax-video.js";
|
|
4
5
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
5
6
|
import { OpenResponses } from "../protocols/open-responses.js";
|
|
6
7
|
import { ProviderShared } from "../protocols/shared.js";
|
|
@@ -75,7 +76,10 @@ export const configure = (input = {}) => {
|
|
|
75
76
|
const responses = (modelID) => responsesRoute.with(defaults).model({ id: modelID });
|
|
76
77
|
const media = MediaRoute.deployment(input, defaults.auth);
|
|
77
78
|
const image = (modelID, providerOptions) => MiniMaxImages.model({ ...media, id: modelID, providerOptions });
|
|
78
|
-
|
|
79
|
+
// H3 is under /v2 and Hailuo under /v1, so video drops the version a shared `baseURL` carries for the other APIs.
|
|
80
|
+
const videoBaseURL = media.baseURL?.replace(/(\/v1)?\/*$/, "");
|
|
81
|
+
const video = (modelID, providerOptions) => MiniMaxVideo.model({ ...media, baseURL: videoBaseURL, id: modelID, providerOptions });
|
|
82
|
+
return { id, model: messages, messages, chat, responses, image, video, configure };
|
|
79
83
|
};
|
|
80
84
|
export const provider = configure();
|
|
81
85
|
export const model = (modelID, settings) => configure(toConfig(settings)).model(modelID);
|
|
@@ -83,8 +87,13 @@ export const imageModel = (modelID, settings) => {
|
|
|
83
87
|
const input = toConfig(settings);
|
|
84
88
|
return configure(input).image(modelID, input.providerOptions);
|
|
85
89
|
};
|
|
90
|
+
export const videoModel = (modelID, settings) => {
|
|
91
|
+
const input = toConfig(settings);
|
|
92
|
+
return configure(input).video(modelID, input.providerOptions);
|
|
93
|
+
};
|
|
86
94
|
export const messages = provider.messages;
|
|
87
95
|
export const chat = provider.chat;
|
|
88
96
|
export const responses = provider.responses;
|
|
89
97
|
export const image = provider.image;
|
|
98
|
+
export const video = provider.video;
|
|
90
99
|
export * as MiniMax from "./minimax.js";
|
|
@@ -635,6 +635,7 @@ export declare const routes: (Route<{
|
|
|
635
635
|
readonly reasoning?: string | undefined;
|
|
636
636
|
readonly reasoning_text?: string | undefined;
|
|
637
637
|
readonly reasoning_details?: unknown;
|
|
638
|
+
readonly reasoning_opaque?: string | undefined;
|
|
638
639
|
})[];
|
|
639
640
|
readonly tools?: readonly ({
|
|
640
641
|
readonly type: "function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../openai.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { decisionModel as model } from "../openai-compatible.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";
|
|
@@ -113,6 +114,7 @@ export declare const routes: import("../route.js").Route<{
|
|
|
113
114
|
readonly reasoning?: string | undefined;
|
|
114
115
|
readonly reasoning_text?: string | undefined;
|
|
115
116
|
readonly reasoning_details?: unknown;
|
|
117
|
+
readonly reasoning_opaque?: string | undefined;
|
|
116
118
|
})[];
|
|
117
119
|
readonly tools?: readonly ({
|
|
118
120
|
readonly type: "function";
|
|
@@ -191,6 +193,8 @@ export declare const configure: (input: Config) => {
|
|
|
191
193
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
192
194
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route.js").CompactionOperations | undefined>;
|
|
193
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>;
|
|
197
|
+
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
194
198
|
configure: typeof configure;
|
|
195
199
|
};
|
|
196
200
|
export declare const provider: {
|
|
@@ -199,4 +203,6 @@ export declare const provider: {
|
|
|
199
203
|
};
|
|
200
204
|
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
201
205
|
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
206
|
+
export declare const embeddingModel: (modelID: string, settings: Settings) => import("../embedding.js").EmbeddingModel<OpenAIEmbeddingOptionsInput>;
|
|
207
|
+
export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
202
208
|
export * as OpenAICompatible from "./openai-compatible.js";
|