@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,20 +1,19 @@
|
|
|
1
1
|
import { type AtLeastOne, type ProviderAuthOption } from "../route/auth-options.js";
|
|
2
2
|
import type { Route, RouteDefaultsInput, CompactionOperations } from "../route/client.js";
|
|
3
3
|
import type { ProviderPackage } from "../provider-package.js";
|
|
4
|
-
import { type ModelID } from "../schema/index.js";
|
|
4
|
+
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
5
5
|
import { type OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
7
|
type AzureURL = AtLeastOne<{
|
|
8
8
|
readonly resourceName: string;
|
|
9
9
|
readonly baseURL: string;
|
|
10
10
|
}>;
|
|
11
|
-
export type
|
|
11
|
+
export type Config = AzureURL & RouteDefaultsInput & ProviderAuthOption<"optional"> & {
|
|
12
12
|
readonly apiVersion?: string;
|
|
13
13
|
readonly queryParams?: Record<string, string>;
|
|
14
14
|
readonly useDeploymentBasedUrls?: boolean;
|
|
15
15
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
16
16
|
};
|
|
17
|
-
export type Config = LanguageModelOptions;
|
|
18
17
|
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & AzureURL & {
|
|
19
18
|
readonly apiKey?: string;
|
|
20
19
|
readonly apiVersion?: string;
|
|
@@ -37,7 +36,7 @@ declare const responsesRoute: Route<{
|
|
|
37
36
|
readonly role: "developer";
|
|
38
37
|
readonly content: string;
|
|
39
38
|
} | {
|
|
40
|
-
readonly type: "function_call_output";
|
|
39
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
41
40
|
readonly call_id: string;
|
|
42
41
|
readonly output: string | readonly ({
|
|
43
42
|
readonly type: "input_text";
|
|
@@ -74,6 +73,9 @@ declare const responsesRoute: Route<{
|
|
|
74
73
|
readonly content: readonly ({
|
|
75
74
|
readonly type: "input_text";
|
|
76
75
|
readonly text: string;
|
|
76
|
+
} | {
|
|
77
|
+
readonly type: "input_video";
|
|
78
|
+
readonly video_url: string;
|
|
77
79
|
} | {
|
|
78
80
|
readonly type: "input_image";
|
|
79
81
|
readonly image_url: string;
|
|
@@ -104,6 +106,12 @@ declare const responsesRoute: Route<{
|
|
|
104
106
|
readonly name: string;
|
|
105
107
|
readonly namespace?: string | undefined;
|
|
106
108
|
readonly arguments: string;
|
|
109
|
+
} | {
|
|
110
|
+
readonly type: "custom_tool_call";
|
|
111
|
+
readonly id?: string | undefined;
|
|
112
|
+
readonly call_id: string;
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly input: string;
|
|
107
115
|
} | {
|
|
108
116
|
readonly [x: string]: unknown;
|
|
109
117
|
readonly type: "web_search_call";
|
|
@@ -160,10 +168,6 @@ declare const responsesRoute: Route<{
|
|
|
160
168
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
161
169
|
readonly prompt_cache_key?: string | undefined;
|
|
162
170
|
readonly include?: readonly import("../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
|
|
163
|
-
readonly reasoning?: {
|
|
164
|
-
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
165
|
-
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
166
|
-
} | undefined;
|
|
167
171
|
readonly text?: {
|
|
168
172
|
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
169
173
|
} | undefined;
|
|
@@ -174,7 +178,22 @@ declare const responsesRoute: Route<{
|
|
|
174
178
|
readonly top_p?: number | undefined;
|
|
175
179
|
readonly presence_penalty?: number | undefined;
|
|
176
180
|
readonly frequency_penalty?: number | undefined;
|
|
181
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
182
|
+
readonly prompt_cache_options?: {
|
|
183
|
+
readonly ttl?: string | undefined;
|
|
184
|
+
} | undefined;
|
|
177
185
|
readonly tools?: readonly ({
|
|
186
|
+
readonly type: "custom";
|
|
187
|
+
readonly name: string;
|
|
188
|
+
readonly description: string;
|
|
189
|
+
readonly format: {
|
|
190
|
+
readonly type: "text";
|
|
191
|
+
} | {
|
|
192
|
+
readonly type: "grammar";
|
|
193
|
+
readonly syntax: "lark" | "regex";
|
|
194
|
+
readonly definition: string;
|
|
195
|
+
};
|
|
196
|
+
} | {
|
|
178
197
|
readonly type: "namespace";
|
|
179
198
|
readonly name: string;
|
|
180
199
|
readonly description: string;
|
|
@@ -207,18 +226,24 @@ declare const responsesRoute: Route<{
|
|
|
207
226
|
readonly size?: string | undefined;
|
|
208
227
|
})[] | undefined;
|
|
209
228
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
210
|
-
readonly type: "function";
|
|
229
|
+
readonly type: "custom" | "function";
|
|
211
230
|
readonly name: string;
|
|
212
231
|
} | {
|
|
213
232
|
readonly type: "allowed_tools";
|
|
214
233
|
readonly mode: "auto" | "none" | "required";
|
|
215
234
|
readonly tools: readonly {
|
|
216
|
-
readonly type: "function";
|
|
235
|
+
readonly type: "custom" | "function";
|
|
217
236
|
readonly name: string;
|
|
218
237
|
}[];
|
|
219
238
|
} | {
|
|
220
239
|
readonly type: "image_generation";
|
|
221
240
|
} | undefined;
|
|
241
|
+
readonly reasoning?: {
|
|
242
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
243
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
244
|
+
readonly mode?: import("../schema/options.js").OpenString<"pro" | "standard"> | undefined;
|
|
245
|
+
readonly context?: import("../schema/options.js").OpenString<"all_turns" | "auto" | "current_turn"> | undefined;
|
|
246
|
+
} | undefined;
|
|
222
247
|
readonly context_management?: readonly {
|
|
223
248
|
readonly type: "compaction";
|
|
224
249
|
readonly compact_threshold?: number | undefined;
|
|
@@ -236,6 +261,11 @@ export declare const routes: (Route<{
|
|
|
236
261
|
readonly image_url: {
|
|
237
262
|
readonly url: string;
|
|
238
263
|
};
|
|
264
|
+
} | {
|
|
265
|
+
readonly type: "video_url";
|
|
266
|
+
readonly video_url: {
|
|
267
|
+
readonly url: string;
|
|
268
|
+
};
|
|
239
269
|
} | {
|
|
240
270
|
readonly type: "file";
|
|
241
271
|
readonly file: {
|
|
@@ -257,6 +287,11 @@ export declare const routes: (Route<{
|
|
|
257
287
|
readonly image_url: {
|
|
258
288
|
readonly url: string;
|
|
259
289
|
};
|
|
290
|
+
} | {
|
|
291
|
+
readonly type: "video_url";
|
|
292
|
+
readonly video_url: {
|
|
293
|
+
readonly url: string;
|
|
294
|
+
};
|
|
260
295
|
} | {
|
|
261
296
|
readonly type: "file";
|
|
262
297
|
readonly file: {
|
|
@@ -293,7 +328,14 @@ export declare const routes: (Route<{
|
|
|
293
328
|
readonly ttl?: string | undefined;
|
|
294
329
|
} | undefined;
|
|
295
330
|
}[] | null;
|
|
296
|
-
readonly tool_calls?: readonly {
|
|
331
|
+
readonly tool_calls?: readonly ({
|
|
332
|
+
readonly id: string;
|
|
333
|
+
readonly type: "custom";
|
|
334
|
+
readonly custom: {
|
|
335
|
+
readonly name: string;
|
|
336
|
+
readonly input: string;
|
|
337
|
+
};
|
|
338
|
+
} | {
|
|
297
339
|
readonly id: string;
|
|
298
340
|
readonly type: "function";
|
|
299
341
|
readonly function: {
|
|
@@ -305,13 +347,13 @@ export declare const routes: (Route<{
|
|
|
305
347
|
readonly thought_signature: string;
|
|
306
348
|
};
|
|
307
349
|
} | undefined;
|
|
308
|
-
}[] | undefined;
|
|
350
|
+
})[] | undefined;
|
|
309
351
|
readonly reasoning_content?: string | undefined;
|
|
310
352
|
readonly reasoning?: string | undefined;
|
|
311
353
|
readonly reasoning_text?: string | undefined;
|
|
312
354
|
readonly reasoning_details?: unknown;
|
|
313
355
|
})[];
|
|
314
|
-
readonly tools?: readonly {
|
|
356
|
+
readonly tools?: readonly ({
|
|
315
357
|
readonly type: "function";
|
|
316
358
|
readonly function: {
|
|
317
359
|
readonly name: string;
|
|
@@ -325,12 +367,36 @@ export declare const routes: (Route<{
|
|
|
325
367
|
readonly type: "ephemeral";
|
|
326
368
|
readonly ttl?: string | undefined;
|
|
327
369
|
} | undefined;
|
|
328
|
-
}
|
|
370
|
+
} | {
|
|
371
|
+
readonly type: "custom";
|
|
372
|
+
readonly custom: {
|
|
373
|
+
readonly name: string;
|
|
374
|
+
readonly description: string;
|
|
375
|
+
readonly format: {
|
|
376
|
+
readonly type: "text";
|
|
377
|
+
} | {
|
|
378
|
+
readonly type: "grammar";
|
|
379
|
+
readonly grammar: {
|
|
380
|
+
readonly syntax: "lark" | "regex";
|
|
381
|
+
readonly definition: string;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
readonly cache_control?: {
|
|
386
|
+
readonly type: "ephemeral";
|
|
387
|
+
readonly ttl?: string | undefined;
|
|
388
|
+
} | undefined;
|
|
389
|
+
})[] | undefined;
|
|
329
390
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
330
391
|
readonly type: "function";
|
|
331
392
|
readonly function: {
|
|
332
393
|
readonly name: string;
|
|
333
394
|
};
|
|
395
|
+
} | {
|
|
396
|
+
readonly type: "custom";
|
|
397
|
+
readonly custom: {
|
|
398
|
+
readonly name: string;
|
|
399
|
+
};
|
|
334
400
|
} | undefined;
|
|
335
401
|
readonly stream: true;
|
|
336
402
|
readonly stream_options?: {
|
|
@@ -338,7 +404,18 @@ export declare const routes: (Route<{
|
|
|
338
404
|
} | undefined;
|
|
339
405
|
readonly store?: boolean | undefined;
|
|
340
406
|
readonly prompt_cache_key?: string | undefined;
|
|
407
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
408
|
+
readonly prompt_cache_options?: {
|
|
409
|
+
readonly ttl?: string | undefined;
|
|
410
|
+
} | undefined;
|
|
341
411
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
412
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
413
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
414
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
415
|
+
readonly metadata?: {
|
|
416
|
+
readonly [x: string]: string;
|
|
417
|
+
} | undefined;
|
|
418
|
+
readonly safety_identifier?: string | undefined;
|
|
342
419
|
readonly tool_stream?: boolean | undefined;
|
|
343
420
|
readonly max_completion_tokens?: number | undefined;
|
|
344
421
|
readonly max_tokens?: number | undefined;
|
|
@@ -364,7 +441,7 @@ export declare const routes: (Route<{
|
|
|
364
441
|
readonly role: "developer";
|
|
365
442
|
readonly content: string;
|
|
366
443
|
} | {
|
|
367
|
-
readonly type: "function_call_output";
|
|
444
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
368
445
|
readonly call_id: string;
|
|
369
446
|
readonly output: string | readonly ({
|
|
370
447
|
readonly type: "input_text";
|
|
@@ -401,6 +478,9 @@ export declare const routes: (Route<{
|
|
|
401
478
|
readonly content: readonly ({
|
|
402
479
|
readonly type: "input_text";
|
|
403
480
|
readonly text: string;
|
|
481
|
+
} | {
|
|
482
|
+
readonly type: "input_video";
|
|
483
|
+
readonly video_url: string;
|
|
404
484
|
} | {
|
|
405
485
|
readonly type: "input_image";
|
|
406
486
|
readonly image_url: string;
|
|
@@ -431,6 +511,12 @@ export declare const routes: (Route<{
|
|
|
431
511
|
readonly name: string;
|
|
432
512
|
readonly namespace?: string | undefined;
|
|
433
513
|
readonly arguments: string;
|
|
514
|
+
} | {
|
|
515
|
+
readonly type: "custom_tool_call";
|
|
516
|
+
readonly id?: string | undefined;
|
|
517
|
+
readonly call_id: string;
|
|
518
|
+
readonly name: string;
|
|
519
|
+
readonly input: string;
|
|
434
520
|
} | {
|
|
435
521
|
readonly [x: string]: unknown;
|
|
436
522
|
readonly type: "web_search_call";
|
|
@@ -487,10 +573,6 @@ export declare const routes: (Route<{
|
|
|
487
573
|
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
488
574
|
readonly prompt_cache_key?: string | undefined;
|
|
489
575
|
readonly include?: readonly import("../schema/options.js").OpenString<"code_interpreter_call.outputs" | "computer_call_output.output.image_url" | "file_search_call.results" | "message.input_image.image_url" | "message.output_text.logprobs" | "reasoning.encrypted_content" | "web_search_call.action.sources" | "web_search_call.results">[] | undefined;
|
|
490
|
-
readonly reasoning?: {
|
|
491
|
-
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
492
|
-
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
493
|
-
} | undefined;
|
|
494
576
|
readonly text?: {
|
|
495
577
|
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
496
578
|
} | undefined;
|
|
@@ -501,7 +583,22 @@ export declare const routes: (Route<{
|
|
|
501
583
|
readonly top_p?: number | undefined;
|
|
502
584
|
readonly presence_penalty?: number | undefined;
|
|
503
585
|
readonly frequency_penalty?: number | undefined;
|
|
586
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
587
|
+
readonly prompt_cache_options?: {
|
|
588
|
+
readonly ttl?: string | undefined;
|
|
589
|
+
} | undefined;
|
|
504
590
|
readonly tools?: readonly ({
|
|
591
|
+
readonly type: "custom";
|
|
592
|
+
readonly name: string;
|
|
593
|
+
readonly description: string;
|
|
594
|
+
readonly format: {
|
|
595
|
+
readonly type: "text";
|
|
596
|
+
} | {
|
|
597
|
+
readonly type: "grammar";
|
|
598
|
+
readonly syntax: "lark" | "regex";
|
|
599
|
+
readonly definition: string;
|
|
600
|
+
};
|
|
601
|
+
} | {
|
|
505
602
|
readonly type: "namespace";
|
|
506
603
|
readonly name: string;
|
|
507
604
|
readonly description: string;
|
|
@@ -534,18 +631,24 @@ export declare const routes: (Route<{
|
|
|
534
631
|
readonly size?: string | undefined;
|
|
535
632
|
})[] | undefined;
|
|
536
633
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
537
|
-
readonly type: "function";
|
|
634
|
+
readonly type: "custom" | "function";
|
|
538
635
|
readonly name: string;
|
|
539
636
|
} | {
|
|
540
637
|
readonly type: "allowed_tools";
|
|
541
638
|
readonly mode: "auto" | "none" | "required";
|
|
542
639
|
readonly tools: readonly {
|
|
543
|
-
readonly type: "function";
|
|
640
|
+
readonly type: "custom" | "function";
|
|
544
641
|
readonly name: string;
|
|
545
642
|
}[];
|
|
546
643
|
} | {
|
|
547
644
|
readonly type: "image_generation";
|
|
548
645
|
} | undefined;
|
|
646
|
+
readonly reasoning?: {
|
|
647
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
648
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
649
|
+
readonly mode?: import("../schema/options.js").OpenString<"pro" | "standard"> | undefined;
|
|
650
|
+
readonly context?: import("../schema/options.js").OpenString<"all_turns" | "auto" | "current_turn"> | undefined;
|
|
651
|
+
} | undefined;
|
|
549
652
|
readonly context_management?: readonly {
|
|
550
653
|
readonly type: "compaction";
|
|
551
654
|
readonly compact_threshold?: number | undefined;
|
|
@@ -563,15 +666,17 @@ export declare const configure: (input: Config) => {
|
|
|
563
666
|
endpoint: import("../route/client.js").CompactOperation;
|
|
564
667
|
}>;
|
|
565
668
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, CompactionOperations | undefined>;
|
|
669
|
+
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
566
670
|
configure: typeof configure;
|
|
567
671
|
};
|
|
568
672
|
export declare const provider: {
|
|
569
673
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
570
674
|
configure: typeof configure;
|
|
571
675
|
};
|
|
572
|
-
export declare const responsesModel: ProviderPackage.
|
|
573
|
-
export declare const chatModel: ProviderPackage.
|
|
574
|
-
export declare const
|
|
676
|
+
export declare const responsesModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput, typeof responsesRoute.compact>;
|
|
677
|
+
export declare const chatModel: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
678
|
+
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("../protocols/openai-images.js").OpenAIImageOptions>;
|
|
679
|
+
export declare const model: ProviderPackage.Model<Settings, import("./openai-options.js").OpenAIOptionsInput, {
|
|
575
680
|
endpoint: import("../route/client.js").CompactOperation;
|
|
576
681
|
}>;
|
|
577
682
|
export {};
|
package/dist/providers/azure.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Auth } from "../route/auth.js";
|
|
2
2
|
import {} from "../route/auth-options.js";
|
|
3
3
|
import { Endpoint } from "../route/endpoint.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MediaRoute } from "../route/media.js";
|
|
5
|
+
import { HttpOptions, ProviderConfigurationError, ProviderID, mergeHttpOptions, } from "../schema/index.js";
|
|
6
|
+
import { OpenAIImages } from "../protocols/openai-images.js";
|
|
5
7
|
import * as OpenAIChat from "../protocols/openai-chat.js";
|
|
6
8
|
import * as OpenAIResponses from "../protocols/openai-responses.js";
|
|
7
9
|
import { withOpenAIOptions } from "./openai-options.js";
|
|
@@ -75,11 +77,23 @@ export const configure = (input) => {
|
|
|
75
77
|
const chat = (modelID) => configuredRoute(chatRoute, input, modelID)
|
|
76
78
|
.with(withOpenAIOptions(modelID, modelDefaults))
|
|
77
79
|
.model({ id: modelID, compatibility: { supportsPromptCacheKey: true } });
|
|
80
|
+
const image = (modelID, providerOptions) => {
|
|
81
|
+
const target = endpoint(input, modelID);
|
|
82
|
+
const media = MediaRoute.deployment({ ...input, baseURL: target.baseURL }, auth(input));
|
|
83
|
+
return OpenAIImages.model({
|
|
84
|
+
...media,
|
|
85
|
+
id: modelID,
|
|
86
|
+
provider: id,
|
|
87
|
+
providerOptions,
|
|
88
|
+
http: mergeHttpOptions(media.http, target.query === undefined ? undefined : new HttpOptions({ query: target.query })),
|
|
89
|
+
});
|
|
90
|
+
};
|
|
78
91
|
return {
|
|
79
92
|
id,
|
|
80
93
|
model: responses,
|
|
81
94
|
responses,
|
|
82
95
|
chat,
|
|
96
|
+
image,
|
|
83
97
|
configure,
|
|
84
98
|
};
|
|
85
99
|
};
|
|
@@ -105,4 +119,8 @@ const config = ({ apiKey, apiVersion, baseURL, body, headers, queryParams, resou
|
|
|
105
119
|
};
|
|
106
120
|
export const responsesModel = (modelID, settings) => configure(config(settings)).responses(modelID);
|
|
107
121
|
export const chatModel = (modelID, settings) => configure(config(settings)).chat(modelID);
|
|
122
|
+
export const imageModel = (modelID, settings) => {
|
|
123
|
+
const input = config(settings);
|
|
124
|
+
return configure(input).image(modelID, input.providerOptions);
|
|
125
|
+
};
|
|
108
126
|
export const model = responsesModel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { decisionModel as model } from "../baseten.js";
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
3
3
|
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
4
|
-
import { type ModelID } from "../schema/index.js";
|
|
4
|
+
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
5
5
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
6
6
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
-
export type
|
|
7
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
8
8
|
readonly baseURL?: string;
|
|
9
9
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
10
10
|
};
|
|
11
|
+
export interface BasetenDecisionOptions {
|
|
12
|
+
readonly [key: string]: unknown;
|
|
13
|
+
readonly max_len?: number;
|
|
14
|
+
}
|
|
11
15
|
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & {
|
|
12
16
|
readonly apiKey?: string;
|
|
13
17
|
readonly baseURL?: string;
|
|
@@ -21,6 +25,11 @@ export declare const route: Route<{
|
|
|
21
25
|
readonly image_url: {
|
|
22
26
|
readonly url: string;
|
|
23
27
|
};
|
|
28
|
+
} | {
|
|
29
|
+
readonly type: "video_url";
|
|
30
|
+
readonly video_url: {
|
|
31
|
+
readonly url: string;
|
|
32
|
+
};
|
|
24
33
|
} | {
|
|
25
34
|
readonly type: "file";
|
|
26
35
|
readonly file: {
|
|
@@ -42,6 +51,11 @@ export declare const route: Route<{
|
|
|
42
51
|
readonly image_url: {
|
|
43
52
|
readonly url: string;
|
|
44
53
|
};
|
|
54
|
+
} | {
|
|
55
|
+
readonly type: "video_url";
|
|
56
|
+
readonly video_url: {
|
|
57
|
+
readonly url: string;
|
|
58
|
+
};
|
|
45
59
|
} | {
|
|
46
60
|
readonly type: "file";
|
|
47
61
|
readonly file: {
|
|
@@ -78,7 +92,14 @@ export declare const route: Route<{
|
|
|
78
92
|
readonly ttl?: string | undefined;
|
|
79
93
|
} | undefined;
|
|
80
94
|
}[] | null;
|
|
81
|
-
readonly tool_calls?: readonly {
|
|
95
|
+
readonly tool_calls?: readonly ({
|
|
96
|
+
readonly id: string;
|
|
97
|
+
readonly type: "custom";
|
|
98
|
+
readonly custom: {
|
|
99
|
+
readonly name: string;
|
|
100
|
+
readonly input: string;
|
|
101
|
+
};
|
|
102
|
+
} | {
|
|
82
103
|
readonly id: string;
|
|
83
104
|
readonly type: "function";
|
|
84
105
|
readonly function: {
|
|
@@ -90,13 +111,13 @@ export declare const route: Route<{
|
|
|
90
111
|
readonly thought_signature: string;
|
|
91
112
|
};
|
|
92
113
|
} | undefined;
|
|
93
|
-
}[] | undefined;
|
|
114
|
+
})[] | undefined;
|
|
94
115
|
readonly reasoning_content?: string | undefined;
|
|
95
116
|
readonly reasoning?: string | undefined;
|
|
96
117
|
readonly reasoning_text?: string | undefined;
|
|
97
118
|
readonly reasoning_details?: unknown;
|
|
98
119
|
})[];
|
|
99
|
-
readonly tools?: readonly {
|
|
120
|
+
readonly tools?: readonly ({
|
|
100
121
|
readonly type: "function";
|
|
101
122
|
readonly function: {
|
|
102
123
|
readonly name: string;
|
|
@@ -110,12 +131,36 @@ export declare const route: Route<{
|
|
|
110
131
|
readonly type: "ephemeral";
|
|
111
132
|
readonly ttl?: string | undefined;
|
|
112
133
|
} | undefined;
|
|
113
|
-
}
|
|
134
|
+
} | {
|
|
135
|
+
readonly type: "custom";
|
|
136
|
+
readonly custom: {
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly description: string;
|
|
139
|
+
readonly format: {
|
|
140
|
+
readonly type: "text";
|
|
141
|
+
} | {
|
|
142
|
+
readonly type: "grammar";
|
|
143
|
+
readonly grammar: {
|
|
144
|
+
readonly syntax: "lark" | "regex";
|
|
145
|
+
readonly definition: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
readonly cache_control?: {
|
|
150
|
+
readonly type: "ephemeral";
|
|
151
|
+
readonly ttl?: string | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
})[] | undefined;
|
|
114
154
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
115
155
|
readonly type: "function";
|
|
116
156
|
readonly function: {
|
|
117
157
|
readonly name: string;
|
|
118
158
|
};
|
|
159
|
+
} | {
|
|
160
|
+
readonly type: "custom";
|
|
161
|
+
readonly custom: {
|
|
162
|
+
readonly name: string;
|
|
163
|
+
};
|
|
119
164
|
} | undefined;
|
|
120
165
|
readonly stream: true;
|
|
121
166
|
readonly stream_options?: {
|
|
@@ -123,7 +168,18 @@ export declare const route: Route<{
|
|
|
123
168
|
} | undefined;
|
|
124
169
|
readonly store?: boolean | undefined;
|
|
125
170
|
readonly prompt_cache_key?: string | undefined;
|
|
171
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
172
|
+
readonly prompt_cache_options?: {
|
|
173
|
+
readonly ttl?: string | undefined;
|
|
174
|
+
} | undefined;
|
|
126
175
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
176
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
177
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
178
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
179
|
+
readonly metadata?: {
|
|
180
|
+
readonly [x: string]: string;
|
|
181
|
+
} | undefined;
|
|
182
|
+
readonly safety_identifier?: string | undefined;
|
|
127
183
|
readonly tool_stream?: boolean | undefined;
|
|
128
184
|
readonly max_completion_tokens?: number | undefined;
|
|
129
185
|
readonly max_tokens?: number | undefined;
|
|
@@ -143,6 +199,11 @@ export declare const routes: Route<{
|
|
|
143
199
|
readonly image_url: {
|
|
144
200
|
readonly url: string;
|
|
145
201
|
};
|
|
202
|
+
} | {
|
|
203
|
+
readonly type: "video_url";
|
|
204
|
+
readonly video_url: {
|
|
205
|
+
readonly url: string;
|
|
206
|
+
};
|
|
146
207
|
} | {
|
|
147
208
|
readonly type: "file";
|
|
148
209
|
readonly file: {
|
|
@@ -164,6 +225,11 @@ export declare const routes: Route<{
|
|
|
164
225
|
readonly image_url: {
|
|
165
226
|
readonly url: string;
|
|
166
227
|
};
|
|
228
|
+
} | {
|
|
229
|
+
readonly type: "video_url";
|
|
230
|
+
readonly video_url: {
|
|
231
|
+
readonly url: string;
|
|
232
|
+
};
|
|
167
233
|
} | {
|
|
168
234
|
readonly type: "file";
|
|
169
235
|
readonly file: {
|
|
@@ -200,7 +266,14 @@ export declare const routes: Route<{
|
|
|
200
266
|
readonly ttl?: string | undefined;
|
|
201
267
|
} | undefined;
|
|
202
268
|
}[] | null;
|
|
203
|
-
readonly tool_calls?: readonly {
|
|
269
|
+
readonly tool_calls?: readonly ({
|
|
270
|
+
readonly id: string;
|
|
271
|
+
readonly type: "custom";
|
|
272
|
+
readonly custom: {
|
|
273
|
+
readonly name: string;
|
|
274
|
+
readonly input: string;
|
|
275
|
+
};
|
|
276
|
+
} | {
|
|
204
277
|
readonly id: string;
|
|
205
278
|
readonly type: "function";
|
|
206
279
|
readonly function: {
|
|
@@ -212,13 +285,13 @@ export declare const routes: Route<{
|
|
|
212
285
|
readonly thought_signature: string;
|
|
213
286
|
};
|
|
214
287
|
} | undefined;
|
|
215
|
-
}[] | undefined;
|
|
288
|
+
})[] | undefined;
|
|
216
289
|
readonly reasoning_content?: string | undefined;
|
|
217
290
|
readonly reasoning?: string | undefined;
|
|
218
291
|
readonly reasoning_text?: string | undefined;
|
|
219
292
|
readonly reasoning_details?: unknown;
|
|
220
293
|
})[];
|
|
221
|
-
readonly tools?: readonly {
|
|
294
|
+
readonly tools?: readonly ({
|
|
222
295
|
readonly type: "function";
|
|
223
296
|
readonly function: {
|
|
224
297
|
readonly name: string;
|
|
@@ -232,12 +305,36 @@ export declare const routes: Route<{
|
|
|
232
305
|
readonly type: "ephemeral";
|
|
233
306
|
readonly ttl?: string | undefined;
|
|
234
307
|
} | undefined;
|
|
235
|
-
}
|
|
308
|
+
} | {
|
|
309
|
+
readonly type: "custom";
|
|
310
|
+
readonly custom: {
|
|
311
|
+
readonly name: string;
|
|
312
|
+
readonly description: string;
|
|
313
|
+
readonly format: {
|
|
314
|
+
readonly type: "text";
|
|
315
|
+
} | {
|
|
316
|
+
readonly type: "grammar";
|
|
317
|
+
readonly grammar: {
|
|
318
|
+
readonly syntax: "lark" | "regex";
|
|
319
|
+
readonly definition: string;
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
readonly cache_control?: {
|
|
324
|
+
readonly type: "ephemeral";
|
|
325
|
+
readonly ttl?: string | undefined;
|
|
326
|
+
} | undefined;
|
|
327
|
+
})[] | undefined;
|
|
236
328
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
237
329
|
readonly type: "function";
|
|
238
330
|
readonly function: {
|
|
239
331
|
readonly name: string;
|
|
240
332
|
};
|
|
333
|
+
} | {
|
|
334
|
+
readonly type: "custom";
|
|
335
|
+
readonly custom: {
|
|
336
|
+
readonly name: string;
|
|
337
|
+
};
|
|
241
338
|
} | undefined;
|
|
242
339
|
readonly stream: true;
|
|
243
340
|
readonly stream_options?: {
|
|
@@ -245,7 +342,18 @@ export declare const routes: Route<{
|
|
|
245
342
|
} | undefined;
|
|
246
343
|
readonly store?: boolean | undefined;
|
|
247
344
|
readonly prompt_cache_key?: string | undefined;
|
|
345
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
346
|
+
readonly prompt_cache_options?: {
|
|
347
|
+
readonly ttl?: string | undefined;
|
|
348
|
+
} | undefined;
|
|
248
349
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
350
|
+
readonly verbosity?: import("../schema/options.js").OpenString<"high" | "low" | "medium"> | undefined;
|
|
351
|
+
readonly service_tier?: import("../schema/options.js").OpenString<"auto" | "default" | "flex" | "priority"> | undefined;
|
|
352
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
353
|
+
readonly metadata?: {
|
|
354
|
+
readonly [x: string]: string;
|
|
355
|
+
} | undefined;
|
|
356
|
+
readonly safety_identifier?: string | undefined;
|
|
249
357
|
readonly tool_stream?: boolean | undefined;
|
|
250
358
|
readonly max_completion_tokens?: number | undefined;
|
|
251
359
|
readonly max_tokens?: number | undefined;
|
|
@@ -256,15 +364,19 @@ export declare const routes: Route<{
|
|
|
256
364
|
readonly seed?: number | undefined;
|
|
257
365
|
readonly stop?: readonly string[] | undefined;
|
|
258
366
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
259
|
-
export declare const configure: (input?:
|
|
367
|
+
export declare const configure: (input?: Config) => {
|
|
260
368
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
261
369
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
370
|
+
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
262
371
|
configure: typeof configure;
|
|
263
372
|
};
|
|
264
373
|
export declare const provider: {
|
|
265
374
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
266
375
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
376
|
+
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
267
377
|
configure: typeof configure;
|
|
268
378
|
};
|
|
269
|
-
export declare const
|
|
379
|
+
export declare const decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
380
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
381
|
+
export declare const decisionModel: (modelID: string, settings?: Settings) => import("../decision.js").DecisionModel<BasetenDecisionOptions>;
|
|
270
382
|
export * as Baseten from "./baseten.js";
|