@opencode/ai 2.1.3 → 2.2.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 +283 -114
- package/dist/ai-client.d.ts +2 -2
- package/dist/ai-client.js +2 -1
- package/dist/cache-policy.d.ts +4 -0
- package/dist/cache-policy.js +20 -6
- package/dist/decision-client.d.ts +21 -0
- package/dist/decision-client.js +55 -0
- package/dist/decision.d.ts +472 -0
- package/dist/decision.js +158 -0
- package/dist/effect.d.ts +38 -0
- package/dist/effect.js +27 -0
- package/dist/effort-updates.d.ts +2 -2
- package/dist/experimental/cloudflare-run-extraction.d.ts +13 -0
- package/dist/experimental/cloudflare-run-extraction.js +83 -0
- package/dist/experimental/extraction.d.ts +183 -0
- package/dist/experimental/extraction.js +102 -0
- package/dist/experimental/realtime.d.ts +7 -2
- package/dist/experimental/realtime.js +5 -5
- package/dist/experimental.d.ts +2 -3
- package/dist/experimental.js +1 -2
- package/dist/image-client.d.ts +13 -22
- package/dist/image-client.js +0 -1
- package/dist/image.d.ts +154 -324
- package/dist/image.js +4 -11
- package/dist/index.d.ts +1426 -34
- package/dist/index.js +127 -24
- package/dist/llm.d.ts +16 -1
- package/dist/llm.js +34 -0
- package/dist/media-client.d.ts +2 -1
- package/dist/media-model.d.ts +3 -0
- package/dist/media-model.js +4 -1
- package/dist/media.d.ts +0 -7
- package/dist/media.js +0 -6
- package/dist/protocols/alibaba-chat.d.ts +32 -12
- package/dist/protocols/alibaba-images.d.ts +22 -0
- package/dist/protocols/alibaba-images.js +77 -0
- package/dist/protocols/alibaba-messages.d.ts +62 -27
- package/dist/protocols/alibaba-responses.d.ts +41 -38
- package/dist/protocols/anthropic-messages.d.ts +196 -94
- package/dist/protocols/anthropic-messages.js +47 -16
- package/dist/protocols/bedrock-converse.d.ts +140 -47
- package/dist/protocols/bedrock-converse.js +114 -18
- package/dist/protocols/bedrock-event-stream.js +1 -0
- package/dist/protocols/bfl-images.d.ts +9 -0
- package/dist/protocols/bfl-images.js +17 -15
- package/dist/protocols/cartesia-speech.d.ts +32 -50
- package/dist/protocols/cloudflare-run-decisions.d.ts +9 -0
- package/dist/protocols/cloudflare-run-decisions.js +36 -0
- package/dist/protocols/cloudflare-workers-ai-images.d.ts +23 -0
- package/dist/protocols/cloudflare-workers-ai-images.js +80 -0
- package/dist/protocols/cohere-chat.d.ts +7 -8
- package/dist/protocols/deepgram-speech.d.ts +32 -50
- package/dist/protocols/elevenlabs-speech.d.ts +32 -50
- package/dist/protocols/fal-images.d.ts +10 -1
- package/dist/protocols/fal-images.js +16 -25
- package/dist/protocols/fal-video.js +1 -1
- package/dist/protocols/gemini.d.ts +37 -34
- package/dist/protocols/gemini.js +13 -8
- package/dist/protocols/google-images.d.ts +2 -2
- package/dist/protocols/google-images.js +8 -37
- package/dist/protocols/google-interactions.d.ts +18 -14
- package/dist/protocols/google-interactions.js +14 -7
- package/dist/protocols/google-speech.d.ts +32 -50
- package/dist/protocols/google-speech.js +0 -1
- package/dist/protocols/google-transcription.d.ts +32 -50
- package/dist/protocols/google-transcription.js +0 -1
- package/dist/protocols/google-video.d.ts +1 -1
- package/dist/protocols/google-video.js +2 -7
- package/dist/protocols/index.d.ts +3 -0
- package/dist/protocols/index.js +3 -0
- package/dist/protocols/meta-images.d.ts +7 -1
- package/dist/protocols/meta-images.js +10 -8
- package/dist/protocols/meta-messages.d.ts +73 -38
- package/dist/protocols/meta-messages.js +14 -1
- package/dist/protocols/meta-responses.d.ts +84 -78
- package/dist/protocols/meta-responses.js +29 -1
- package/dist/protocols/mistral-chat.d.ts +81 -78
- package/dist/protocols/mistral-chat.js +2 -1
- package/dist/protocols/open-responses-channel.js +47 -46
- package/dist/protocols/open-responses-continuation.d.ts +8 -2
- package/dist/protocols/open-responses-continuation.js +3 -1
- package/dist/protocols/open-responses.d.ts +426 -396
- package/dist/protocols/open-responses.js +16 -25
- package/dist/protocols/openai-chat.d.ts +764 -52
- package/dist/protocols/openai-chat.js +38 -25
- package/dist/protocols/openai-compatible-chat.d.ts +35 -15
- package/dist/protocols/openai-compatible-responses.d.ts +44 -42
- package/dist/protocols/openai-decisions.d.ts +22 -0
- package/dist/protocols/openai-decisions.js +128 -0
- package/dist/protocols/openai-images.d.ts +53 -56
- package/dist/protocols/openai-images.js +100 -34
- package/dist/protocols/openai-responses.d.ts +322 -264
- package/dist/protocols/openai-responses.js +33 -3
- package/dist/protocols/openai-speech.d.ts +32 -50
- package/dist/protocols/openai-speech.js +15 -5
- package/dist/protocols/openai-transcription.d.ts +32 -50
- package/dist/protocols/openai-transcription.js +15 -11
- package/dist/protocols/replicate-images.js +1 -1
- package/dist/protocols/runway-video.d.ts +1 -1
- package/dist/protocols/runway-video.js +1 -1
- package/dist/protocols/shared.d.ts +9 -1
- package/dist/protocols/shared.js +13 -2
- package/dist/protocols/stability-images.d.ts +5 -0
- package/dist/protocols/stability-images.js +4 -9
- package/dist/protocols/system-one.d.ts +101 -0
- package/dist/protocols/system-one.js +230 -0
- package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
- package/dist/protocols/utils/bedrock-cache.js +7 -6
- package/dist/protocols/utils/cache.d.ts +14 -3
- package/dist/protocols/utils/cache.js +11 -4
- package/dist/protocols/utils/gemini-generate-content.d.ts +3 -3
- package/dist/protocols/utils/gemini-generate-content.js +10 -16
- package/dist/protocols/utils/gemini-json-schema.d.ts +5 -0
- package/dist/protocols/utils/gemini-json-schema.js +3 -3
- package/dist/protocols/utils/image-sizing.d.ts +31 -0
- package/dist/protocols/utils/image-sizing.js +73 -0
- package/dist/protocols/utils/media-input.d.ts +4 -5
- package/dist/protocols/utils/media-input.js +8 -5
- package/dist/protocols/utils/partial-json-options.d.ts +0 -1
- package/dist/protocols/utils/partial-json-options.js +0 -1
- package/dist/protocols/utils/speech-stream.d.ts +0 -1
- package/dist/protocols/utils/speech-stream.js +0 -1
- package/dist/protocols/utils/tool-schema.js +15 -5
- package/dist/protocols/utils/tool-stream.d.ts +10 -1
- package/dist/protocols/venice-chat.d.ts +71 -53
- package/dist/protocols/venice-chat.js +7 -6
- package/dist/protocols/xai-images.d.ts +1 -2
- package/dist/protocols/xai-images.js +9 -2
- package/dist/protocols/xai-responses.d.ts +88 -78
- package/dist/protocols/xai-responses.js +28 -2
- package/dist/protocols/xai-video.d.ts +1 -1
- package/dist/protocols/xai-video.js +11 -8
- package/dist/protocols/zai-chat.d.ts +54 -30
- package/dist/protocols/zai-chat.js +8 -3
- package/dist/protocols/zai-images.d.ts +3 -1
- package/dist/protocols/zai-images.js +12 -11
- package/dist/protocols/zai-messages.d.ts +72 -35
- package/dist/protocols/zai-messages.js +3 -2
- package/dist/provider-error.js +24 -7
- package/dist/providers/alibaba/images.d.ts +2 -0
- package/dist/providers/alibaba/images.js +1 -0
- package/dist/providers/alibaba.d.ts +146 -85
- package/dist/providers/alibaba.js +16 -8
- package/dist/providers/amazon-bedrock-mantle.d.ts +277 -218
- package/dist/providers/amazon-bedrock.d.ts +48 -28
- package/dist/providers/amazon-bedrock.js +11 -11
- package/dist/providers/anthropic-compatible.d.ts +64 -29
- package/dist/providers/anthropic.d.ts +64 -29
- package/dist/providers/azure/images.d.ts +2 -0
- package/dist/providers/azure/images.js +1 -0
- package/dist/providers/azure.d.ts +156 -115
- package/dist/providers/azure.js +19 -1
- package/dist/providers/baseten/decisions.d.ts +2 -0
- package/dist/providers/baseten/decisions.js +1 -0
- package/dist/providers/baseten.d.ts +75 -25
- package/dist/providers/baseten.js +41 -8
- package/dist/providers/cerebras.d.ts +66 -24
- package/dist/providers/cloudflare-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-ai-gateway/decisions.js +1 -0
- package/dist/providers/cloudflare-ai-gateway.d.ts +409 -272
- package/dist/providers/cloudflare-ai-gateway.js +33 -6
- package/dist/providers/cloudflare-workers-ai/decisions.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/decisions.js +1 -0
- package/dist/providers/cloudflare-workers-ai/images.d.ts +2 -0
- package/dist/providers/cloudflare-workers-ai/images.js +1 -0
- package/dist/providers/cloudflare-workers-ai.d.ts +79 -25
- package/dist/providers/cloudflare-workers-ai.js +45 -9
- package/dist/providers/cohere.d.ts +117 -75
- package/dist/providers/deepinfra.d.ts +66 -24
- package/dist/providers/deepseek.d.ts +66 -24
- package/dist/providers/digitalocean/decisions.d.ts +2 -0
- package/dist/providers/digitalocean/decisions.js +1 -0
- package/dist/providers/digitalocean/images.d.ts +2 -0
- package/dist/providers/digitalocean/images.js +1 -0
- package/dist/providers/digitalocean.d.ts +108 -37
- package/dist/providers/digitalocean.js +39 -8
- package/dist/providers/fireworks.d.ts +66 -24
- package/dist/providers/google/images.d.ts +2 -0
- package/dist/providers/google/images.js +1 -0
- package/dist/providers/google-vertex/images.d.ts +2 -0
- package/dist/providers/google-vertex/images.js +1 -0
- package/dist/providers/google-vertex-chat.d.ts +33 -12
- package/dist/providers/google-vertex-messages.d.ts +64 -29
- package/dist/providers/google-vertex-mistral.d.ts +17 -17
- package/dist/providers/google-vertex-responses.d.ts +38 -35
- package/dist/providers/google-vertex.d.ts +20 -18
- package/dist/providers/google-vertex.js +32 -15
- package/dist/providers/google.d.ts +22 -21
- package/dist/providers/google.js +15 -8
- package/dist/providers/groq.d.ts +66 -28
- package/dist/providers/groq.js +0 -6
- package/dist/providers/meta.d.ts +144 -85
- package/dist/providers/minimax.d.ts +145 -86
- package/dist/providers/mistral.d.ts +28 -28
- package/dist/providers/moonshot.d.ts +277 -218
- package/dist/providers/open-responses-options.d.ts +0 -1
- package/dist/providers/open-responses-options.js +1 -1
- package/dist/providers/openai/images.d.ts +2 -0
- package/dist/providers/openai/images.js +1 -0
- package/dist/providers/openai-compatible/images.d.ts +2 -0
- package/dist/providers/openai-compatible/images.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +38 -35
- package/dist/providers/openai-compatible.d.ts +36 -13
- package/dist/providers/openai-compatible.js +22 -10
- package/dist/providers/openai-options.d.ts +3 -2
- package/dist/providers/openai-options.js +0 -1
- package/dist/providers/openai.d.ts +146 -109
- package/dist/providers/openai.js +20 -4
- package/dist/providers/opencode/decisions.d.ts +2 -0
- package/dist/providers/opencode/decisions.js +1 -0
- package/dist/providers/opencode.d.ts +9 -10
- package/dist/providers/opencode.js +10 -8
- package/dist/providers/openrouter/decisions.d.ts +2 -0
- package/dist/providers/openrouter/decisions.js +1 -0
- package/dist/providers/openrouter/images.d.ts +2 -0
- package/dist/providers/openrouter/images.js +1 -0
- package/dist/providers/openrouter.d.ts +128 -47
- package/dist/providers/openrouter.js +38 -16
- package/dist/providers/togetherai.d.ts +66 -24
- package/dist/providers/typesafe-ai/decisions.d.ts +2 -0
- package/dist/providers/typesafe-ai/decisions.js +1 -0
- package/dist/providers/typesafe-ai.d.ts +9 -10
- package/dist/providers/typesafe-ai.js +10 -8
- package/dist/providers/venice.d.ts +214 -20
- package/dist/providers/vercel-ai-gateway/decisions.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/decisions.js +1 -0
- package/dist/providers/vercel-ai-gateway/images.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/images.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +10 -16
- package/dist/providers/vercel-ai-gateway.js +31 -85
- package/dist/providers/xai/images.d.ts +2 -0
- package/dist/providers/xai/images.js +1 -0
- package/dist/providers/xai.d.ts +40 -17
- package/dist/providers/xai.js +15 -8
- package/dist/providers/zai/images.d.ts +2 -0
- package/dist/providers/zai/images.js +1 -0
- package/dist/providers/zai-coding-plan.d.ts +224 -85
- package/dist/providers/zai.d.ts +110 -23
- package/dist/providers/zai.js +15 -8
- package/dist/route/auth-options.d.ts +0 -3
- package/dist/route/auth.d.ts +0 -2
- package/dist/route/auth.js +0 -2
- package/dist/route/client.d.ts +2 -4
- package/dist/route/client.js +29 -8
- package/dist/route/decision.d.ts +58 -0
- package/dist/route/decision.js +75 -0
- package/dist/route/executor-service.js +1 -1
- package/dist/route/executor.d.ts +1 -1
- package/dist/route/framing.d.ts +2 -0
- package/dist/route/index.d.ts +3 -0
- package/dist/route/index.js +3 -0
- package/dist/route/media-protocol.d.ts +1 -0
- package/dist/route/media-protocol.js +12 -8
- package/dist/route/media.d.ts +5 -1
- package/dist/route/media.js +6 -2
- package/dist/route/transport/http.js +1 -0
- package/dist/route/transport/index.d.ts +1 -0
- package/dist/schema/events.d.ts +148 -6
- package/dist/schema/events.js +20 -0
- package/dist/schema/messages.d.ts +6 -2
- package/dist/schema/messages.js +3 -0
- package/dist/schema/options.d.ts +5 -3
- package/dist/schema/options.js +8 -3
- package/dist/speech-client.d.ts +13 -22
- package/dist/speech-client.js +0 -1
- package/dist/speech.d.ts +148 -283
- package/dist/speech.js +2 -4
- package/dist/testing.d.ts +25 -24
- package/dist/testing.js +3 -21
- package/dist/transcription-client.d.ts +13 -22
- package/dist/transcription.d.ts +148 -283
- package/dist/transcription.js +1 -1
- package/dist/utils/media-type.js +22 -1
- package/dist/video-client.d.ts +13 -22
- package/dist/video-client.js +0 -1
- package/dist/video.d.ts +115 -250
- package/dist/video.js +3 -5
- package/package.json +516 -13
- package/dist/experimental/evaluation-client.d.ts +0 -21
- package/dist/experimental/evaluation-client.js +0 -64
- package/dist/experimental/evaluation.d.ts +0 -242
- package/dist/experimental/evaluation.js +0 -115
- package/dist/experimental/system-one.d.ts +0 -16
- package/dist/experimental/system-one.js +0 -135
- package/dist/promise.d.ts +0 -1021
- package/dist/promise.js +0 -101
- package/dist/provider.d.ts +0 -23
- package/dist/provider.js +0 -2
|
@@ -22,10 +22,6 @@ export type Settings<Options = ChatOptionsInput> = ProviderPackage.Settings & Op
|
|
|
22
22
|
export declare const routes: (Route<{
|
|
23
23
|
readonly model: string;
|
|
24
24
|
readonly input: readonly ({
|
|
25
|
-
readonly type: "compaction";
|
|
26
|
-
readonly id?: string | null | undefined;
|
|
27
|
-
readonly encrypted_content: string;
|
|
28
|
-
} | {
|
|
29
25
|
readonly type: "configuration_update";
|
|
30
26
|
readonly reasoning: {
|
|
31
27
|
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
@@ -38,10 +34,48 @@ export declare const routes: (Route<{
|
|
|
38
34
|
readonly type: "message";
|
|
39
35
|
readonly role: "developer";
|
|
40
36
|
readonly content: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly type: "function_call_output";
|
|
39
|
+
readonly call_id: string;
|
|
40
|
+
readonly output: string | readonly ({
|
|
41
|
+
readonly type: "input_text";
|
|
42
|
+
readonly text: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly type: "input_video";
|
|
45
|
+
readonly video_url: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly type: "input_image";
|
|
48
|
+
readonly image_url: string;
|
|
49
|
+
readonly detail?: string | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
readonly type: "input_file";
|
|
52
|
+
readonly filename: string;
|
|
53
|
+
readonly detail?: string | undefined;
|
|
54
|
+
readonly file_data?: string | undefined;
|
|
55
|
+
readonly file_url?: string | undefined;
|
|
56
|
+
})[];
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "reasoning";
|
|
59
|
+
readonly id?: string | undefined;
|
|
60
|
+
readonly summary: readonly {
|
|
61
|
+
readonly type: "summary_text";
|
|
62
|
+
readonly text: string;
|
|
63
|
+
}[];
|
|
64
|
+
readonly encrypted_content?: string | null | undefined;
|
|
65
|
+
} | {
|
|
66
|
+
readonly type: "compaction";
|
|
67
|
+
readonly id?: string | null | undefined;
|
|
68
|
+
readonly encrypted_content: string;
|
|
41
69
|
} | {
|
|
42
70
|
readonly type: "message";
|
|
43
71
|
readonly role: "user";
|
|
44
72
|
readonly content: readonly ({
|
|
73
|
+
readonly type: "input_text";
|
|
74
|
+
readonly text: string;
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: "input_video";
|
|
77
|
+
readonly video_url: string;
|
|
78
|
+
} | {
|
|
45
79
|
readonly type: "input_image";
|
|
46
80
|
readonly image_url: string;
|
|
47
81
|
readonly detail?: string | undefined;
|
|
@@ -51,9 +85,6 @@ export declare const routes: (Route<{
|
|
|
51
85
|
readonly detail?: string | undefined;
|
|
52
86
|
readonly file_data?: string | undefined;
|
|
53
87
|
readonly file_url?: string | undefined;
|
|
54
|
-
} | {
|
|
55
|
-
readonly type: "input_text";
|
|
56
|
-
readonly text: string;
|
|
57
88
|
})[];
|
|
58
89
|
readonly id?: string | undefined;
|
|
59
90
|
readonly status?: string | undefined;
|
|
@@ -67,14 +98,6 @@ export declare const routes: (Route<{
|
|
|
67
98
|
}[];
|
|
68
99
|
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
69
100
|
readonly status?: string | undefined;
|
|
70
|
-
} | {
|
|
71
|
-
readonly type: "reasoning";
|
|
72
|
-
readonly id?: string | undefined;
|
|
73
|
-
readonly summary: readonly {
|
|
74
|
-
readonly type: "summary_text";
|
|
75
|
-
readonly text: string;
|
|
76
|
-
}[];
|
|
77
|
-
readonly encrypted_content?: string | null | undefined;
|
|
78
101
|
} | {
|
|
79
102
|
readonly type: "function_call";
|
|
80
103
|
readonly id?: string | undefined;
|
|
@@ -82,26 +105,6 @@ export declare const routes: (Route<{
|
|
|
82
105
|
readonly name: string;
|
|
83
106
|
readonly namespace?: string | undefined;
|
|
84
107
|
readonly arguments: string;
|
|
85
|
-
} | {
|
|
86
|
-
readonly type: "function_call_output";
|
|
87
|
-
readonly call_id: string;
|
|
88
|
-
readonly output: string | readonly ({
|
|
89
|
-
readonly type: "input_image";
|
|
90
|
-
readonly image_url: string;
|
|
91
|
-
readonly detail?: string | undefined;
|
|
92
|
-
} | {
|
|
93
|
-
readonly type: "input_file";
|
|
94
|
-
readonly filename: string;
|
|
95
|
-
readonly detail?: string | undefined;
|
|
96
|
-
readonly file_data?: string | undefined;
|
|
97
|
-
readonly file_url?: string | undefined;
|
|
98
|
-
} | {
|
|
99
|
-
readonly type: "input_text";
|
|
100
|
-
readonly text: string;
|
|
101
|
-
} | {
|
|
102
|
-
readonly type: "input_video";
|
|
103
|
-
readonly video_url: string;
|
|
104
|
-
})[];
|
|
105
108
|
} | {
|
|
106
109
|
readonly [x: string]: unknown;
|
|
107
110
|
readonly type: "web_search_call";
|
|
@@ -201,44 +204,54 @@ export declare const routes: (Route<{
|
|
|
201
204
|
readonly messages: readonly ({
|
|
202
205
|
readonly role: "system";
|
|
203
206
|
readonly content: string | readonly ({
|
|
204
|
-
readonly type: "text";
|
|
205
|
-
readonly text: string;
|
|
206
|
-
readonly cache_control?: {
|
|
207
|
-
readonly type: "ephemeral";
|
|
208
|
-
readonly ttl?: string | undefined;
|
|
209
|
-
} | undefined;
|
|
210
|
-
} | {
|
|
211
207
|
readonly type: "image_url";
|
|
212
208
|
readonly image_url: {
|
|
213
209
|
readonly url: string;
|
|
214
210
|
};
|
|
211
|
+
} | {
|
|
212
|
+
readonly type: "video_url";
|
|
213
|
+
readonly video_url: {
|
|
214
|
+
readonly url: string;
|
|
215
|
+
};
|
|
215
216
|
} | {
|
|
216
217
|
readonly type: "file";
|
|
217
218
|
readonly file: {
|
|
218
219
|
readonly filename: string;
|
|
219
220
|
readonly file_data: string;
|
|
220
221
|
};
|
|
221
|
-
}
|
|
222
|
-
} | {
|
|
223
|
-
readonly role: "user";
|
|
224
|
-
readonly content: string | readonly ({
|
|
222
|
+
} | {
|
|
225
223
|
readonly type: "text";
|
|
226
224
|
readonly text: string;
|
|
227
225
|
readonly cache_control?: {
|
|
228
226
|
readonly type: "ephemeral";
|
|
229
227
|
readonly ttl?: string | undefined;
|
|
230
228
|
} | undefined;
|
|
231
|
-
}
|
|
229
|
+
})[];
|
|
230
|
+
} | {
|
|
231
|
+
readonly role: "user";
|
|
232
|
+
readonly content: string | readonly ({
|
|
232
233
|
readonly type: "image_url";
|
|
233
234
|
readonly image_url: {
|
|
234
235
|
readonly url: string;
|
|
235
236
|
};
|
|
237
|
+
} | {
|
|
238
|
+
readonly type: "video_url";
|
|
239
|
+
readonly video_url: {
|
|
240
|
+
readonly url: string;
|
|
241
|
+
};
|
|
236
242
|
} | {
|
|
237
243
|
readonly type: "file";
|
|
238
244
|
readonly file: {
|
|
239
245
|
readonly filename: string;
|
|
240
246
|
readonly file_data: string;
|
|
241
247
|
};
|
|
248
|
+
} | {
|
|
249
|
+
readonly type: "text";
|
|
250
|
+
readonly text: string;
|
|
251
|
+
readonly cache_control?: {
|
|
252
|
+
readonly type: "ephemeral";
|
|
253
|
+
readonly ttl?: string | undefined;
|
|
254
|
+
} | undefined;
|
|
242
255
|
})[];
|
|
243
256
|
} | {
|
|
244
257
|
readonly role: "tool";
|
|
@@ -307,7 +320,18 @@ export declare const routes: (Route<{
|
|
|
307
320
|
} | undefined;
|
|
308
321
|
readonly store?: boolean | undefined;
|
|
309
322
|
readonly prompt_cache_key?: string | undefined;
|
|
323
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
324
|
+
readonly prompt_cache_options?: {
|
|
325
|
+
readonly ttl?: string | undefined;
|
|
326
|
+
} | undefined;
|
|
310
327
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
328
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
329
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
330
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
331
|
+
readonly metadata?: {
|
|
332
|
+
readonly [x: string]: string;
|
|
333
|
+
} | undefined;
|
|
334
|
+
readonly safety_identifier?: string | undefined;
|
|
311
335
|
readonly tool_stream?: boolean | undefined;
|
|
312
336
|
readonly max_completion_tokens?: number | undefined;
|
|
313
337
|
readonly max_tokens?: number | undefined;
|
|
@@ -318,12 +342,12 @@ export declare const routes: (Route<{
|
|
|
318
342
|
readonly seed?: number | undefined;
|
|
319
343
|
readonly stop?: readonly string[] | undefined;
|
|
320
344
|
readonly thinking?: {
|
|
321
|
-
readonly type?:
|
|
345
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
322
346
|
readonly clear_thinking?: boolean | undefined;
|
|
323
347
|
} | undefined;
|
|
324
348
|
readonly do_sample?: boolean | undefined;
|
|
325
349
|
readonly response_format?: {
|
|
326
|
-
readonly type:
|
|
350
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
327
351
|
} | undefined;
|
|
328
352
|
readonly request_id?: string | undefined;
|
|
329
353
|
readonly user_id?: string | undefined;
|
|
@@ -345,7 +369,7 @@ export declare const routes: (Route<{
|
|
|
345
369
|
readonly text: string;
|
|
346
370
|
readonly cache_control?: {
|
|
347
371
|
readonly type: "ephemeral";
|
|
348
|
-
readonly ttl?:
|
|
372
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
349
373
|
} | undefined;
|
|
350
374
|
}[] | undefined;
|
|
351
375
|
readonly messages: readonly ({
|
|
@@ -355,7 +379,7 @@ export declare const routes: (Route<{
|
|
|
355
379
|
readonly text: string;
|
|
356
380
|
readonly cache_control?: {
|
|
357
381
|
readonly type: "ephemeral";
|
|
358
|
-
readonly ttl?:
|
|
382
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
359
383
|
} | undefined;
|
|
360
384
|
} | {
|
|
361
385
|
readonly type: "image";
|
|
@@ -372,11 +396,28 @@ export declare const routes: (Route<{
|
|
|
372
396
|
};
|
|
373
397
|
readonly cache_control?: {
|
|
374
398
|
readonly type: "ephemeral";
|
|
375
|
-
readonly ttl?:
|
|
399
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
376
400
|
} | undefined;
|
|
377
401
|
readonly transformations?: {
|
|
378
402
|
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
379
403
|
} | undefined;
|
|
404
|
+
} | {
|
|
405
|
+
readonly type: "video";
|
|
406
|
+
readonly source: {
|
|
407
|
+
readonly type: "base64";
|
|
408
|
+
readonly media_type: string;
|
|
409
|
+
readonly data: string;
|
|
410
|
+
} | {
|
|
411
|
+
readonly type: "url";
|
|
412
|
+
readonly url: string;
|
|
413
|
+
} | {
|
|
414
|
+
readonly type: "file";
|
|
415
|
+
readonly file_id: string;
|
|
416
|
+
};
|
|
417
|
+
readonly cache_control?: {
|
|
418
|
+
readonly type: "ephemeral";
|
|
419
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
420
|
+
} | undefined;
|
|
380
421
|
} | {
|
|
381
422
|
readonly type: "document";
|
|
382
423
|
readonly source: {
|
|
@@ -396,7 +437,7 @@ export declare const routes: (Route<{
|
|
|
396
437
|
};
|
|
397
438
|
readonly cache_control?: {
|
|
398
439
|
readonly type: "ephemeral";
|
|
399
|
-
readonly ttl?:
|
|
440
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
400
441
|
} | undefined;
|
|
401
442
|
readonly title?: string | undefined;
|
|
402
443
|
readonly context?: string | undefined;
|
|
@@ -411,7 +452,7 @@ export declare const routes: (Route<{
|
|
|
411
452
|
readonly text: string;
|
|
412
453
|
readonly cache_control?: {
|
|
413
454
|
readonly type: "ephemeral";
|
|
414
|
-
readonly ttl?:
|
|
455
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
415
456
|
} | undefined;
|
|
416
457
|
} | {
|
|
417
458
|
readonly type: "image";
|
|
@@ -428,11 +469,28 @@ export declare const routes: (Route<{
|
|
|
428
469
|
};
|
|
429
470
|
readonly cache_control?: {
|
|
430
471
|
readonly type: "ephemeral";
|
|
431
|
-
readonly ttl?:
|
|
472
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
432
473
|
} | undefined;
|
|
433
474
|
readonly transformations?: {
|
|
434
475
|
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
435
476
|
} | undefined;
|
|
477
|
+
} | {
|
|
478
|
+
readonly type: "video";
|
|
479
|
+
readonly source: {
|
|
480
|
+
readonly type: "base64";
|
|
481
|
+
readonly media_type: string;
|
|
482
|
+
readonly data: string;
|
|
483
|
+
} | {
|
|
484
|
+
readonly type: "url";
|
|
485
|
+
readonly url: string;
|
|
486
|
+
} | {
|
|
487
|
+
readonly type: "file";
|
|
488
|
+
readonly file_id: string;
|
|
489
|
+
};
|
|
490
|
+
readonly cache_control?: {
|
|
491
|
+
readonly type: "ephemeral";
|
|
492
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
493
|
+
} | undefined;
|
|
436
494
|
} | {
|
|
437
495
|
readonly type: "document";
|
|
438
496
|
readonly source: {
|
|
@@ -452,7 +510,7 @@ export declare const routes: (Route<{
|
|
|
452
510
|
};
|
|
453
511
|
readonly cache_control?: {
|
|
454
512
|
readonly type: "ephemeral";
|
|
455
|
-
readonly ttl?:
|
|
513
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
456
514
|
} | undefined;
|
|
457
515
|
readonly title?: string | undefined;
|
|
458
516
|
readonly context?: string | undefined;
|
|
@@ -463,43 +521,35 @@ export declare const routes: (Route<{
|
|
|
463
521
|
readonly is_error?: boolean | undefined;
|
|
464
522
|
readonly cache_control?: {
|
|
465
523
|
readonly type: "ephemeral";
|
|
466
|
-
readonly ttl?:
|
|
524
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
467
525
|
} | undefined;
|
|
468
526
|
})[];
|
|
469
527
|
} | {
|
|
470
528
|
readonly role: "assistant";
|
|
471
529
|
readonly content: readonly ({
|
|
530
|
+
readonly type: "compaction";
|
|
531
|
+
readonly content: string | null;
|
|
532
|
+
} | {
|
|
472
533
|
readonly type: "text";
|
|
473
534
|
readonly text: string;
|
|
474
535
|
readonly cache_control?: {
|
|
475
536
|
readonly type: "ephemeral";
|
|
476
|
-
readonly ttl?:
|
|
537
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
477
538
|
} | undefined;
|
|
478
|
-
} | {
|
|
479
|
-
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
480
|
-
readonly tool_use_id: string;
|
|
481
|
-
readonly content: unknown;
|
|
482
|
-
readonly cache_control?: {
|
|
483
|
-
readonly type: "ephemeral";
|
|
484
|
-
readonly ttl?: "1h" | "5m" | undefined;
|
|
485
|
-
} | undefined;
|
|
486
|
-
} | {
|
|
487
|
-
readonly type: "compaction";
|
|
488
|
-
readonly content: string | null;
|
|
489
539
|
} | {
|
|
490
540
|
readonly type: "thinking";
|
|
491
541
|
readonly thinking: string;
|
|
492
542
|
readonly signature: string;
|
|
493
543
|
readonly cache_control?: {
|
|
494
544
|
readonly type: "ephemeral";
|
|
495
|
-
readonly ttl?:
|
|
545
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
496
546
|
} | undefined;
|
|
497
547
|
} | {
|
|
498
548
|
readonly type: "redacted_thinking";
|
|
499
549
|
readonly data: string;
|
|
500
550
|
readonly cache_control?: {
|
|
501
551
|
readonly type: "ephemeral";
|
|
502
|
-
readonly ttl?:
|
|
552
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
503
553
|
} | undefined;
|
|
504
554
|
} | {
|
|
505
555
|
readonly type: "tool_use";
|
|
@@ -508,7 +558,7 @@ export declare const routes: (Route<{
|
|
|
508
558
|
readonly input: unknown;
|
|
509
559
|
readonly cache_control?: {
|
|
510
560
|
readonly type: "ephemeral";
|
|
511
|
-
readonly ttl?:
|
|
561
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
512
562
|
} | undefined;
|
|
513
563
|
} | {
|
|
514
564
|
readonly type: "server_tool_use";
|
|
@@ -517,7 +567,15 @@ export declare const routes: (Route<{
|
|
|
517
567
|
readonly input: unknown;
|
|
518
568
|
readonly cache_control?: {
|
|
519
569
|
readonly type: "ephemeral";
|
|
520
|
-
readonly ttl?:
|
|
570
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
571
|
+
} | undefined;
|
|
572
|
+
} | {
|
|
573
|
+
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
574
|
+
readonly tool_use_id: string;
|
|
575
|
+
readonly content: unknown;
|
|
576
|
+
readonly cache_control?: {
|
|
577
|
+
readonly type: "ephemeral";
|
|
578
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
521
579
|
} | undefined;
|
|
522
580
|
})[];
|
|
523
581
|
} | {
|
|
@@ -527,7 +585,7 @@ export declare const routes: (Route<{
|
|
|
527
585
|
readonly text: string;
|
|
528
586
|
readonly cache_control?: {
|
|
529
587
|
readonly type: "ephemeral";
|
|
530
|
-
readonly ttl?:
|
|
588
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
531
589
|
} | undefined;
|
|
532
590
|
}[];
|
|
533
591
|
readonly output_config?: {
|
|
@@ -542,7 +600,7 @@ export declare const routes: (Route<{
|
|
|
542
600
|
};
|
|
543
601
|
readonly cache_control?: {
|
|
544
602
|
readonly type: "ephemeral";
|
|
545
|
-
readonly ttl?:
|
|
603
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
546
604
|
} | undefined;
|
|
547
605
|
}[] | undefined;
|
|
548
606
|
readonly tool_choice?: {
|
|
@@ -570,7 +628,7 @@ export declare const routes: (Route<{
|
|
|
570
628
|
} | undefined;
|
|
571
629
|
readonly cache_control?: {
|
|
572
630
|
readonly type: "ephemeral";
|
|
573
|
-
readonly ttl?:
|
|
631
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
574
632
|
} | undefined;
|
|
575
633
|
readonly container?: string | {
|
|
576
634
|
readonly id?: string | null | undefined;
|
|
@@ -583,28 +641,109 @@ export declare const routes: (Route<{
|
|
|
583
641
|
readonly user_id?: string | null | undefined;
|
|
584
642
|
} | undefined;
|
|
585
643
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
644
|
+
readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
|
|
586
645
|
readonly thinking?: {
|
|
587
|
-
readonly type:
|
|
646
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
588
647
|
} | undefined;
|
|
589
648
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
|
|
590
649
|
export declare const configure: (input?: Config) => {
|
|
591
650
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
592
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
593
|
-
|
|
594
|
-
|
|
651
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
652
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
653
|
+
readonly thinking?: {
|
|
654
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
655
|
+
readonly clear_thinking?: boolean | undefined;
|
|
656
|
+
} | undefined;
|
|
657
|
+
readonly toolStream?: boolean | undefined;
|
|
658
|
+
readonly doSample?: boolean | undefined;
|
|
659
|
+
readonly responseFormat?: {
|
|
660
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
661
|
+
} | undefined;
|
|
662
|
+
readonly requestID?: string | undefined;
|
|
663
|
+
readonly userID?: string | undefined;
|
|
664
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
665
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
666
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
667
|
+
readonly thinking?: {
|
|
668
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
669
|
+
readonly clear_thinking?: boolean | undefined;
|
|
670
|
+
} | undefined;
|
|
671
|
+
readonly toolStream?: boolean | undefined;
|
|
672
|
+
readonly doSample?: boolean | undefined;
|
|
673
|
+
readonly responseFormat?: {
|
|
674
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
675
|
+
} | undefined;
|
|
676
|
+
readonly requestID?: string | undefined;
|
|
677
|
+
readonly userID?: string | undefined;
|
|
678
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
679
|
+
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
680
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
681
|
+
readonly thinking?: {
|
|
682
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
683
|
+
} | undefined;
|
|
684
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
595
685
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
596
686
|
configure: typeof configure;
|
|
597
687
|
};
|
|
598
688
|
export declare const provider: {
|
|
599
689
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
600
|
-
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
601
|
-
|
|
602
|
-
|
|
690
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
691
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
692
|
+
readonly thinking?: {
|
|
693
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
694
|
+
readonly clear_thinking?: boolean | undefined;
|
|
695
|
+
} | undefined;
|
|
696
|
+
readonly toolStream?: boolean | undefined;
|
|
697
|
+
readonly doSample?: boolean | undefined;
|
|
698
|
+
readonly responseFormat?: {
|
|
699
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
700
|
+
} | undefined;
|
|
701
|
+
readonly requestID?: string | undefined;
|
|
702
|
+
readonly userID?: string | undefined;
|
|
703
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
704
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
705
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
706
|
+
readonly thinking?: {
|
|
707
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
708
|
+
readonly clear_thinking?: boolean | undefined;
|
|
709
|
+
} | undefined;
|
|
710
|
+
readonly toolStream?: boolean | undefined;
|
|
711
|
+
readonly doSample?: boolean | undefined;
|
|
712
|
+
readonly responseFormat?: {
|
|
713
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
714
|
+
} | undefined;
|
|
715
|
+
readonly requestID?: string | undefined;
|
|
716
|
+
readonly userID?: string | undefined;
|
|
717
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
718
|
+
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
719
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
720
|
+
readonly thinking?: {
|
|
721
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
722
|
+
} | undefined;
|
|
723
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
603
724
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
604
725
|
configure: typeof configure;
|
|
605
726
|
};
|
|
606
|
-
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<
|
|
607
|
-
|
|
727
|
+
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
728
|
+
readonly reasoningEffort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
729
|
+
readonly thinking?: {
|
|
730
|
+
readonly type?: import("../schema/options.js").OpenString<"disabled" | "enabled"> | undefined;
|
|
731
|
+
readonly clear_thinking?: boolean | undefined;
|
|
732
|
+
} | undefined;
|
|
733
|
+
readonly toolStream?: boolean | undefined;
|
|
734
|
+
readonly doSample?: boolean | undefined;
|
|
735
|
+
readonly responseFormat?: {
|
|
736
|
+
readonly type: import("../schema/options.js").OpenString<"json_object" | "text">;
|
|
737
|
+
} | undefined;
|
|
738
|
+
readonly requestID?: string | undefined;
|
|
739
|
+
readonly userID?: string | undefined;
|
|
740
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
741
|
+
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
742
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
743
|
+
readonly thinking?: {
|
|
744
|
+
readonly type: import("../schema/options.js").OpenString<"adaptive" | "disabled" | "enabled">;
|
|
745
|
+
} | undefined;
|
|
746
|
+
}, import("../route/client.js").CompactionOperations | undefined>;
|
|
608
747
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
609
748
|
export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
|
|
610
749
|
export * as ZAICodingPlan from "./zai-coding-plan.js";
|