@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
package/dist/provider-error.js
CHANGED
|
@@ -110,6 +110,12 @@ const CONTENT_POLICY_CODES = new Set([
|
|
|
110
110
|
"refusal",
|
|
111
111
|
"datainspectionfailed",
|
|
112
112
|
"moderation_blocked",
|
|
113
|
+
// Gemini Decisions rejects blocked input with these `error.code` strings on a 400.
|
|
114
|
+
"safety",
|
|
115
|
+
"prohibited_content",
|
|
116
|
+
"blocklist",
|
|
117
|
+
"image_safety",
|
|
118
|
+
"content_blocked",
|
|
113
119
|
]);
|
|
114
120
|
// OpenCode Zen replaces upstream codes outside its allow-list but keeps the original
|
|
115
121
|
// as a `[code]` label at the start of the rewritten message.
|
|
@@ -120,7 +126,7 @@ const RATE_LIMIT_TEXT = /rate increased too quickly|rate[-_\s]?limit|too[_\s]?ma
|
|
|
120
126
|
// Only consulted on 429, where throttles and account caps share a status.
|
|
121
127
|
// Z.ai reports balance, plan expiry, plan limits, and plan model access on 429.
|
|
122
128
|
// Cerebras reports its per-minute token throttle as `token_quota_exceeded`; that is a rate limit.
|
|
123
|
-
const QUOTA_TEXT = /insufficient[-_\s]?(?:quota|balance)|(?<!token_)quota[-_\s]?exceeded|budget exceeded|usage limit|limit exhausted|package has expired|plan does not yet include/i;
|
|
129
|
+
const QUOTA_TEXT = /insufficient[-_\s]?(?:quota|balance)|(?<!token_)quota[-_\s]?exceeded|budget exceeded|usage limit|(?<!rate[-_\s]?)limit exhausted|package has expired|plan does not yet include/i;
|
|
124
130
|
// Policy rejections without a dedicated code, matched against the provider's own
|
|
125
131
|
// explanation only. OpenAI reuses `invalid_prompt` for usage-policy rejections while
|
|
126
132
|
// Bedrock Mantle reuses it for schema validation; Anthropic reports blocked output
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../alibaba.js";
|
|
@@ -124,6 +124,7 @@ export declare const routes: (Route<{
|
|
|
124
124
|
readonly reasoning?: string | undefined;
|
|
125
125
|
readonly reasoning_text?: string | undefined;
|
|
126
126
|
readonly reasoning_details?: unknown;
|
|
127
|
+
readonly reasoning_opaque?: string | undefined;
|
|
127
128
|
})[];
|
|
128
129
|
readonly tools?: readonly ({
|
|
129
130
|
readonly type: "function";
|
|
@@ -775,6 +776,7 @@ export declare const configure: (input: Config) => {
|
|
|
775
776
|
readonly conversation?: string | undefined;
|
|
776
777
|
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
777
778
|
image: (id: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("./alibaba.js").AlibabaImageOptions>;
|
|
779
|
+
embedding: (id: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
778
780
|
configure: typeof configure;
|
|
779
781
|
};
|
|
780
782
|
export declare const provider: {
|
|
@@ -848,6 +850,7 @@ export declare const responses: ProviderPackage.Model<Settings<{
|
|
|
848
850
|
readonly conversation?: string | undefined;
|
|
849
851
|
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
850
852
|
export declare const imageModel: (id: string, settings: Settings) => import("../image.js").ImageModel<import("./alibaba.js").AlibabaImageOptions>;
|
|
853
|
+
export declare const embeddingModel: (id: string, settings: Settings) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
851
854
|
export declare const webSearch: () => ToolDefinition;
|
|
852
855
|
export declare const webExtractor: () => ToolDefinition;
|
|
853
856
|
export declare const codeInterpreter: () => ToolDefinition;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Struct } from "effect";
|
|
2
2
|
import { AlibabaChat } from "../protocols/alibaba-chat.js";
|
|
3
3
|
import { AlibabaImages } from "../protocols/alibaba-images.js";
|
|
4
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
4
5
|
import { AlibabaMessages } from "../protocols/alibaba-messages.js";
|
|
5
6
|
import { AlibabaResponses } from "../protocols/alibaba-responses.js";
|
|
6
7
|
import { AuthOptions } from "../route/auth-options.js";
|
|
@@ -72,7 +73,15 @@ export const configure = (input) => {
|
|
|
72
73
|
const responses = (id) => responsesRoute.with(common).model({ id });
|
|
73
74
|
const media = MediaRoute.deployment({ ...input, baseURL: baseURL ?? `https://${host}/api/v1` }, opts.auth);
|
|
74
75
|
const image = (id, providerOptions) => AlibabaImages.model({ ...media, id, providerOptions });
|
|
75
|
-
|
|
76
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
77
|
+
provider: id,
|
|
78
|
+
endpoint: common.endpoint,
|
|
79
|
+
auth: opts.auth,
|
|
80
|
+
headers: input.headers,
|
|
81
|
+
http: input.http,
|
|
82
|
+
});
|
|
83
|
+
const embedding = (id, providerOptions) => embeddingRoute.model({ id, providerOptions });
|
|
84
|
+
return { id, model: chat, chat, messages, responses, image, embedding, configure };
|
|
76
85
|
};
|
|
77
86
|
export const provider = { id, configure };
|
|
78
87
|
export const model = (id, input) => configure(config(input)).chat(id);
|
|
@@ -85,6 +94,10 @@ export const imageModel = (id, settings) => {
|
|
|
85
94
|
const input = config(settings);
|
|
86
95
|
return configure(input).image(id, input.providerOptions);
|
|
87
96
|
};
|
|
97
|
+
export const embeddingModel = (id, settings) => {
|
|
98
|
+
const input = config(settings);
|
|
99
|
+
return configure(input).embedding(id, input.providerOptions);
|
|
100
|
+
};
|
|
88
101
|
function config(input) {
|
|
89
102
|
const { body, ...rest } = input;
|
|
90
103
|
return {
|
|
@@ -641,6 +641,7 @@ export declare const routes: (Route<{
|
|
|
641
641
|
readonly reasoning?: string | undefined;
|
|
642
642
|
readonly reasoning_text?: string | undefined;
|
|
643
643
|
readonly reasoning_details?: unknown;
|
|
644
|
+
readonly reasoning_opaque?: string | undefined;
|
|
644
645
|
})[];
|
|
645
646
|
readonly tools?: readonly ({
|
|
646
647
|
readonly type: "function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../azure.js";
|
|
@@ -661,6 +661,7 @@ export declare const routes: (Route<{
|
|
|
661
661
|
readonly reasoning?: string | undefined;
|
|
662
662
|
readonly reasoning_text?: string | undefined;
|
|
663
663
|
readonly reasoning_details?: unknown;
|
|
664
|
+
readonly reasoning_opaque?: string | undefined;
|
|
664
665
|
})[];
|
|
665
666
|
readonly tools?: readonly ({
|
|
666
667
|
readonly type: "function";
|
|
@@ -977,6 +978,7 @@ export declare const configure: (input: Config) => {
|
|
|
977
978
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, CompactionOperations | undefined>;
|
|
978
979
|
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<AnthropicMessages.OptionsInput, CompactionOperations | undefined>;
|
|
979
980
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
981
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
980
982
|
configure: typeof configure;
|
|
981
983
|
};
|
|
982
984
|
export declare const provider: {
|
|
@@ -987,6 +989,7 @@ export declare const responsesModel: ProviderPackage.Model<Settings, OpenAIProvi
|
|
|
987
989
|
export declare const chatModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
988
990
|
export declare const messagesModel: ProviderPackage.Model<MessagesSettings, AnthropicMessages.ProviderOptionsInput>;
|
|
989
991
|
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
992
|
+
export declare const embeddingModel: (modelID: string, settings: Settings) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
990
993
|
export declare const model: ProviderPackage.Model<Settings<import("./openai-options.js").OpenAIOptionsInput>, import("./openai-options.js").OpenAIOptionsInput, {
|
|
991
994
|
endpoint: import("../route/client.js").CompactOperation;
|
|
992
995
|
}>;
|
package/dist/providers/azure.js
CHANGED
|
@@ -5,6 +5,7 @@ import { MediaRoute } from "../route/media.js";
|
|
|
5
5
|
import { ProviderConfigurationError, ProviderID, } from "../schema/index.js";
|
|
6
6
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
7
7
|
import { OpenAIImages } from "../protocols/openai-images.js";
|
|
8
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
8
9
|
import * as OpenAIChat from "../protocols/openai-chat.js";
|
|
9
10
|
import * as OpenAIResponses from "../protocols/openai-responses.js";
|
|
10
11
|
import { withOpenAIOptions } from "./openai-options.js";
|
|
@@ -100,6 +101,15 @@ export const configure = (input) => {
|
|
|
100
101
|
http: { ...media.http, query: { ...media.http?.query, ...target.query } },
|
|
101
102
|
});
|
|
102
103
|
};
|
|
104
|
+
const embedding = (modelID, providerOptions) => OpenAIEmbeddings.route
|
|
105
|
+
.with({
|
|
106
|
+
provider: id,
|
|
107
|
+
endpoint: endpoint(input, modelID),
|
|
108
|
+
auth: auth(input),
|
|
109
|
+
headers: input.headers,
|
|
110
|
+
http: input.http,
|
|
111
|
+
})
|
|
112
|
+
.model({ id: modelID, providerOptions });
|
|
103
113
|
return {
|
|
104
114
|
id,
|
|
105
115
|
model: responses,
|
|
@@ -107,6 +117,7 @@ export const configure = (input) => {
|
|
|
107
117
|
chat,
|
|
108
118
|
messages,
|
|
109
119
|
image,
|
|
120
|
+
embedding,
|
|
110
121
|
configure,
|
|
111
122
|
};
|
|
112
123
|
};
|
|
@@ -137,6 +148,10 @@ export const imageModel = (modelID, settings) => {
|
|
|
137
148
|
const input = config(settings);
|
|
138
149
|
return configure(input).image(modelID, input.providerOptions);
|
|
139
150
|
};
|
|
151
|
+
export const embeddingModel = (modelID, settings) => {
|
|
152
|
+
const input = config(settings);
|
|
153
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
154
|
+
};
|
|
140
155
|
export const model = responsesModel;
|
|
141
156
|
export const responses = responsesModel;
|
|
142
157
|
export const chat = chatModel;
|
|
@@ -116,6 +116,7 @@ export declare const route: Route<{
|
|
|
116
116
|
readonly reasoning?: string | undefined;
|
|
117
117
|
readonly reasoning_text?: string | undefined;
|
|
118
118
|
readonly reasoning_details?: unknown;
|
|
119
|
+
readonly reasoning_opaque?: string | undefined;
|
|
119
120
|
})[];
|
|
120
121
|
readonly tools?: readonly ({
|
|
121
122
|
readonly type: "function";
|
|
@@ -290,6 +291,7 @@ export declare const routes: Route<{
|
|
|
290
291
|
readonly reasoning?: string | undefined;
|
|
291
292
|
readonly reasoning_text?: string | undefined;
|
|
292
293
|
readonly reasoning_details?: unknown;
|
|
294
|
+
readonly reasoning_opaque?: string | undefined;
|
|
293
295
|
})[];
|
|
294
296
|
readonly tools?: readonly ({
|
|
295
297
|
readonly type: "function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { videoModel as model } from "../byteplus.js";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
2
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
3
|
+
import { type HttpOptions, type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
4
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
5
|
+
export type Config = ProviderAuthOption<"optional"> & {
|
|
6
|
+
readonly baseURL?: string;
|
|
7
|
+
readonly headers?: Record<string, string>;
|
|
8
|
+
readonly http?: HttpOptions;
|
|
9
|
+
};
|
|
10
|
+
export type Settings = ProviderPackage.Settings & {
|
|
11
|
+
readonly apiKey?: string | false;
|
|
12
|
+
readonly baseURL?: string;
|
|
13
|
+
};
|
|
14
|
+
export type { SeedanceVideoOptions } from "../protocols/seedance-video.js";
|
|
15
|
+
export declare const configure: (input?: Config) => {
|
|
16
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
17
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<import("../protocols/seedance-video.js").SeedanceVideoOptions>;
|
|
18
|
+
configure: typeof configure;
|
|
19
|
+
};
|
|
20
|
+
export declare const provider: {
|
|
21
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
22
|
+
video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<import("../protocols/seedance-video.js").SeedanceVideoOptions>;
|
|
23
|
+
configure: typeof configure;
|
|
24
|
+
};
|
|
25
|
+
export declare const videoModel: (modelID: string, settings?: Settings) => import("../video.js").VideoModel<import("../protocols/seedance-video.js").SeedanceVideoOptions>;
|
|
26
|
+
export declare const video: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../video.js").VideoModel<import("../protocols/seedance-video.js").SeedanceVideoOptions>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SeedanceVideo } from "../protocols/seedance-video.js";
|
|
2
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
3
|
+
import { MediaRoute } from "../route/media.js";
|
|
4
|
+
import { ProviderID } from "../schema/index.js";
|
|
5
|
+
import { toConfig } from "./settings.js";
|
|
6
|
+
export const id = ProviderID.make("byteplus");
|
|
7
|
+
const auth = (options) => AuthOptions.bearer(options, "BYTEPLUS_API_KEY");
|
|
8
|
+
export const configure = (input = {}) => {
|
|
9
|
+
const media = MediaRoute.deployment(input, auth(input));
|
|
10
|
+
return {
|
|
11
|
+
id,
|
|
12
|
+
video: (modelID, providerOptions) => SeedanceVideo.byteplus.model({ ...media, id: modelID, providerOptions }),
|
|
13
|
+
configure,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export const provider = configure();
|
|
17
|
+
export const videoModel = (modelID, settings) => {
|
|
18
|
+
const input = toConfig(settings);
|
|
19
|
+
return configure(input).video(modelID, input.providerOptions);
|
|
20
|
+
};
|
|
21
|
+
export const video = provider.video;
|
|
@@ -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";
|
|
@@ -669,6 +669,7 @@ export declare const route: import("../route.js").Route<{
|
|
|
669
669
|
readonly reasoning?: string | undefined;
|
|
670
670
|
readonly reasoning_text?: string | undefined;
|
|
671
671
|
readonly reasoning_details?: unknown;
|
|
672
|
+
readonly reasoning_opaque?: string | undefined;
|
|
672
673
|
})[];
|
|
673
674
|
readonly tools?: readonly ({
|
|
674
675
|
readonly type: "function";
|
|
@@ -1150,6 +1151,7 @@ export declare const routes: (import("../route.js").Route<{
|
|
|
1150
1151
|
readonly reasoning?: string | undefined;
|
|
1151
1152
|
readonly reasoning_text?: string | undefined;
|
|
1152
1153
|
readonly reasoning_details?: unknown;
|
|
1154
|
+
readonly reasoning_opaque?: string | undefined;
|
|
1153
1155
|
})[];
|
|
1154
1156
|
readonly tools?: readonly ({
|
|
1155
1157
|
readonly type: "function";
|
|
@@ -119,6 +119,7 @@ export declare const route: Route<{
|
|
|
119
119
|
readonly reasoning?: string | undefined;
|
|
120
120
|
readonly reasoning_text?: string | undefined;
|
|
121
121
|
readonly reasoning_details?: unknown;
|
|
122
|
+
readonly reasoning_opaque?: string | undefined;
|
|
122
123
|
})[];
|
|
123
124
|
readonly tools?: readonly ({
|
|
124
125
|
readonly type: "function";
|
|
@@ -293,6 +294,7 @@ export declare const routes: Route<{
|
|
|
293
294
|
readonly reasoning?: string | undefined;
|
|
294
295
|
readonly reasoning_text?: string | undefined;
|
|
295
296
|
readonly reasoning_details?: unknown;
|
|
297
|
+
readonly reasoning_opaque?: string | undefined;
|
|
296
298
|
})[];
|
|
297
299
|
readonly tools?: readonly ({
|
|
298
300
|
readonly type: "function";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../cohere.js";
|
|
@@ -168,6 +168,7 @@ export declare const chatRoute: Route<{
|
|
|
168
168
|
readonly reasoning?: string | undefined;
|
|
169
169
|
readonly reasoning_text?: string | undefined;
|
|
170
170
|
readonly reasoning_details?: unknown;
|
|
171
|
+
readonly reasoning_opaque?: string | undefined;
|
|
171
172
|
})[];
|
|
172
173
|
readonly tools?: readonly ({
|
|
173
174
|
readonly type: "function";
|
|
@@ -393,6 +394,7 @@ export declare const routes: (Route<{
|
|
|
393
394
|
readonly reasoning?: string | undefined;
|
|
394
395
|
readonly reasoning_text?: string | undefined;
|
|
395
396
|
readonly reasoning_details?: unknown;
|
|
397
|
+
readonly reasoning_opaque?: string | undefined;
|
|
396
398
|
})[];
|
|
397
399
|
readonly tools?: readonly ({
|
|
398
400
|
readonly type: "function";
|
|
@@ -476,6 +478,8 @@ export declare const configure: (input?: Config) => {
|
|
|
476
478
|
} | undefined;
|
|
477
479
|
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
478
480
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
481
|
+
/** Embeddings through the OpenAI-compatible API; the native `/v2/embed` API is not wired up. */
|
|
482
|
+
embedding: (modelID: string | ModelID, providerOptions?: Readonly<Record<string, unknown>>) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
479
483
|
configure: typeof configure;
|
|
480
484
|
};
|
|
481
485
|
export declare const provider: {
|
|
@@ -487,8 +491,12 @@ export declare const provider: {
|
|
|
487
491
|
} | undefined;
|
|
488
492
|
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
489
493
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
494
|
+
/** Embeddings through the OpenAI-compatible API; the native `/v2/embed` API is not wired up. */
|
|
495
|
+
embedding: (modelID: string | ModelID, providerOptions?: Readonly<Record<string, unknown>>) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
490
496
|
configure: typeof configure;
|
|
491
497
|
};
|
|
492
498
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
499
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: Readonly<Record<string, unknown>>) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
493
500
|
export declare const model: ProviderPackage.Model<Settings, CohereChat.ProviderOptionsInput>;
|
|
501
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings<Readonly<Record<string, unknown>>>) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
494
502
|
export * as Cohere from "./cohere.js";
|
package/dist/providers/cohere.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CohereChat } from "../protocols/cohere-chat.js";
|
|
2
2
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
3
|
+
import { OpenAIEmbeddings } from "../protocols/openai-embeddings.js";
|
|
3
4
|
import { Route } from "../route/client.js";
|
|
4
5
|
import { Endpoint } from "../route/endpoint.js";
|
|
5
6
|
import { ProviderID } from "../schema/index.js";
|
|
@@ -19,7 +20,15 @@ export const routes = [route, chatRoute];
|
|
|
19
20
|
export const configure = (input = {}) => {
|
|
20
21
|
const options = bearerRouteDefaults(input, "COHERE_API_KEY", CohereChat.DEFAULT_BASE_URL);
|
|
21
22
|
const native = route.with(options);
|
|
22
|
-
const
|
|
23
|
+
const compatibility = { ...options, endpoint: { baseURL: input.baseURL ?? COMPATIBILITY_BASE_URL } };
|
|
24
|
+
const chat = chatRoute.with(compatibility);
|
|
25
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
26
|
+
provider: id,
|
|
27
|
+
endpoint: compatibility.endpoint,
|
|
28
|
+
auth: options.auth,
|
|
29
|
+
headers: input.headers,
|
|
30
|
+
http: input.http,
|
|
31
|
+
});
|
|
23
32
|
return {
|
|
24
33
|
id,
|
|
25
34
|
model: (modelID) => native.model({ id: modelID }),
|
|
@@ -31,10 +40,17 @@ export const configure = (input = {}) => {
|
|
|
31
40
|
},
|
|
32
41
|
capabilities: { tools: { strict: false } },
|
|
33
42
|
}),
|
|
43
|
+
/** Embeddings through the OpenAI-compatible API; the native `/v2/embed` API is not wired up. */
|
|
44
|
+
embedding: (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions }),
|
|
34
45
|
configure,
|
|
35
46
|
};
|
|
36
47
|
};
|
|
37
48
|
export const provider = configure();
|
|
38
49
|
export const chat = provider.chat;
|
|
50
|
+
export const embedding = provider.embedding;
|
|
39
51
|
export const model = (modelID, settings) => configure(toConfig(settings)).model(modelID);
|
|
52
|
+
export const embeddingModel = (modelID, settings) => {
|
|
53
|
+
const input = toConfig(settings);
|
|
54
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
55
|
+
};
|
|
40
56
|
export * as Cohere from "./cohere.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../deepinfra.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"> & {
|
|
@@ -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,11 +365,14 @@ 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>;
|
|
@@ -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";
|
|
@@ -16,11 +17,19 @@ export const route = Route.make({
|
|
|
16
17
|
export const routes = [route];
|
|
17
18
|
export const configure = (input = {}) => {
|
|
18
19
|
const root = input.baseURL?.replace(/\/+$/, "");
|
|
19
|
-
const
|
|
20
|
+
const options = {
|
|
20
21
|
...bearerRouteDefaults(input, "DEEPINFRA_API_KEY"),
|
|
21
22
|
endpoint: {
|
|
22
23
|
baseURL: root === undefined ? baseURL : root.endsWith("/openai") ? root : `${root}/openai`,
|
|
23
24
|
},
|
|
25
|
+
};
|
|
26
|
+
const configured = route.with(options);
|
|
27
|
+
const embeddingRoute = OpenAIEmbeddings.route.with({
|
|
28
|
+
provider: id,
|
|
29
|
+
endpoint: options.endpoint,
|
|
30
|
+
auth: options.auth,
|
|
31
|
+
headers: input.headers,
|
|
32
|
+
http: input.http,
|
|
24
33
|
});
|
|
25
34
|
return {
|
|
26
35
|
id,
|
|
@@ -32,8 +41,13 @@ export const configure = (input = {}) => {
|
|
|
32
41
|
},
|
|
33
42
|
capabilities: { promptCacheKey: true },
|
|
34
43
|
}),
|
|
44
|
+
embedding: (modelID, providerOptions) => embeddingRoute.model({ id: modelID, providerOptions }),
|
|
35
45
|
configure,
|
|
36
46
|
};
|
|
37
47
|
};
|
|
38
48
|
export const provider = configure();
|
|
39
49
|
export const model = (modelID, settings) => configure(toConfig(settings)).model(modelID);
|
|
50
|
+
export const embeddingModel = (modelID, settings) => {
|
|
51
|
+
const input = toConfig(settings);
|
|
52
|
+
return configure(input).embedding(modelID, input.providerOptions);
|
|
53
|
+
};
|
|
@@ -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";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { embeddingModel as model } from "../digitalocean.js";
|
|
@@ -114,6 +114,7 @@ export declare const protocol: Protocol<{
|
|
|
114
114
|
readonly reasoning?: string | undefined;
|
|
115
115
|
readonly reasoning_text?: string | undefined;
|
|
116
116
|
readonly reasoning_details?: unknown;
|
|
117
|
+
readonly reasoning_opaque?: string | undefined;
|
|
117
118
|
})[];
|
|
118
119
|
readonly tools?: readonly ({
|
|
119
120
|
readonly type: "function";
|
|
@@ -199,6 +200,7 @@ export declare const protocol: Protocol<{
|
|
|
199
200
|
readonly reasoning?: string | null | undefined;
|
|
200
201
|
readonly reasoning_text?: string | null | undefined;
|
|
201
202
|
readonly reasoning_details?: unknown;
|
|
203
|
+
readonly reasoning_opaque?: string | null | undefined;
|
|
202
204
|
readonly tool_calls?: readonly {
|
|
203
205
|
readonly index?: number | null | undefined;
|
|
204
206
|
readonly id?: string | null | undefined;
|
|
@@ -224,6 +226,7 @@ export declare const protocol: Protocol<{
|
|
|
224
226
|
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
225
227
|
readonly cache_read_input_tokens?: number | null | undefined;
|
|
226
228
|
readonly cache_created_input_tokens?: number | null | undefined;
|
|
229
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
227
230
|
readonly prompt_tokens_details?: {
|
|
228
231
|
readonly [x: string]: unknown;
|
|
229
232
|
readonly cached_tokens?: number | null | undefined;
|
|
@@ -246,6 +249,7 @@ export declare const protocol: Protocol<{
|
|
|
246
249
|
readonly prompt_cache_hit_tokens?: number | null | undefined;
|
|
247
250
|
readonly cache_read_input_tokens?: number | null | undefined;
|
|
248
251
|
readonly cache_created_input_tokens?: number | null | undefined;
|
|
252
|
+
readonly reasoning_tokens?: number | null | undefined;
|
|
249
253
|
readonly prompt_tokens_details?: {
|
|
250
254
|
readonly [x: string]: unknown;
|
|
251
255
|
readonly cached_tokens?: number | null | undefined;
|
|
@@ -364,6 +368,7 @@ export declare const route: Route<{
|
|
|
364
368
|
readonly reasoning?: string | undefined;
|
|
365
369
|
readonly reasoning_text?: string | undefined;
|
|
366
370
|
readonly reasoning_details?: unknown;
|
|
371
|
+
readonly reasoning_opaque?: string | undefined;
|
|
367
372
|
})[];
|
|
368
373
|
readonly tools?: readonly ({
|
|
369
374
|
readonly type: "function";
|
|
@@ -735,6 +740,7 @@ export declare const routes: (Route<{
|
|
|
735
740
|
readonly reasoning?: string | undefined;
|
|
736
741
|
readonly reasoning_text?: string | undefined;
|
|
737
742
|
readonly reasoning_details?: unknown;
|
|
743
|
+
readonly reasoning_opaque?: string | undefined;
|
|
738
744
|
})[];
|
|
739
745
|
readonly tools?: readonly ({
|
|
740
746
|
readonly type: "function";
|
|
@@ -816,6 +822,7 @@ export declare const configure: (input?: Config) => {
|
|
|
816
822
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
817
823
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
818
824
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
825
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
819
826
|
configure: typeof configure;
|
|
820
827
|
};
|
|
821
828
|
export declare const provider: {
|
|
@@ -825,9 +832,11 @@ export declare const provider: {
|
|
|
825
832
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
826
833
|
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
827
834
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
835
|
+
embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
828
836
|
configure: typeof configure;
|
|
829
837
|
};
|
|
830
838
|
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
839
|
+
export declare const embedding: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
831
840
|
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
832
841
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
833
842
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./open-responses-options.js").OpenResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
@@ -835,4 +844,5 @@ export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOption
|
|
|
835
844
|
export declare const responsesModel: ProviderPackage.Model<Settings<OpenResponsesProviderOptionsInput>, OpenResponsesProviderOptionsInput>;
|
|
836
845
|
export declare const imageModel: (modelID: string, settings?: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
837
846
|
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
847
|
+
export declare const embeddingModel: (modelID: string, settings?: Settings) => import("../embedding.js").EmbeddingModel<import("../embedding.js").EmbeddingOptions>;
|
|
838
848
|
export * as DigitalOcean from "./digitalocean.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 { 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";
|