@opencode/ai 2.1.4 → 2.2.1
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 +339 -166
- 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 +50 -14
- package/dist/image-client.js +0 -1
- package/dist/image.d.ts +6 -176
- package/dist/image.js +4 -11
- package/dist/index.d.ts +1444 -34
- package/dist/index.js +139 -24
- package/dist/llm.d.ts +16 -1
- package/dist/llm.js +34 -0
- package/dist/media-client.d.ts +3 -1
- package/dist/media-client.js +1 -0
- 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 +59 -4
- package/dist/protocols/alibaba-images.d.ts +22 -0
- package/dist/protocols/alibaba-images.js +77 -0
- package/dist/protocols/alibaba-messages.d.ts +52 -17
- package/dist/protocols/alibaba-responses.d.ts +26 -6
- package/dist/protocols/anthropic-messages.d.ts +160 -54
- package/dist/protocols/anthropic-messages.js +44 -13
- package/dist/protocols/bedrock-converse.d.ts +110 -15
- package/dist/protocols/bedrock-converse.js +112 -15
- package/dist/protocols/bedrock-event-stream.js +1 -0
- package/dist/protocols/cartesia-speech.d.ts +0 -18
- 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/deepgram-speech.d.ts +0 -18
- package/dist/protocols/elevenlabs-speech.d.ts +0 -18
- package/dist/protocols/gemini.d.ts +3 -0
- package/dist/protocols/gemini.js +11 -6
- package/dist/protocols/google-images.d.ts +2 -2
- package/dist/protocols/google-images.js +10 -37
- package/dist/protocols/google-interactions.d.ts +4 -0
- package/dist/protocols/google-interactions.js +12 -5
- package/dist/protocols/google-speech.d.ts +0 -18
- package/dist/protocols/google-speech.js +0 -1
- package/dist/protocols/google-transcription.d.ts +0 -18
- 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 +52 -17
- package/dist/protocols/meta-messages.js +14 -1
- package/dist/protocols/meta-responses.d.ts +46 -6
- package/dist/protocols/meta-responses.js +29 -1
- package/dist/protocols/minimax-images.d.ts +25 -0
- package/dist/protocols/minimax-images.js +150 -0
- package/dist/protocols/open-responses.d.ts +212 -27
- package/dist/protocols/open-responses.js +116 -54
- package/dist/protocols/openai-chat.d.ts +1135 -31
- package/dist/protocols/openai-chat.js +155 -60
- package/dist/protocols/openai-compatible-chat.d.ts +57 -5
- package/dist/protocols/openai-compatible-responses.d.ts +28 -8
- package/dist/protocols/openai-decisions.d.ts +22 -0
- package/dist/protocols/openai-decisions.js +128 -0
- package/dist/protocols/openai-freeform.d.ts +47 -0
- package/dist/protocols/openai-freeform.js +54 -0
- package/dist/protocols/openai-images.d.ts +36 -24
- package/dist/protocols/openai-images.js +137 -39
- package/dist/protocols/openai-responses.d.ts +202 -42
- package/dist/protocols/openai-responses.js +49 -10
- package/dist/protocols/openai-speech.d.ts +0 -18
- package/dist/protocols/openai-speech.js +15 -5
- package/dist/protocols/openai-transcription.d.ts +0 -18
- package/dist/protocols/openai-transcription.js +3 -4
- 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/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/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 +9 -0
- package/dist/protocols/venice-chat.d.ts +58 -4
- package/dist/protocols/venice-chat.js +2 -2
- package/dist/protocols/xai-images.d.ts +7 -2
- package/dist/protocols/xai-images.js +11 -5
- package/dist/protocols/xai-responses.d.ts +30 -3
- package/dist/protocols/xai-responses.js +30 -3
- package/dist/protocols/xai-video.d.ts +1 -1
- package/dist/protocols/xai-video.js +11 -8
- package/dist/protocols/zai-chat.d.ts +60 -4
- package/dist/protocols/zai-images.d.ts +3 -1
- package/dist/protocols/zai-images.js +12 -11
- package/dist/protocols/zai-messages.d.ts +52 -17
- package/dist/provider-error.js +23 -7
- package/dist/provider-package.d.ts +2 -0
- package/dist/providers/alibaba/images.d.ts +2 -0
- package/dist/providers/alibaba/images.js +1 -0
- package/dist/providers/alibaba.d.ts +137 -28
- package/dist/providers/alibaba.js +16 -8
- package/dist/providers/amazon-bedrock-mantle.d.ts +259 -145
- package/dist/providers/amazon-bedrock-mantle.js +1 -1
- package/dist/providers/amazon-bedrock.d.ts +34 -14
- package/dist/providers/amazon-bedrock.js +11 -11
- package/dist/providers/anthropic-compatible.d.ts +53 -18
- package/dist/providers/anthropic.d.ts +53 -18
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/azure/images.d.ts +2 -0
- package/dist/providers/azure/images.js +1 -0
- package/dist/providers/azure.d.ts +129 -24
- 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 +124 -12
- package/dist/providers/baseten.js +41 -8
- package/dist/providers/cerebras.d.ts +115 -11
- package/dist/providers/cerebras.js +1 -1
- 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 +290 -60
- package/dist/providers/cloudflare-ai-gateway.js +32 -4
- 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 +128 -12
- package/dist/providers/cloudflare-workers-ai.js +45 -9
- package/dist/providers/cohere/chat.d.ts +1 -1
- package/dist/providers/cohere/chat.js +1 -1
- package/dist/providers/cohere.d.ts +115 -11
- package/dist/providers/cohere.js +1 -1
- package/dist/providers/deepinfra.d.ts +115 -11
- package/dist/providers/deepinfra.js +1 -1
- package/dist/providers/deepseek.d.ts +115 -11
- package/dist/providers/deepseek.js +1 -1
- 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/responses.d.ts +4 -0
- package/dist/providers/digitalocean/responses.js +1 -0
- package/dist/providers/digitalocean.d.ts +390 -20
- package/dist/providers/digitalocean.js +53 -11
- package/dist/providers/fireworks.d.ts +115 -11
- package/dist/providers/fireworks.js +1 -1
- package/dist/providers/google/images.d.ts +2 -0
- package/dist/providers/google/images.js +1 -0
- package/dist/providers/google/interactions.d.ts +1 -1
- package/dist/providers/google/interactions.js +1 -1
- 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 +57 -5
- package/dist/providers/google-vertex-chat.js +1 -1
- package/dist/providers/google-vertex-interactions.d.ts +1 -1
- package/dist/providers/google-vertex-interactions.js +1 -1
- package/dist/providers/google-vertex-messages.d.ts +53 -18
- package/dist/providers/google-vertex-messages.js +1 -1
- package/dist/providers/google-vertex-mistral.d.ts +1 -1
- package/dist/providers/google-vertex-mistral.js +1 -1
- package/dist/providers/google-vertex-responses.d.ts +24 -4
- package/dist/providers/google-vertex-responses.js +1 -1
- package/dist/providers/google-vertex.d.ts +4 -2
- package/dist/providers/google-vertex.js +30 -13
- package/dist/providers/google.d.ts +6 -5
- package/dist/providers/google.js +15 -8
- package/dist/providers/groq.d.ts +119 -15
- package/dist/providers/groq.js +1 -7
- package/dist/providers/index.d.ts +0 -4
- package/dist/providers/index.js +0 -4
- package/dist/providers/meta/images.d.ts +2 -0
- package/dist/providers/meta/images.js +1 -0
- package/dist/providers/meta.d.ts +254 -146
- package/dist/providers/meta.js +2 -1
- package/dist/providers/minimax/chat.d.ts +1 -1
- package/dist/providers/minimax/chat.js +1 -1
- package/dist/providers/minimax/images.d.ts +3 -0
- package/dist/providers/minimax/images.js +1 -0
- package/dist/providers/minimax/responses.d.ts +1 -1
- package/dist/providers/minimax/responses.js +1 -1
- package/dist/providers/minimax.d.ts +139 -26
- package/dist/providers/minimax.js +22 -9
- package/dist/providers/mistral.d.ts +3 -3
- package/dist/providers/mistral.js +1 -1
- package/dist/providers/moonshot/messages.d.ts +1 -1
- package/dist/providers/moonshot/messages.js +1 -1
- package/dist/providers/moonshot/responses.d.ts +1 -1
- package/dist/providers/moonshot/responses.js +1 -1
- package/dist/providers/moonshot.d.ts +132 -25
- package/dist/providers/moonshot.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 +24 -4
- package/dist/providers/openai-compatible.d.ts +62 -8
- package/dist/providers/openai-compatible.js +29 -10
- package/dist/providers/openai-options.d.ts +3 -1
- package/dist/providers/openai.d.ts +103 -18
- package/dist/providers/openai.js +23 -5
- package/dist/providers/opencode/decisions.d.ts +2 -0
- package/dist/providers/opencode/decisions.js +1 -0
- package/dist/providers/opencode.d.ts +11 -12
- 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/responses.d.ts +4 -0
- package/dist/providers/openrouter/responses.js +1 -0
- package/dist/providers/openrouter.d.ts +446 -35
- package/dist/providers/openrouter.js +78 -27
- package/dist/providers/togetherai.d.ts +115 -11
- package/dist/providers/togetherai.js +1 -1
- 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 +11 -12
- package/dist/providers/typesafe-ai.js +10 -8
- package/dist/providers/venice/responses.d.ts +4 -0
- package/dist/providers/venice/responses.js +1 -0
- package/dist/providers/venice.d.ts +261 -9
- package/dist/providers/venice.js +33 -17
- 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 +16 -22
- package/dist/providers/vercel-ai-gateway.js +41 -85
- package/dist/providers/xai/images.d.ts +2 -0
- package/dist/providers/xai/images.js +1 -0
- package/dist/providers/xai.d.ts +66 -12
- 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/messages.d.ts +1 -1
- package/dist/providers/zai-coding-plan/messages.js +1 -1
- package/dist/providers/zai-coding-plan/responses.d.ts +1 -1
- package/dist/providers/zai-coding-plan/responses.js +1 -1
- package/dist/providers/zai-coding-plan.d.ts +132 -25
- package/dist/providers/zai-coding-plan.js +1 -1
- package/dist/providers/zai.d.ts +62 -9
- package/dist/providers/zai.js +15 -8
- package/dist/route/auth.d.ts +1 -1
- package/dist/route/client.d.ts +2 -2
- package/dist/route/client.js +26 -4
- package/dist/route/decision.d.ts +58 -0
- package/dist/route/decision.js +75 -0
- 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 +3 -4
- package/dist/route/media-protocol.js +12 -8
- package/dist/route/media.d.ts +6 -2
- package/dist/route/media.js +8 -6
- 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 +41 -3
- package/dist/schema/messages.js +23 -0
- package/dist/schema/options.d.ts +5 -3
- package/dist/schema/options.js +8 -3
- package/dist/speech-client.d.ts +53 -14
- package/dist/speech-client.js +0 -1
- package/dist/speech.d.ts +0 -135
- package/dist/speech.js +2 -4
- package/dist/testing/decision.d.ts +16 -0
- package/dist/testing/decision.js +20 -0
- package/dist/testing/image.d.ts +14 -0
- package/dist/testing/image.js +12 -0
- package/dist/testing/media.d.ts +18 -0
- package/dist/testing/media.js +36 -0
- package/dist/testing/script.d.ts +28 -0
- package/dist/testing/script.js +60 -0
- package/dist/testing/speech.d.ts +14 -0
- package/dist/testing/speech.js +12 -0
- package/dist/testing/transcription.d.ts +14 -0
- package/dist/testing/transcription.js +12 -0
- package/dist/testing/video.d.ts +14 -0
- package/dist/testing/video.js +12 -0
- package/dist/testing.d.ts +35 -45
- package/dist/testing.js +14 -75
- package/dist/tool.d.ts +12 -1
- package/dist/tool.js +10 -2
- package/dist/transcription-client.d.ts +69 -14
- package/dist/transcription.d.ts +0 -135
- package/dist/transcription.js +1 -1
- package/dist/utils/media-type.js +22 -1
- package/dist/video-client.d.ts +46 -14
- package/dist/video-client.js +0 -1
- package/dist/video.d.ts +1 -136
- package/dist/video.js +3 -5
- package/package.json +497 -11
- 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 -108
- 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/protocols/bfl-images.d.ts +0 -38
- package/dist/protocols/bfl-images.js +0 -153
- package/dist/protocols/fal-images.d.ts +0 -25
- package/dist/protocols/fal-images.js +0 -104
- package/dist/protocols/fal-video.d.ts +0 -29
- package/dist/protocols/fal-video.js +0 -73
- package/dist/protocols/replicate-images.d.ts +0 -28
- package/dist/protocols/replicate-images.js +0 -127
- package/dist/protocols/stability-images.d.ts +0 -39
- package/dist/protocols/stability-images.js +0 -136
- package/dist/protocols/utils/fal-queue.d.ts +0 -26
- package/dist/protocols/utils/fal-queue.js +0 -67
- package/dist/provider.d.ts +0 -23
- package/dist/provider.js +0 -2
- package/dist/providers/black-forest-labs.d.ts +0 -21
- package/dist/providers/black-forest-labs.js +0 -23
- package/dist/providers/fal.d.ts +0 -24
- package/dist/providers/fal.js +0 -26
- package/dist/providers/replicate.d.ts +0 -21
- package/dist/providers/replicate.js +0 -17
- package/dist/providers/stability.d.ts +0 -23
- package/dist/providers/stability.js +0 -18
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
|
+
import { type MiniMaxImageOptions } from "../protocols/minimax-images.js";
|
|
3
4
|
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
4
5
|
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
5
|
-
import { type ModelID } from "../schema/index.js";
|
|
6
|
+
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
6
7
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
8
|
export type MessagesOptionsInput = {
|
|
8
9
|
/** M3 defaults to disabled; M2.x always thinks. */
|
|
@@ -33,6 +34,7 @@ export type Settings<Options = MessagesOptionsInput> = ProviderPackage.Settings
|
|
|
33
34
|
readonly apiKey?: string;
|
|
34
35
|
readonly baseURL?: string;
|
|
35
36
|
};
|
|
37
|
+
export type { MiniMaxImageOptions };
|
|
36
38
|
export declare const routes: (Route<{
|
|
37
39
|
readonly context_management?: {
|
|
38
40
|
readonly edits: readonly {
|
|
@@ -51,7 +53,7 @@ export declare const routes: (Route<{
|
|
|
51
53
|
readonly text: string;
|
|
52
54
|
readonly cache_control?: {
|
|
53
55
|
readonly type: "ephemeral";
|
|
54
|
-
readonly ttl?:
|
|
56
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
55
57
|
} | undefined;
|
|
56
58
|
}[] | undefined;
|
|
57
59
|
readonly messages: readonly ({
|
|
@@ -61,7 +63,7 @@ export declare const routes: (Route<{
|
|
|
61
63
|
readonly text: string;
|
|
62
64
|
readonly cache_control?: {
|
|
63
65
|
readonly type: "ephemeral";
|
|
64
|
-
readonly ttl?:
|
|
66
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
65
67
|
} | undefined;
|
|
66
68
|
} | {
|
|
67
69
|
readonly type: "image";
|
|
@@ -78,11 +80,28 @@ export declare const routes: (Route<{
|
|
|
78
80
|
};
|
|
79
81
|
readonly cache_control?: {
|
|
80
82
|
readonly type: "ephemeral";
|
|
81
|
-
readonly ttl?:
|
|
83
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
82
84
|
} | undefined;
|
|
83
85
|
readonly transformations?: {
|
|
84
86
|
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
85
87
|
} | undefined;
|
|
88
|
+
} | {
|
|
89
|
+
readonly type: "video";
|
|
90
|
+
readonly source: {
|
|
91
|
+
readonly type: "base64";
|
|
92
|
+
readonly media_type: string;
|
|
93
|
+
readonly data: string;
|
|
94
|
+
} | {
|
|
95
|
+
readonly type: "url";
|
|
96
|
+
readonly url: string;
|
|
97
|
+
} | {
|
|
98
|
+
readonly type: "file";
|
|
99
|
+
readonly file_id: string;
|
|
100
|
+
};
|
|
101
|
+
readonly cache_control?: {
|
|
102
|
+
readonly type: "ephemeral";
|
|
103
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
104
|
+
} | undefined;
|
|
86
105
|
} | {
|
|
87
106
|
readonly type: "document";
|
|
88
107
|
readonly source: {
|
|
@@ -102,7 +121,7 @@ export declare const routes: (Route<{
|
|
|
102
121
|
};
|
|
103
122
|
readonly cache_control?: {
|
|
104
123
|
readonly type: "ephemeral";
|
|
105
|
-
readonly ttl?:
|
|
124
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
106
125
|
} | undefined;
|
|
107
126
|
readonly title?: string | undefined;
|
|
108
127
|
readonly context?: string | undefined;
|
|
@@ -117,7 +136,7 @@ export declare const routes: (Route<{
|
|
|
117
136
|
readonly text: string;
|
|
118
137
|
readonly cache_control?: {
|
|
119
138
|
readonly type: "ephemeral";
|
|
120
|
-
readonly ttl?:
|
|
139
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
121
140
|
} | undefined;
|
|
122
141
|
} | {
|
|
123
142
|
readonly type: "image";
|
|
@@ -134,11 +153,28 @@ export declare const routes: (Route<{
|
|
|
134
153
|
};
|
|
135
154
|
readonly cache_control?: {
|
|
136
155
|
readonly type: "ephemeral";
|
|
137
|
-
readonly ttl?:
|
|
156
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
138
157
|
} | undefined;
|
|
139
158
|
readonly transformations?: {
|
|
140
159
|
readonly oversized_image?: "downsize" | "error" | undefined;
|
|
141
160
|
} | undefined;
|
|
161
|
+
} | {
|
|
162
|
+
readonly type: "video";
|
|
163
|
+
readonly source: {
|
|
164
|
+
readonly type: "base64";
|
|
165
|
+
readonly media_type: string;
|
|
166
|
+
readonly data: string;
|
|
167
|
+
} | {
|
|
168
|
+
readonly type: "url";
|
|
169
|
+
readonly url: string;
|
|
170
|
+
} | {
|
|
171
|
+
readonly type: "file";
|
|
172
|
+
readonly file_id: string;
|
|
173
|
+
};
|
|
174
|
+
readonly cache_control?: {
|
|
175
|
+
readonly type: "ephemeral";
|
|
176
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
177
|
+
} | undefined;
|
|
142
178
|
} | {
|
|
143
179
|
readonly type: "document";
|
|
144
180
|
readonly source: {
|
|
@@ -158,7 +194,7 @@ export declare const routes: (Route<{
|
|
|
158
194
|
};
|
|
159
195
|
readonly cache_control?: {
|
|
160
196
|
readonly type: "ephemeral";
|
|
161
|
-
readonly ttl?:
|
|
197
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
162
198
|
} | undefined;
|
|
163
199
|
readonly title?: string | undefined;
|
|
164
200
|
readonly context?: string | undefined;
|
|
@@ -169,7 +205,7 @@ export declare const routes: (Route<{
|
|
|
169
205
|
readonly is_error?: boolean | undefined;
|
|
170
206
|
readonly cache_control?: {
|
|
171
207
|
readonly type: "ephemeral";
|
|
172
|
-
readonly ttl?:
|
|
208
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
173
209
|
} | undefined;
|
|
174
210
|
})[];
|
|
175
211
|
} | {
|
|
@@ -182,7 +218,7 @@ export declare const routes: (Route<{
|
|
|
182
218
|
readonly text: string;
|
|
183
219
|
readonly cache_control?: {
|
|
184
220
|
readonly type: "ephemeral";
|
|
185
|
-
readonly ttl?:
|
|
221
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
186
222
|
} | undefined;
|
|
187
223
|
} | {
|
|
188
224
|
readonly type: "thinking";
|
|
@@ -190,14 +226,14 @@ export declare const routes: (Route<{
|
|
|
190
226
|
readonly signature: string;
|
|
191
227
|
readonly cache_control?: {
|
|
192
228
|
readonly type: "ephemeral";
|
|
193
|
-
readonly ttl?:
|
|
229
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
194
230
|
} | undefined;
|
|
195
231
|
} | {
|
|
196
232
|
readonly type: "redacted_thinking";
|
|
197
233
|
readonly data: string;
|
|
198
234
|
readonly cache_control?: {
|
|
199
235
|
readonly type: "ephemeral";
|
|
200
|
-
readonly ttl?:
|
|
236
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
201
237
|
} | undefined;
|
|
202
238
|
} | {
|
|
203
239
|
readonly type: "tool_use";
|
|
@@ -206,7 +242,7 @@ export declare const routes: (Route<{
|
|
|
206
242
|
readonly input: unknown;
|
|
207
243
|
readonly cache_control?: {
|
|
208
244
|
readonly type: "ephemeral";
|
|
209
|
-
readonly ttl?:
|
|
245
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
210
246
|
} | undefined;
|
|
211
247
|
} | {
|
|
212
248
|
readonly type: "server_tool_use";
|
|
@@ -215,7 +251,7 @@ export declare const routes: (Route<{
|
|
|
215
251
|
readonly input: unknown;
|
|
216
252
|
readonly cache_control?: {
|
|
217
253
|
readonly type: "ephemeral";
|
|
218
|
-
readonly ttl?:
|
|
254
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
219
255
|
} | undefined;
|
|
220
256
|
} | {
|
|
221
257
|
readonly type: "code_execution_tool_result" | "web_fetch_tool_result" | "web_search_tool_result";
|
|
@@ -223,7 +259,7 @@ export declare const routes: (Route<{
|
|
|
223
259
|
readonly content: unknown;
|
|
224
260
|
readonly cache_control?: {
|
|
225
261
|
readonly type: "ephemeral";
|
|
226
|
-
readonly ttl?:
|
|
262
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
227
263
|
} | undefined;
|
|
228
264
|
})[];
|
|
229
265
|
} | {
|
|
@@ -233,7 +269,7 @@ export declare const routes: (Route<{
|
|
|
233
269
|
readonly text: string;
|
|
234
270
|
readonly cache_control?: {
|
|
235
271
|
readonly type: "ephemeral";
|
|
236
|
-
readonly ttl?:
|
|
272
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
237
273
|
} | undefined;
|
|
238
274
|
}[];
|
|
239
275
|
readonly output_config?: {
|
|
@@ -248,7 +284,7 @@ export declare const routes: (Route<{
|
|
|
248
284
|
};
|
|
249
285
|
readonly cache_control?: {
|
|
250
286
|
readonly type: "ephemeral";
|
|
251
|
-
readonly ttl?:
|
|
287
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
252
288
|
} | undefined;
|
|
253
289
|
}[] | undefined;
|
|
254
290
|
readonly tool_choice?: {
|
|
@@ -292,7 +328,7 @@ export declare const routes: (Route<{
|
|
|
292
328
|
} | undefined;
|
|
293
329
|
readonly cache_control?: {
|
|
294
330
|
readonly type: "ephemeral";
|
|
295
|
-
readonly ttl?:
|
|
331
|
+
readonly ttl?: `${number}d` | `${number}h` | `${number}m` | `${number}ms` | `${number}s` | undefined;
|
|
296
332
|
} | undefined;
|
|
297
333
|
readonly container?: string | {
|
|
298
334
|
readonly id?: string | null | undefined;
|
|
@@ -305,6 +341,7 @@ export declare const routes: (Route<{
|
|
|
305
341
|
readonly user_id?: string | null | undefined;
|
|
306
342
|
} | undefined;
|
|
307
343
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "standard_only"> | undefined;
|
|
344
|
+
readonly speed?: import("../schema/options.js").OpenString<"fast" | "standard"> | undefined;
|
|
308
345
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | Route<{
|
|
309
346
|
readonly model: string;
|
|
310
347
|
readonly input: readonly ({
|
|
@@ -321,7 +358,7 @@ export declare const routes: (Route<{
|
|
|
321
358
|
readonly role: "developer";
|
|
322
359
|
readonly content: string;
|
|
323
360
|
} | {
|
|
324
|
-
readonly type: "function_call_output";
|
|
361
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
325
362
|
readonly call_id: string;
|
|
326
363
|
readonly output: string | readonly ({
|
|
327
364
|
readonly type: "input_text";
|
|
@@ -358,6 +395,9 @@ export declare const routes: (Route<{
|
|
|
358
395
|
readonly content: readonly ({
|
|
359
396
|
readonly type: "input_text";
|
|
360
397
|
readonly text: string;
|
|
398
|
+
} | {
|
|
399
|
+
readonly type: "input_video";
|
|
400
|
+
readonly video_url: string;
|
|
361
401
|
} | {
|
|
362
402
|
readonly type: "input_image";
|
|
363
403
|
readonly image_url: string;
|
|
@@ -388,6 +428,12 @@ export declare const routes: (Route<{
|
|
|
388
428
|
readonly name: string;
|
|
389
429
|
readonly namespace?: string | undefined;
|
|
390
430
|
readonly arguments: string;
|
|
431
|
+
} | {
|
|
432
|
+
readonly type: "custom_tool_call";
|
|
433
|
+
readonly id?: string | undefined;
|
|
434
|
+
readonly call_id: string;
|
|
435
|
+
readonly name: string;
|
|
436
|
+
readonly input: string;
|
|
391
437
|
} | {
|
|
392
438
|
readonly [x: string]: unknown;
|
|
393
439
|
readonly type: "web_search_call";
|
|
@@ -432,6 +478,17 @@ export declare const routes: (Route<{
|
|
|
432
478
|
})[];
|
|
433
479
|
readonly instructions?: string | undefined;
|
|
434
480
|
readonly tools?: readonly ({
|
|
481
|
+
readonly type: "custom";
|
|
482
|
+
readonly name: string;
|
|
483
|
+
readonly description: string;
|
|
484
|
+
readonly format: {
|
|
485
|
+
readonly type: "text";
|
|
486
|
+
} | {
|
|
487
|
+
readonly type: "grammar";
|
|
488
|
+
readonly syntax: "lark" | "regex";
|
|
489
|
+
readonly definition: string;
|
|
490
|
+
};
|
|
491
|
+
} | {
|
|
435
492
|
readonly type: "function";
|
|
436
493
|
readonly name: string;
|
|
437
494
|
readonly description: string;
|
|
@@ -444,13 +501,13 @@ export declare const routes: (Route<{
|
|
|
444
501
|
readonly type: string;
|
|
445
502
|
})[] | undefined;
|
|
446
503
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
447
|
-
readonly type: "function";
|
|
504
|
+
readonly type: "custom" | "function";
|
|
448
505
|
readonly name: string;
|
|
449
506
|
} | {
|
|
450
507
|
readonly type: "allowed_tools";
|
|
451
508
|
readonly mode: "auto" | "none" | "required";
|
|
452
509
|
readonly tools: readonly {
|
|
453
|
-
readonly type: "function";
|
|
510
|
+
readonly type: "custom" | "function";
|
|
454
511
|
readonly name: string;
|
|
455
512
|
}[];
|
|
456
513
|
} | undefined;
|
|
@@ -491,6 +548,11 @@ export declare const routes: (Route<{
|
|
|
491
548
|
readonly image_url: {
|
|
492
549
|
readonly url: string;
|
|
493
550
|
};
|
|
551
|
+
} | {
|
|
552
|
+
readonly type: "video_url";
|
|
553
|
+
readonly video_url: {
|
|
554
|
+
readonly url: string;
|
|
555
|
+
};
|
|
494
556
|
} | {
|
|
495
557
|
readonly type: "file";
|
|
496
558
|
readonly file: {
|
|
@@ -512,6 +574,11 @@ export declare const routes: (Route<{
|
|
|
512
574
|
readonly image_url: {
|
|
513
575
|
readonly url: string;
|
|
514
576
|
};
|
|
577
|
+
} | {
|
|
578
|
+
readonly type: "video_url";
|
|
579
|
+
readonly video_url: {
|
|
580
|
+
readonly url: string;
|
|
581
|
+
};
|
|
515
582
|
} | {
|
|
516
583
|
readonly type: "file";
|
|
517
584
|
readonly file: {
|
|
@@ -548,7 +615,14 @@ export declare const routes: (Route<{
|
|
|
548
615
|
readonly ttl?: string | undefined;
|
|
549
616
|
} | undefined;
|
|
550
617
|
}[] | null;
|
|
551
|
-
readonly tool_calls?: readonly {
|
|
618
|
+
readonly tool_calls?: readonly ({
|
|
619
|
+
readonly id: string;
|
|
620
|
+
readonly type: "custom";
|
|
621
|
+
readonly custom: {
|
|
622
|
+
readonly name: string;
|
|
623
|
+
readonly input: string;
|
|
624
|
+
};
|
|
625
|
+
} | {
|
|
552
626
|
readonly id: string;
|
|
553
627
|
readonly type: "function";
|
|
554
628
|
readonly function: {
|
|
@@ -560,13 +634,13 @@ export declare const routes: (Route<{
|
|
|
560
634
|
readonly thought_signature: string;
|
|
561
635
|
};
|
|
562
636
|
} | undefined;
|
|
563
|
-
}[] | undefined;
|
|
637
|
+
})[] | undefined;
|
|
564
638
|
readonly reasoning_content?: string | undefined;
|
|
565
639
|
readonly reasoning?: string | undefined;
|
|
566
640
|
readonly reasoning_text?: string | undefined;
|
|
567
641
|
readonly reasoning_details?: unknown;
|
|
568
642
|
})[];
|
|
569
|
-
readonly tools?: readonly {
|
|
643
|
+
readonly tools?: readonly ({
|
|
570
644
|
readonly type: "function";
|
|
571
645
|
readonly function: {
|
|
572
646
|
readonly name: string;
|
|
@@ -580,12 +654,36 @@ export declare const routes: (Route<{
|
|
|
580
654
|
readonly type: "ephemeral";
|
|
581
655
|
readonly ttl?: string | undefined;
|
|
582
656
|
} | undefined;
|
|
583
|
-
}
|
|
657
|
+
} | {
|
|
658
|
+
readonly type: "custom";
|
|
659
|
+
readonly custom: {
|
|
660
|
+
readonly name: string;
|
|
661
|
+
readonly description: string;
|
|
662
|
+
readonly format: {
|
|
663
|
+
readonly type: "text";
|
|
664
|
+
} | {
|
|
665
|
+
readonly type: "grammar";
|
|
666
|
+
readonly grammar: {
|
|
667
|
+
readonly syntax: "lark" | "regex";
|
|
668
|
+
readonly definition: string;
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
readonly cache_control?: {
|
|
673
|
+
readonly type: "ephemeral";
|
|
674
|
+
readonly ttl?: string | undefined;
|
|
675
|
+
} | undefined;
|
|
676
|
+
})[] | undefined;
|
|
584
677
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
585
678
|
readonly type: "function";
|
|
586
679
|
readonly function: {
|
|
587
680
|
readonly name: string;
|
|
588
681
|
};
|
|
682
|
+
} | {
|
|
683
|
+
readonly type: "custom";
|
|
684
|
+
readonly custom: {
|
|
685
|
+
readonly name: string;
|
|
686
|
+
};
|
|
589
687
|
} | undefined;
|
|
590
688
|
readonly stream: true;
|
|
591
689
|
readonly stream_options?: {
|
|
@@ -593,7 +691,18 @@ export declare const routes: (Route<{
|
|
|
593
691
|
} | undefined;
|
|
594
692
|
readonly store?: boolean | undefined;
|
|
595
693
|
readonly prompt_cache_key?: string | undefined;
|
|
694
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
695
|
+
readonly prompt_cache_options?: {
|
|
696
|
+
readonly ttl?: string | undefined;
|
|
697
|
+
} | undefined;
|
|
596
698
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
699
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
700
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
701
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
702
|
+
readonly metadata?: {
|
|
703
|
+
readonly [x: string]: string;
|
|
704
|
+
} | undefined;
|
|
705
|
+
readonly safety_identifier?: string | undefined;
|
|
597
706
|
readonly tool_stream?: boolean | undefined;
|
|
598
707
|
readonly max_completion_tokens?: number | undefined;
|
|
599
708
|
readonly max_tokens?: number | undefined;
|
|
@@ -614,6 +723,7 @@ export declare const configure: (input?: Config) => {
|
|
|
614
723
|
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
615
724
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
616
725
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
726
|
+
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
617
727
|
configure: typeof configure;
|
|
618
728
|
};
|
|
619
729
|
export declare const provider: {
|
|
@@ -622,10 +732,13 @@ export declare const provider: {
|
|
|
622
732
|
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
623
733
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
624
734
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
735
|
+
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
625
736
|
configure: typeof configure;
|
|
626
737
|
};
|
|
627
|
-
export declare const model: ProviderPackage.
|
|
738
|
+
export declare const model: ProviderPackage.Model<Settings<MessagesOptionsInput>, MessagesOptionsInput>;
|
|
739
|
+
export declare const imageModel: (modelID: string, settings?: Settings<MiniMaxImageOptions>) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
628
740
|
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
629
741
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
630
742
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
743
|
+
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
631
744
|
export * as MiniMax from "./minimax.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
|
+
import { MiniMaxImages } from "../protocols/minimax-images.js";
|
|
3
4
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
4
5
|
import { OpenResponses } from "../protocols/open-responses.js";
|
|
5
6
|
import { ProviderShared } from "../protocols/shared.js";
|
|
@@ -7,6 +8,7 @@ import { AuthOptions } from "../route/auth-options.js";
|
|
|
7
8
|
import { Route } from "../route/client.js";
|
|
8
9
|
import { Endpoint } from "../route/endpoint.js";
|
|
9
10
|
import { Framing } from "../route/framing.js";
|
|
11
|
+
import { MediaRoute } from "../route/media.js";
|
|
10
12
|
import { Protocol } from "../route/protocol.js";
|
|
11
13
|
import { ProviderID } from "../schema/index.js";
|
|
12
14
|
export const id = ProviderID.make("minimax");
|
|
@@ -62,10 +64,11 @@ const responsesRoute = Route.make({
|
|
|
62
64
|
export const routes = [messagesRoute, chatRoute, responsesRoute];
|
|
63
65
|
export const configure = (input = {}) => {
|
|
64
66
|
const { apiKey: _apiKey, auth: _auth, baseURL, ...rest } = input;
|
|
67
|
+
const auth = AuthOptions.bearer(input, "MINIMAX_API_KEY");
|
|
65
68
|
const defaults = {
|
|
66
69
|
...rest,
|
|
67
70
|
endpoint: baseURL === undefined ? undefined : { baseURL },
|
|
68
|
-
auth
|
|
71
|
+
auth,
|
|
69
72
|
};
|
|
70
73
|
const messages = (modelID) => messagesRoute.with(defaults).model({ id: modelID });
|
|
71
74
|
const chat = (modelID) => chatRoute.with(defaults).model({
|
|
@@ -73,17 +76,27 @@ export const configure = (input = {}) => {
|
|
|
73
76
|
compatibility: { supportsStrictMode: false },
|
|
74
77
|
});
|
|
75
78
|
const responses = (modelID) => responsesRoute.with(defaults).model({ id: modelID });
|
|
76
|
-
|
|
79
|
+
const media = MediaRoute.deployment(input, auth);
|
|
80
|
+
const image = (modelID, providerOptions) => MiniMaxImages.model({ ...media, id: modelID, providerOptions });
|
|
81
|
+
return { id, model: messages, messages, chat, responses, image, configure };
|
|
77
82
|
};
|
|
78
83
|
export const provider = configure();
|
|
79
|
-
export const model = (modelID,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
providerOptions,
|
|
85
|
-
}).model(modelID);
|
|
84
|
+
export const model = (modelID, settings) => configure(config(settings)).model(modelID);
|
|
85
|
+
export const imageModel = (modelID, settings) => {
|
|
86
|
+
const input = config(settings);
|
|
87
|
+
return configure(input).image(modelID, input.providerOptions);
|
|
88
|
+
};
|
|
86
89
|
export const messages = provider.messages;
|
|
87
90
|
export const chat = provider.chat;
|
|
88
91
|
export const responses = provider.responses;
|
|
92
|
+
export const image = provider.image;
|
|
93
|
+
function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
|
|
94
|
+
return {
|
|
95
|
+
apiKey,
|
|
96
|
+
baseURL,
|
|
97
|
+
headers,
|
|
98
|
+
http: body === undefined ? undefined : { body },
|
|
99
|
+
providerOptions,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
89
102
|
export * as MiniMax from "./minimax.js";
|
|
@@ -5,7 +5,7 @@ import type { RouteDefaultsInput } from "../route/client.js";
|
|
|
5
5
|
import { type ModelID } from "../schema/index.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
7
|
export type ProviderOptions = MistralChat.ProviderOptionsInput;
|
|
8
|
-
export type
|
|
8
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
9
9
|
readonly baseURL?: string;
|
|
10
10
|
readonly providerOptions?: ProviderOptions;
|
|
11
11
|
};
|
|
@@ -195,7 +195,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
195
195
|
readonly reasoning_effort?: string | undefined;
|
|
196
196
|
readonly prompt_mode?: "reasoning" | undefined;
|
|
197
197
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
198
|
-
export declare const configure: (input?:
|
|
198
|
+
export declare const configure: (input?: Config) => {
|
|
199
199
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
200
200
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MistralChat.ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
201
201
|
configure: typeof configure;
|
|
@@ -205,5 +205,5 @@ export declare const provider: {
|
|
|
205
205
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MistralChat.ProviderOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
206
206
|
configure: typeof configure;
|
|
207
207
|
};
|
|
208
|
-
export declare const model: ProviderPackage.
|
|
208
|
+
export declare const model: ProviderPackage.Model<Settings, ProviderOptions>;
|
|
209
209
|
export * as Mistral from "./mistral.js";
|
|
@@ -18,7 +18,7 @@ export const configure = (input = {}) => {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export const provider = configure();
|
|
21
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
21
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
22
22
|
apiKey,
|
|
23
23
|
baseURL,
|
|
24
24
|
headers,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../../provider-package.js";
|
|
2
2
|
import { Moonshot } from "../moonshot.js";
|
|
3
3
|
export type Settings = Moonshot.Settings<Moonshot.MessagesOptionsInput>;
|
|
4
|
-
export declare const model: ProviderPackage.
|
|
4
|
+
export declare const model: ProviderPackage.Model<Settings, Moonshot.MessagesOptionsInput>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Moonshot } from "../moonshot.js";
|
|
2
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => Moonshot.configure({
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => Moonshot.configure({
|
|
3
3
|
apiKey,
|
|
4
4
|
baseURL,
|
|
5
5
|
headers,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../../provider-package.js";
|
|
2
2
|
import { Moonshot } from "../moonshot.js";
|
|
3
3
|
export type Settings = Moonshot.Settings<Moonshot.ResponsesOptionsInput>;
|
|
4
|
-
export declare const model: ProviderPackage.
|
|
4
|
+
export declare const model: ProviderPackage.Model<Settings, Moonshot.ResponsesOptionsInput>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Moonshot } from "../moonshot.js";
|
|
2
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => Moonshot.configure({
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => Moonshot.configure({
|
|
3
3
|
apiKey,
|
|
4
4
|
baseURL,
|
|
5
5
|
headers,
|