@opencode/ai 2.0.15 → 2.0.16
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 +286 -2
- package/dist/generation.d.ts +36 -22
- package/dist/generation.js +53 -24
- package/dist/image-client.d.ts +14 -7
- package/dist/image-client.js +24 -8
- package/dist/image.d.ts +398 -47
- package/dist/image.js +47 -45
- package/dist/index.d.ts +13 -1
- package/dist/index.js +9 -0
- package/dist/media-model.d.ts +44 -0
- package/dist/media-model.js +49 -0
- package/dist/media.d.ts +10 -9
- package/dist/media.js +9 -10
- package/dist/promise.d.ts +428 -8
- package/dist/promise.js +40 -3
- package/dist/protocols/alibaba-chat.d.ts +12 -0
- package/dist/protocols/alibaba-responses.d.ts +2 -2
- package/dist/protocols/anthropic-messages.js +1 -2
- package/dist/protocols/assemblyai-transcription.d.ts +40 -0
- package/dist/protocols/assemblyai-transcription.js +138 -0
- package/dist/protocols/bedrock-converse.js +5 -11
- package/dist/protocols/bfl-images.d.ts +32 -0
- package/dist/protocols/bfl-images.js +153 -0
- package/dist/protocols/cartesia-speech.d.ts +127 -0
- package/dist/protocols/cartesia-speech.js +126 -0
- package/dist/protocols/deepgram-speech.d.ts +119 -0
- package/dist/protocols/deepgram-speech.js +92 -0
- package/dist/protocols/deepgram-transcription.d.ts +25 -0
- package/dist/protocols/deepgram-transcription.js +129 -0
- package/dist/protocols/elevenlabs-speech.d.ts +122 -0
- package/dist/protocols/elevenlabs-speech.js +115 -0
- package/dist/protocols/fal-images.d.ts +24 -0
- package/dist/protocols/fal-images.js +114 -0
- package/dist/protocols/fal-video.d.ts +29 -0
- package/dist/protocols/fal-video.js +88 -0
- package/dist/protocols/gemini.d.ts +9 -9
- package/dist/protocols/gemini.js +8 -34
- package/dist/protocols/google-images.js +2 -14
- package/dist/protocols/google-speech.d.ts +130 -0
- package/dist/protocols/google-speech.js +84 -0
- package/dist/protocols/google-transcription.d.ts +173 -0
- package/dist/protocols/google-transcription.js +138 -0
- package/dist/protocols/google-video.d.ts +26 -0
- package/dist/protocols/google-video.js +158 -0
- package/dist/protocols/meta-images.js +2 -9
- package/dist/protocols/meta-responses.d.ts +4 -4
- package/dist/protocols/meta-responses.js +1 -1
- package/dist/protocols/open-responses.d.ts +6 -6
- package/dist/protocols/open-responses.js +1 -2
- package/dist/protocols/openai-chat.d.ts +84 -0
- package/dist/protocols/openai-chat.js +26 -14
- package/dist/protocols/openai-compatible-chat.d.ts +12 -0
- package/dist/protocols/openai-compatible-responses.d.ts +2 -2
- package/dist/protocols/openai-images.d.ts +124 -3
- package/dist/protocols/openai-images.js +107 -54
- package/dist/protocols/openai-responses.d.ts +15 -15
- package/dist/protocols/openai-responses.js +5 -6
- package/dist/protocols/openai-speech.d.ts +116 -0
- package/dist/protocols/openai-speech.js +98 -0
- package/dist/protocols/openai-transcription.d.ts +207 -0
- package/dist/protocols/openai-transcription.js +190 -0
- package/dist/protocols/replicate-images.d.ts +28 -0
- package/dist/protocols/replicate-images.js +133 -0
- package/dist/protocols/runway-video.d.ts +38 -0
- package/dist/protocols/runway-video.js +146 -0
- package/dist/protocols/shared.d.ts +13 -3
- package/dist/protocols/shared.js +23 -3
- package/dist/protocols/stability-images.d.ts +38 -0
- package/dist/protocols/stability-images.js +148 -0
- package/dist/protocols/utils/fal-queue.d.ts +28 -0
- package/dist/protocols/utils/fal-queue.js +69 -0
- package/dist/protocols/utils/gemini-generate-content.d.ts +65 -0
- package/dist/protocols/utils/gemini-generate-content.js +65 -0
- package/dist/protocols/utils/gemini-json-schema.d.ts +3 -0
- package/dist/protocols/utils/gemini-json-schema.js +76 -0
- package/dist/protocols/utils/media-input.d.ts +8 -0
- package/dist/protocols/utils/media-input.js +18 -0
- package/dist/protocols/utils/speech-stream.d.ts +49 -0
- package/dist/protocols/utils/speech-stream.js +67 -0
- package/dist/protocols/utils/tool-schema.d.ts +2 -2
- package/dist/protocols/utils/tool-schema.js +40 -17
- package/dist/protocols/xai-images.js +1 -12
- package/dist/protocols/xai-responses.d.ts +2 -2
- package/dist/protocols/xai-video.d.ts +34 -0
- package/dist/protocols/xai-video.js +147 -0
- package/dist/protocols/zai-chat.d.ts +13 -1
- package/dist/provider-error.js +3 -0
- package/dist/providers/alibaba.d.ts +14 -2
- package/dist/providers/amazon-bedrock-mantle.d.ts +14 -2
- package/dist/providers/assemblyai.d.ts +25 -0
- package/dist/providers/assemblyai.js +29 -0
- package/dist/providers/azure.d.ts +18 -6
- package/dist/providers/baseten.d.ts +24 -0
- package/dist/providers/black-forest-labs.d.ts +25 -0
- package/dist/providers/black-forest-labs.js +28 -0
- package/dist/providers/cartesia.d.ts +24 -0
- package/dist/providers/cartesia.js +22 -0
- package/dist/providers/cerebras.d.ts +24 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +30 -6
- package/dist/providers/cloudflare-workers-ai.d.ts +24 -0
- package/dist/providers/deepgram.d.ts +29 -0
- package/dist/providers/deepgram.js +31 -0
- package/dist/providers/deepinfra.d.ts +24 -0
- package/dist/providers/deepseek.d.ts +24 -0
- package/dist/providers/elevenlabs.d.ts +24 -0
- package/dist/providers/elevenlabs.js +28 -0
- package/dist/providers/fal.d.ts +29 -0
- package/dist/providers/fal.js +33 -0
- package/dist/providers/fireworks.d.ts +24 -0
- package/dist/providers/google-vertex-chat.d.ts +12 -0
- package/dist/providers/google-vertex-responses.d.ts +2 -2
- package/dist/providers/google-vertex.d.ts +3 -3
- package/dist/providers/google.d.ts +18 -3
- package/dist/providers/google.js +11 -2
- package/dist/providers/groq.d.ts +24 -0
- package/dist/providers/index.d.ts +9 -0
- package/dist/providers/index.js +9 -0
- package/dist/providers/meta.d.ts +14 -2
- package/dist/providers/minimax.d.ts +14 -2
- package/dist/providers/moonshot.d.ts +14 -2
- package/dist/providers/moonshot.js +3 -3
- package/dist/providers/openai-compatible-responses.d.ts +2 -2
- package/dist/providers/openai-compatible.d.ts +12 -0
- package/dist/providers/openai.d.ts +25 -3
- package/dist/providers/openai.js +10 -1
- package/dist/providers/openrouter.d.ts +48 -0
- package/dist/providers/replicate.d.ts +25 -0
- package/dist/providers/replicate.js +22 -0
- package/dist/providers/runway.d.ts +24 -0
- package/dist/providers/runway.js +22 -0
- package/dist/providers/stability.d.ts +28 -0
- package/dist/providers/stability.js +23 -0
- package/dist/providers/togetherai.d.ts +24 -0
- package/dist/providers/xai.d.ts +17 -0
- package/dist/providers/xai.js +5 -2
- package/dist/providers/zai-coding-plan.d.ts +15 -3
- package/dist/providers/zai.d.ts +13 -1
- package/dist/route/auth.d.ts +4 -1
- package/dist/route/auth.js +6 -0
- package/dist/route/framing.d.ts +5 -1
- package/dist/route/framing.js +9 -0
- package/dist/route/media-protocol.d.ts +116 -3
- package/dist/route/media-protocol.js +60 -4
- package/dist/route/media.d.ts +58 -7
- package/dist/route/media.js +201 -29
- package/dist/schema/events.d.ts +0 -6
- package/dist/schema/messages.d.ts +0 -3
- package/dist/schema/options.d.ts +4 -3
- package/dist/schema/options.js +3 -2
- package/dist/speech-client.d.ts +21 -0
- package/dist/speech-client.js +25 -0
- package/dist/speech.d.ts +1150 -0
- package/dist/speech.js +119 -0
- package/dist/transcription-client.d.ts +28 -0
- package/dist/transcription-client.js +44 -0
- package/dist/transcription.d.ts +1504 -0
- package/dist/transcription.js +133 -0
- package/dist/utils/bytes.d.ts +1 -0
- package/dist/utils/bytes.js +10 -0
- package/dist/utils/media-type.d.ts +1 -0
- package/dist/utils/media-type.js +22 -1
- package/dist/video-client.d.ts +28 -0
- package/dist/video-client.js +40 -0
- package/dist/video.d.ts +1359 -0
- package/dist/video.js +119 -0
- package/package.json +3 -3
- package/dist/protocols/utils/gemini-tool-schema.d.ts +0 -2
- package/dist/protocols/utils/gemini-tool-schema.js +0 -103
|
@@ -28,6 +28,12 @@ export declare const route: Route<{
|
|
|
28
28
|
readonly image_url: {
|
|
29
29
|
readonly url: string;
|
|
30
30
|
};
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: "file";
|
|
33
|
+
readonly file: {
|
|
34
|
+
readonly filename: string;
|
|
35
|
+
readonly file_data: string;
|
|
36
|
+
};
|
|
31
37
|
})[];
|
|
32
38
|
} | {
|
|
33
39
|
readonly role: "user";
|
|
@@ -43,6 +49,12 @@ export declare const route: Route<{
|
|
|
43
49
|
readonly image_url: {
|
|
44
50
|
readonly url: string;
|
|
45
51
|
};
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "file";
|
|
54
|
+
readonly file: {
|
|
55
|
+
readonly filename: string;
|
|
56
|
+
readonly file_data: string;
|
|
57
|
+
};
|
|
46
58
|
})[];
|
|
47
59
|
} | {
|
|
48
60
|
readonly [x: string]: unknown;
|
|
@@ -127,6 +139,12 @@ export declare const routes: Route<{
|
|
|
127
139
|
readonly image_url: {
|
|
128
140
|
readonly url: string;
|
|
129
141
|
};
|
|
142
|
+
} | {
|
|
143
|
+
readonly type: "file";
|
|
144
|
+
readonly file: {
|
|
145
|
+
readonly filename: string;
|
|
146
|
+
readonly file_data: string;
|
|
147
|
+
};
|
|
130
148
|
})[];
|
|
131
149
|
} | {
|
|
132
150
|
readonly role: "user";
|
|
@@ -142,6 +160,12 @@ export declare const routes: Route<{
|
|
|
142
160
|
readonly image_url: {
|
|
143
161
|
readonly url: string;
|
|
144
162
|
};
|
|
163
|
+
} | {
|
|
164
|
+
readonly type: "file";
|
|
165
|
+
readonly file: {
|
|
166
|
+
readonly filename: string;
|
|
167
|
+
readonly file_data: string;
|
|
168
|
+
};
|
|
145
169
|
})[];
|
|
146
170
|
} | {
|
|
147
171
|
readonly [x: string]: unknown;
|
|
@@ -28,6 +28,12 @@ export declare const route: Route<{
|
|
|
28
28
|
readonly image_url: {
|
|
29
29
|
readonly url: string;
|
|
30
30
|
};
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: "file";
|
|
33
|
+
readonly file: {
|
|
34
|
+
readonly filename: string;
|
|
35
|
+
readonly file_data: string;
|
|
36
|
+
};
|
|
31
37
|
})[];
|
|
32
38
|
} | {
|
|
33
39
|
readonly role: "user";
|
|
@@ -43,6 +49,12 @@ export declare const route: Route<{
|
|
|
43
49
|
readonly image_url: {
|
|
44
50
|
readonly url: string;
|
|
45
51
|
};
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "file";
|
|
54
|
+
readonly file: {
|
|
55
|
+
readonly filename: string;
|
|
56
|
+
readonly file_data: string;
|
|
57
|
+
};
|
|
46
58
|
})[];
|
|
47
59
|
} | {
|
|
48
60
|
readonly [x: string]: unknown;
|
|
@@ -127,6 +139,12 @@ export declare const routes: Route<{
|
|
|
127
139
|
readonly image_url: {
|
|
128
140
|
readonly url: string;
|
|
129
141
|
};
|
|
142
|
+
} | {
|
|
143
|
+
readonly type: "file";
|
|
144
|
+
readonly file: {
|
|
145
|
+
readonly filename: string;
|
|
146
|
+
readonly file_data: string;
|
|
147
|
+
};
|
|
130
148
|
})[];
|
|
131
149
|
} | {
|
|
132
150
|
readonly role: "user";
|
|
@@ -142,6 +160,12 @@ export declare const routes: Route<{
|
|
|
142
160
|
readonly image_url: {
|
|
143
161
|
readonly url: string;
|
|
144
162
|
};
|
|
163
|
+
} | {
|
|
164
|
+
readonly type: "file";
|
|
165
|
+
readonly file: {
|
|
166
|
+
readonly filename: string;
|
|
167
|
+
readonly file_data: string;
|
|
168
|
+
};
|
|
145
169
|
})[];
|
|
146
170
|
} | {
|
|
147
171
|
readonly [x: string]: unknown;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import { HttpOptions, type ModelID } from "../schema/index.js";
|
|
3
|
+
export type { ElevenLabsOutputFormat, ElevenLabsSpeechOptions } from "../protocols/elevenlabs-speech.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.Input;
|
|
9
|
+
};
|
|
10
|
+
export declare const configure: (input?: Config) => {
|
|
11
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
12
|
+
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/elevenlabs-speech.js").ElevenLabsSpeechOptions>;
|
|
13
|
+
configure: (input?: Config) => /*elided*/ any;
|
|
14
|
+
};
|
|
15
|
+
export declare const provider: {
|
|
16
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
17
|
+
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/elevenlabs-speech.js").ElevenLabsSpeechOptions>;
|
|
18
|
+
configure: (input?: Config) => {
|
|
19
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
20
|
+
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/elevenlabs-speech.js").ElevenLabsSpeechOptions>;
|
|
21
|
+
configure: /*elided*/ any;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/elevenlabs-speech.js").ElevenLabsSpeechOptions>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Auth } from "../route/auth.js";
|
|
2
|
+
import { HttpOptions, ProviderID } from "../schema/index.js";
|
|
3
|
+
import { DEFAULT_BASE_URL, ElevenLabsSpeech } from "../protocols/elevenlabs-speech.js";
|
|
4
|
+
export const id = ProviderID.make("elevenlabs");
|
|
5
|
+
const baseURL = DEFAULT_BASE_URL;
|
|
6
|
+
const auth = (options) => {
|
|
7
|
+
if ("auth" in options && options.auth)
|
|
8
|
+
return options.auth;
|
|
9
|
+
return Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey")
|
|
10
|
+
.orElse(Auth.config("ELEVENLABS_API_KEY"))
|
|
11
|
+
.pipe(Auth.header("xi-api-key"));
|
|
12
|
+
};
|
|
13
|
+
export const configure = (input = {}) => {
|
|
14
|
+
const speech = (modelID) => ElevenLabsSpeech.model({
|
|
15
|
+
id: modelID,
|
|
16
|
+
auth: auth(input),
|
|
17
|
+
baseURL: input.baseURL ?? baseURL,
|
|
18
|
+
headers: input.headers,
|
|
19
|
+
http: input.http === undefined ? undefined : HttpOptions.make(input.http),
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
id,
|
|
23
|
+
speech,
|
|
24
|
+
configure,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export const provider = configure();
|
|
28
|
+
export const speech = provider.speech;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ProviderAuthOption } from "../route/auth-options.js";
|
|
2
|
+
import { HttpOptions, type ModelID } from "../schema/index.js";
|
|
3
|
+
export type { FalImageOptions } from "../protocols/fal-images.js";
|
|
4
|
+
export type { FalVideoOptions } from "../protocols/fal-video.js";
|
|
5
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
6
|
+
export type Config = ProviderAuthOption<"optional"> & {
|
|
7
|
+
readonly baseURL?: string;
|
|
8
|
+
readonly headers?: Record<string, string>;
|
|
9
|
+
readonly http?: HttpOptions.Input;
|
|
10
|
+
};
|
|
11
|
+
export declare const configure: (input?: Config) => {
|
|
12
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
13
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/fal-images.js").FalImageOptions>;
|
|
14
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/fal-video.js").FalVideoOptions>;
|
|
15
|
+
configure: (input?: Config) => /*elided*/ any;
|
|
16
|
+
};
|
|
17
|
+
export declare const provider: {
|
|
18
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
19
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/fal-images.js").FalImageOptions>;
|
|
20
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/fal-video.js").FalVideoOptions>;
|
|
21
|
+
configure: (input?: Config) => {
|
|
22
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
23
|
+
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/fal-images.js").FalImageOptions>;
|
|
24
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/fal-video.js").FalVideoOptions>;
|
|
25
|
+
configure: /*elided*/ any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/fal-images.js").FalImageOptions>;
|
|
29
|
+
export declare const video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/fal-video.js").FalVideoOptions>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Auth } from "../route/auth.js";
|
|
2
|
+
import { HttpOptions, ProviderID } from "../schema/index.js";
|
|
3
|
+
import { FalImages } from "../protocols/fal-images.js";
|
|
4
|
+
import { FalVideo } from "../protocols/fal-video.js";
|
|
5
|
+
import { FalQueue } from "../protocols/utils/fal-queue.js";
|
|
6
|
+
export const id = ProviderID.make("fal");
|
|
7
|
+
const baseURL = FalQueue.DEFAULT_BASE_URL;
|
|
8
|
+
// fal authenticates with `Authorization: Key <FAL_KEY>` rather than a bearer token.
|
|
9
|
+
const auth = (options) => {
|
|
10
|
+
if ("auth" in options && options.auth)
|
|
11
|
+
return options.auth;
|
|
12
|
+
return Auth.optional("apiKey" in options ? options.apiKey : undefined, "apiKey")
|
|
13
|
+
.orElse(Auth.config("FAL_KEY"))
|
|
14
|
+
.pipe(Auth.scheme("Key"));
|
|
15
|
+
};
|
|
16
|
+
export const configure = (input = {}) => {
|
|
17
|
+
const media = (modelID) => ({
|
|
18
|
+
id: modelID,
|
|
19
|
+
auth: auth(input),
|
|
20
|
+
baseURL: input.baseURL ?? baseURL,
|
|
21
|
+
headers: input.headers,
|
|
22
|
+
http: input.http === undefined ? undefined : HttpOptions.make(input.http),
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
id,
|
|
26
|
+
image: (modelID) => FalImages.model(media(modelID)),
|
|
27
|
+
video: (modelID) => FalVideo.model(media(modelID)),
|
|
28
|
+
configure,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export const provider = configure();
|
|
32
|
+
export const image = provider.image;
|
|
33
|
+
export const video = provider.video;
|
|
@@ -28,6 +28,12 @@ export declare const route: Route<{
|
|
|
28
28
|
readonly image_url: {
|
|
29
29
|
readonly url: string;
|
|
30
30
|
};
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: "file";
|
|
33
|
+
readonly file: {
|
|
34
|
+
readonly filename: string;
|
|
35
|
+
readonly file_data: string;
|
|
36
|
+
};
|
|
31
37
|
})[];
|
|
32
38
|
} | {
|
|
33
39
|
readonly role: "user";
|
|
@@ -43,6 +49,12 @@ export declare const route: Route<{
|
|
|
43
49
|
readonly image_url: {
|
|
44
50
|
readonly url: string;
|
|
45
51
|
};
|
|
52
|
+
} | {
|
|
53
|
+
readonly type: "file";
|
|
54
|
+
readonly file: {
|
|
55
|
+
readonly filename: string;
|
|
56
|
+
readonly file_data: string;
|
|
57
|
+
};
|
|
46
58
|
})[];
|
|
47
59
|
} | {
|
|
48
60
|
readonly [x: string]: unknown;
|
|
@@ -127,6 +139,12 @@ export declare const routes: Route<{
|
|
|
127
139
|
readonly image_url: {
|
|
128
140
|
readonly url: string;
|
|
129
141
|
};
|
|
142
|
+
} | {
|
|
143
|
+
readonly type: "file";
|
|
144
|
+
readonly file: {
|
|
145
|
+
readonly filename: string;
|
|
146
|
+
readonly file_data: string;
|
|
147
|
+
};
|
|
130
148
|
})[];
|
|
131
149
|
} | {
|
|
132
150
|
readonly role: "user";
|
|
@@ -142,6 +160,12 @@ export declare const routes: Route<{
|
|
|
142
160
|
readonly image_url: {
|
|
143
161
|
readonly url: string;
|
|
144
162
|
};
|
|
163
|
+
} | {
|
|
164
|
+
readonly type: "file";
|
|
165
|
+
readonly file: {
|
|
166
|
+
readonly filename: string;
|
|
167
|
+
readonly file_data: string;
|
|
168
|
+
};
|
|
145
169
|
})[];
|
|
146
170
|
} | {
|
|
147
171
|
readonly [x: string]: unknown;
|
|
@@ -33,6 +33,12 @@ export declare const routes: Route<{
|
|
|
33
33
|
readonly image_url: {
|
|
34
34
|
readonly url: string;
|
|
35
35
|
};
|
|
36
|
+
} | {
|
|
37
|
+
readonly type: "file";
|
|
38
|
+
readonly file: {
|
|
39
|
+
readonly filename: string;
|
|
40
|
+
readonly file_data: string;
|
|
41
|
+
};
|
|
36
42
|
})[];
|
|
37
43
|
} | {
|
|
38
44
|
readonly role: "user";
|
|
@@ -48,6 +54,12 @@ export declare const routes: Route<{
|
|
|
48
54
|
readonly image_url: {
|
|
49
55
|
readonly url: string;
|
|
50
56
|
};
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "file";
|
|
59
|
+
readonly file: {
|
|
60
|
+
readonly filename: string;
|
|
61
|
+
readonly file_data: string;
|
|
62
|
+
};
|
|
51
63
|
})[];
|
|
52
64
|
} | {
|
|
53
65
|
readonly [x: string]: unknown;
|
|
@@ -84,8 +84,8 @@ export declare const routes: Route<{
|
|
|
84
84
|
} | {
|
|
85
85
|
readonly type: "input_file";
|
|
86
86
|
readonly filename: string;
|
|
87
|
-
readonly detail?: string | undefined;
|
|
88
87
|
readonly file_data?: string | undefined;
|
|
88
|
+
readonly detail?: string | undefined;
|
|
89
89
|
readonly file_url?: string | undefined;
|
|
90
90
|
} | {
|
|
91
91
|
readonly type: "input_text";
|
|
@@ -121,8 +121,8 @@ export declare const routes: Route<{
|
|
|
121
121
|
} | {
|
|
122
122
|
readonly type: "input_file";
|
|
123
123
|
readonly filename: string;
|
|
124
|
-
readonly detail?: string | undefined;
|
|
125
124
|
readonly file_data?: string | undefined;
|
|
125
|
+
readonly detail?: string | undefined;
|
|
126
126
|
readonly file_url?: string | undefined;
|
|
127
127
|
} | {
|
|
128
128
|
readonly type: "input_text";
|
|
@@ -67,11 +67,11 @@ export declare const routes: Route<{
|
|
|
67
67
|
}[];
|
|
68
68
|
readonly tools?: readonly {
|
|
69
69
|
readonly functionDeclarations: readonly {
|
|
70
|
-
readonly description: string;
|
|
71
70
|
readonly name: string;
|
|
72
|
-
readonly
|
|
71
|
+
readonly description: string;
|
|
72
|
+
readonly parametersJsonSchema: {
|
|
73
73
|
readonly [x: string]: unknown;
|
|
74
|
-
}
|
|
74
|
+
};
|
|
75
75
|
}[];
|
|
76
76
|
}[] | undefined;
|
|
77
77
|
readonly serviceTier?: string | undefined;
|
|
@@ -4,6 +4,9 @@ import type { ProviderPackage } from "../provider-package.js";
|
|
|
4
4
|
import { type ModelID } from "../schema/index.js";
|
|
5
5
|
import { Gemini } from "../protocols/gemini.js";
|
|
6
6
|
export type { GoogleImageOptions } from "../protocols/google-images.js";
|
|
7
|
+
export type { GoogleSpeechOptions } from "../protocols/google-speech.js";
|
|
8
|
+
export type { GoogleTranscriptionOptions } from "../protocols/google-transcription.js";
|
|
9
|
+
export type { GoogleVideoOptions } from "../protocols/google-video.js";
|
|
7
10
|
export type GeminiOptionsInput = Gemini.OptionsInput;
|
|
8
11
|
export type GeminiProviderOptionsInput = Gemini.ProviderOptionsInput;
|
|
9
12
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -49,11 +52,11 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
49
52
|
}[];
|
|
50
53
|
readonly tools?: readonly {
|
|
51
54
|
readonly functionDeclarations: readonly {
|
|
52
|
-
readonly description: string;
|
|
53
55
|
readonly name: string;
|
|
54
|
-
readonly
|
|
56
|
+
readonly description: string;
|
|
57
|
+
readonly parametersJsonSchema: {
|
|
55
58
|
readonly [x: string]: unknown;
|
|
56
|
-
}
|
|
59
|
+
};
|
|
57
60
|
}[];
|
|
58
61
|
}[] | undefined;
|
|
59
62
|
readonly serviceTier?: string | undefined;
|
|
@@ -104,18 +107,30 @@ export declare const configure: (input?: Config) => {
|
|
|
104
107
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
105
108
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
106
109
|
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
110
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
111
|
+
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
112
|
+
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
107
113
|
configure: (input?: Config) => /*elided*/ any;
|
|
108
114
|
};
|
|
109
115
|
export declare const provider: {
|
|
110
116
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
111
117
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
112
118
|
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
119
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
120
|
+
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
121
|
+
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
113
122
|
configure: (input?: Config) => {
|
|
114
123
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
115
124
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<Gemini.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
116
125
|
image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
126
|
+
video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
127
|
+
speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
128
|
+
transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
|
117
129
|
configure: /*elided*/ any;
|
|
118
130
|
};
|
|
119
131
|
};
|
|
120
132
|
export declare const model: ProviderPackage.Definition<Settings, Gemini.ProviderOptionsInput>["model"];
|
|
121
133
|
export declare const image: (modelID: string | ModelID) => import("../image.js").ImageModel<import("../protocols/google-images.js").GoogleImageOptions>;
|
|
134
|
+
export declare const video: (modelID: string | ModelID) => import("../video.js").VideoModel<import("../protocols/google-video.js").GoogleVideoOptions>;
|
|
135
|
+
export declare const speech: (modelID: string | ModelID) => import("../speech.js").SpeechModel<import("../protocols/google-speech.js").GoogleSpeechOptions>;
|
|
136
|
+
export declare const transcription: (modelID: string | ModelID) => import("../transcription.js").TranscriptionModel<import("../protocols/google-transcription.js").GoogleTranscriptionOptions>;
|
package/dist/providers/google.js
CHANGED
|
@@ -2,6 +2,9 @@ import { Auth } from "../route/auth.js";
|
|
|
2
2
|
import { HttpOptions, ProviderID, mergeHttpOptions } from "../schema/index.js";
|
|
3
3
|
import { Gemini } from "../protocols/gemini.js";
|
|
4
4
|
import { GoogleImages } from "../protocols/google-images.js";
|
|
5
|
+
import { GoogleSpeech } from "../protocols/google-speech.js";
|
|
6
|
+
import { GoogleTranscription } from "../protocols/google-transcription.js";
|
|
7
|
+
import { GoogleVideo } from "../protocols/google-video.js";
|
|
5
8
|
export const id = ProviderID.make("google");
|
|
6
9
|
export const routes = [Gemini.route];
|
|
7
10
|
const auth = (options) => {
|
|
@@ -17,7 +20,7 @@ const configuredRoute = (input) => {
|
|
|
17
20
|
};
|
|
18
21
|
export const configure = (input = {}) => {
|
|
19
22
|
const route = configuredRoute(input);
|
|
20
|
-
const
|
|
23
|
+
const media = (modelID) => ({
|
|
21
24
|
id: modelID,
|
|
22
25
|
auth: auth(input),
|
|
23
26
|
baseURL: input.baseURL,
|
|
@@ -27,7 +30,10 @@ export const configure = (input = {}) => {
|
|
|
27
30
|
return {
|
|
28
31
|
id,
|
|
29
32
|
model: (modelID) => route.model({ id: modelID }),
|
|
30
|
-
image,
|
|
33
|
+
image: (modelID) => GoogleImages.model(media(modelID)),
|
|
34
|
+
video: (modelID) => GoogleVideo.model(media(modelID)),
|
|
35
|
+
speech: (modelID) => GoogleSpeech.model(media(modelID)),
|
|
36
|
+
transcription: (modelID) => GoogleTranscription.model(media(modelID)),
|
|
31
37
|
configure,
|
|
32
38
|
};
|
|
33
39
|
};
|
|
@@ -40,3 +46,6 @@ export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOpti
|
|
|
40
46
|
providerOptions,
|
|
41
47
|
}).model(modelID);
|
|
42
48
|
export const image = provider.image;
|
|
49
|
+
export const video = provider.video;
|
|
50
|
+
export const speech = provider.speech;
|
|
51
|
+
export const transcription = provider.transcription;
|
package/dist/providers/groq.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ export declare const protocol: Protocol<{
|
|
|
37
37
|
readonly image_url: {
|
|
38
38
|
readonly url: string;
|
|
39
39
|
};
|
|
40
|
+
} | {
|
|
41
|
+
readonly type: "file";
|
|
42
|
+
readonly file: {
|
|
43
|
+
readonly filename: string;
|
|
44
|
+
readonly file_data: string;
|
|
45
|
+
};
|
|
40
46
|
})[];
|
|
41
47
|
} | {
|
|
42
48
|
readonly role: "user";
|
|
@@ -52,6 +58,12 @@ export declare const protocol: Protocol<{
|
|
|
52
58
|
readonly image_url: {
|
|
53
59
|
readonly url: string;
|
|
54
60
|
};
|
|
61
|
+
} | {
|
|
62
|
+
readonly type: "file";
|
|
63
|
+
readonly file: {
|
|
64
|
+
readonly filename: string;
|
|
65
|
+
readonly file_data: string;
|
|
66
|
+
};
|
|
55
67
|
})[];
|
|
56
68
|
} | {
|
|
57
69
|
readonly [x: string]: unknown;
|
|
@@ -208,6 +220,12 @@ export declare const route: Route<{
|
|
|
208
220
|
readonly image_url: {
|
|
209
221
|
readonly url: string;
|
|
210
222
|
};
|
|
223
|
+
} | {
|
|
224
|
+
readonly type: "file";
|
|
225
|
+
readonly file: {
|
|
226
|
+
readonly filename: string;
|
|
227
|
+
readonly file_data: string;
|
|
228
|
+
};
|
|
211
229
|
})[];
|
|
212
230
|
} | {
|
|
213
231
|
readonly role: "user";
|
|
@@ -223,6 +241,12 @@ export declare const route: Route<{
|
|
|
223
241
|
readonly image_url: {
|
|
224
242
|
readonly url: string;
|
|
225
243
|
};
|
|
244
|
+
} | {
|
|
245
|
+
readonly type: "file";
|
|
246
|
+
readonly file: {
|
|
247
|
+
readonly filename: string;
|
|
248
|
+
readonly file_data: string;
|
|
249
|
+
};
|
|
226
250
|
})[];
|
|
227
251
|
} | {
|
|
228
252
|
readonly [x: string]: unknown;
|
|
@@ -3,13 +3,19 @@ export * as Anthropic from "./anthropic.js";
|
|
|
3
3
|
export * as AnthropicCompatible from "./anthropic-compatible.js";
|
|
4
4
|
export * as AmazonBedrock from "./amazon-bedrock.js";
|
|
5
5
|
export * as AmazonBedrockMantle from "./amazon-bedrock-mantle.js";
|
|
6
|
+
export * as AssemblyAI from "./assemblyai.js";
|
|
6
7
|
export * as Azure from "./azure.js";
|
|
7
8
|
export * as Baseten from "./baseten.js";
|
|
9
|
+
export * as BlackForestLabs from "./black-forest-labs.js";
|
|
10
|
+
export * as Cartesia from "./cartesia.js";
|
|
8
11
|
export * as Cerebras from "./cerebras.js";
|
|
9
12
|
export * as CloudflareAIGateway from "./cloudflare-ai-gateway.js";
|
|
10
13
|
export * as CloudflareWorkersAI from "./cloudflare-workers-ai.js";
|
|
11
14
|
export * as DeepInfra from "./deepinfra.js";
|
|
15
|
+
export * as Deepgram from "./deepgram.js";
|
|
12
16
|
export * as DeepSeek from "./deepseek.js";
|
|
17
|
+
export * as ElevenLabs from "./elevenlabs.js";
|
|
18
|
+
export * as Fal from "./fal.js";
|
|
13
19
|
export * as Fireworks from "./fireworks.js";
|
|
14
20
|
export * as Google from "./google.js";
|
|
15
21
|
export * as GoogleVertex from "./google-vertex.js";
|
|
@@ -26,6 +32,9 @@ export * as OpenAICompatible from "./openai-compatible.js";
|
|
|
26
32
|
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
27
33
|
export * as OpenCodeZen from "./opencode-zen.js";
|
|
28
34
|
export * as OpenRouter from "./openrouter.js";
|
|
35
|
+
export * as Replicate from "./replicate.js";
|
|
36
|
+
export * as Runway from "./runway.js";
|
|
37
|
+
export * as Stability from "./stability.js";
|
|
29
38
|
export * as TogetherAI from "./togetherai.js";
|
|
30
39
|
export * as TypeSafeAI from "./typesafe-ai.js";
|
|
31
40
|
export * as VercelAIGateway from "./vercel-ai-gateway.js";
|
package/dist/providers/index.js
CHANGED
|
@@ -3,13 +3,19 @@ export * as Anthropic from "./anthropic.js";
|
|
|
3
3
|
export * as AnthropicCompatible from "./anthropic-compatible.js";
|
|
4
4
|
export * as AmazonBedrock from "./amazon-bedrock.js";
|
|
5
5
|
export * as AmazonBedrockMantle from "./amazon-bedrock-mantle.js";
|
|
6
|
+
export * as AssemblyAI from "./assemblyai.js";
|
|
6
7
|
export * as Azure from "./azure.js";
|
|
7
8
|
export * as Baseten from "./baseten.js";
|
|
9
|
+
export * as BlackForestLabs from "./black-forest-labs.js";
|
|
10
|
+
export * as Cartesia from "./cartesia.js";
|
|
8
11
|
export * as Cerebras from "./cerebras.js";
|
|
9
12
|
export * as CloudflareAIGateway from "./cloudflare-ai-gateway.js";
|
|
10
13
|
export * as CloudflareWorkersAI from "./cloudflare-workers-ai.js";
|
|
11
14
|
export * as DeepInfra from "./deepinfra.js";
|
|
15
|
+
export * as Deepgram from "./deepgram.js";
|
|
12
16
|
export * as DeepSeek from "./deepseek.js";
|
|
17
|
+
export * as ElevenLabs from "./elevenlabs.js";
|
|
18
|
+
export * as Fal from "./fal.js";
|
|
13
19
|
export * as Fireworks from "./fireworks.js";
|
|
14
20
|
export * as Google from "./google.js";
|
|
15
21
|
export * as GoogleVertex from "./google-vertex.js";
|
|
@@ -26,6 +32,9 @@ export * as OpenAICompatible from "./openai-compatible.js";
|
|
|
26
32
|
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
27
33
|
export * as OpenCodeZen from "./opencode-zen.js";
|
|
28
34
|
export * as OpenRouter from "./openrouter.js";
|
|
35
|
+
export * as Replicate from "./replicate.js";
|
|
36
|
+
export * as Runway from "./runway.js";
|
|
37
|
+
export * as Stability from "./stability.js";
|
|
29
38
|
export * as TogetherAI from "./togetherai.js";
|
|
30
39
|
export * as TypeSafeAI from "./typesafe-ai.js";
|
|
31
40
|
export * as VercelAIGateway from "./vercel-ai-gateway.js";
|
package/dist/providers/meta.d.ts
CHANGED
|
@@ -54,6 +54,12 @@ export declare const routes: (Route<{
|
|
|
54
54
|
readonly image_url: {
|
|
55
55
|
readonly url: string;
|
|
56
56
|
};
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "file";
|
|
59
|
+
readonly file: {
|
|
60
|
+
readonly filename: string;
|
|
61
|
+
readonly file_data: string;
|
|
62
|
+
};
|
|
57
63
|
})[];
|
|
58
64
|
} | {
|
|
59
65
|
readonly role: "user";
|
|
@@ -69,6 +75,12 @@ export declare const routes: (Route<{
|
|
|
69
75
|
readonly image_url: {
|
|
70
76
|
readonly url: string;
|
|
71
77
|
};
|
|
78
|
+
} | {
|
|
79
|
+
readonly type: "file";
|
|
80
|
+
readonly file: {
|
|
81
|
+
readonly filename: string;
|
|
82
|
+
readonly file_data: string;
|
|
83
|
+
};
|
|
72
84
|
})[];
|
|
73
85
|
} | {
|
|
74
86
|
readonly [x: string]: unknown;
|
|
@@ -203,8 +215,8 @@ export declare const routes: (Route<{
|
|
|
203
215
|
} | {
|
|
204
216
|
readonly type: "input_file";
|
|
205
217
|
readonly filename: string;
|
|
206
|
-
readonly detail?: string | undefined;
|
|
207
218
|
readonly file_data?: string | undefined;
|
|
219
|
+
readonly detail?: string | undefined;
|
|
208
220
|
readonly file_url?: string | undefined;
|
|
209
221
|
} | {
|
|
210
222
|
readonly type: "input_text";
|
|
@@ -240,8 +252,8 @@ export declare const routes: (Route<{
|
|
|
240
252
|
} | {
|
|
241
253
|
readonly type: "input_file";
|
|
242
254
|
readonly filename: string;
|
|
243
|
-
readonly detail?: string | undefined;
|
|
244
255
|
readonly file_data?: string | undefined;
|
|
256
|
+
readonly detail?: string | undefined;
|
|
245
257
|
readonly file_url?: string | undefined;
|
|
246
258
|
} | {
|
|
247
259
|
readonly type: "input_text";
|
|
@@ -372,8 +372,8 @@ export declare const routes: (Route<{
|
|
|
372
372
|
} | {
|
|
373
373
|
readonly type: "input_file";
|
|
374
374
|
readonly filename: string;
|
|
375
|
-
readonly detail?: string | undefined;
|
|
376
375
|
readonly file_data?: string | undefined;
|
|
376
|
+
readonly detail?: string | undefined;
|
|
377
377
|
readonly file_url?: string | undefined;
|
|
378
378
|
} | {
|
|
379
379
|
readonly type: "input_text";
|
|
@@ -409,8 +409,8 @@ export declare const routes: (Route<{
|
|
|
409
409
|
} | {
|
|
410
410
|
readonly type: "input_file";
|
|
411
411
|
readonly filename: string;
|
|
412
|
-
readonly detail?: string | undefined;
|
|
413
412
|
readonly file_data?: string | undefined;
|
|
413
|
+
readonly detail?: string | undefined;
|
|
414
414
|
readonly file_url?: string | undefined;
|
|
415
415
|
} | {
|
|
416
416
|
readonly type: "input_text";
|
|
@@ -486,6 +486,12 @@ export declare const routes: (Route<{
|
|
|
486
486
|
readonly image_url: {
|
|
487
487
|
readonly url: string;
|
|
488
488
|
};
|
|
489
|
+
} | {
|
|
490
|
+
readonly type: "file";
|
|
491
|
+
readonly file: {
|
|
492
|
+
readonly filename: string;
|
|
493
|
+
readonly file_data: string;
|
|
494
|
+
};
|
|
489
495
|
})[];
|
|
490
496
|
} | {
|
|
491
497
|
readonly role: "user";
|
|
@@ -501,6 +507,12 @@ export declare const routes: (Route<{
|
|
|
501
507
|
readonly image_url: {
|
|
502
508
|
readonly url: string;
|
|
503
509
|
};
|
|
510
|
+
} | {
|
|
511
|
+
readonly type: "file";
|
|
512
|
+
readonly file: {
|
|
513
|
+
readonly filename: string;
|
|
514
|
+
readonly file_data: string;
|
|
515
|
+
};
|
|
504
516
|
})[];
|
|
505
517
|
} | {
|
|
506
518
|
readonly [x: string]: unknown;
|