@opencode/ai 2.0.32 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-client.d.ts +2 -2
- package/dist/experimental/evaluation-client.d.ts +1 -1
- package/dist/experimental/evaluation.d.ts +20 -20
- package/dist/experimental/realtime.d.ts +6 -14
- package/dist/experimental/realtime.js +28 -3
- package/dist/experimental/system-one.d.ts +1 -1
- package/dist/image-client.d.ts +8 -8
- package/dist/image.d.ts +593 -437
- package/dist/llm.d.ts +51 -51
- package/dist/media-client.d.ts +1 -1
- package/dist/media.d.ts +4 -4
- package/dist/promise.d.ts +199 -198
- package/dist/protocols/alibaba-chat.d.ts +81 -82
- package/dist/protocols/alibaba-chat.js +0 -1
- package/dist/protocols/alibaba-messages.d.ts +99 -99
- package/dist/protocols/alibaba-responses.d.ts +120 -120
- package/dist/protocols/anthropic-messages.d.ts +187 -187
- package/dist/protocols/anthropic-messages.js +3 -2
- package/dist/protocols/assemblyai-transcription.d.ts +1 -1
- package/dist/protocols/bedrock-converse.d.ts +75 -79
- package/dist/protocols/bfl-images.d.ts +1 -1
- package/dist/protocols/cartesia-speech.d.ts +17 -17
- package/dist/protocols/cohere-chat.d.ts +26 -23
- package/dist/protocols/cohere-chat.js +22 -1
- package/dist/protocols/deepgram-speech.d.ts +17 -17
- package/dist/protocols/deepgram-transcription.d.ts +1 -1
- package/dist/protocols/elevenlabs-speech.d.ts +17 -17
- package/dist/protocols/elevenlabs-transcription.d.ts +1 -1
- package/dist/protocols/fal-images.d.ts +1 -1
- package/dist/protocols/fal-video.d.ts +1 -1
- package/dist/protocols/gemini.d.ts +55 -55
- package/dist/protocols/google-images.d.ts +1 -1
- package/dist/protocols/google-interactions.d.ts +64 -62
- package/dist/protocols/google-interactions.js +19 -1
- package/dist/protocols/google-speech.d.ts +17 -17
- package/dist/protocols/google-transcription.d.ts +47 -47
- package/dist/protocols/google-video.d.ts +1 -1
- package/dist/protocols/meta-messages.d.ts +121 -121
- package/dist/protocols/meta-responses.d.ts +201 -201
- package/dist/protocols/mistral-chat.d.ts +45 -45
- package/dist/protocols/open-responses-channel.d.ts +1 -1
- package/dist/protocols/open-responses.d.ts +584 -450
- package/dist/protocols/open-responses.js +27 -35
- package/dist/protocols/openai-chat.d.ts +248 -248
- package/dist/protocols/openai-chat.js +11 -42
- package/dist/protocols/openai-compatible-chat.d.ts +32 -32
- package/dist/protocols/openai-compatible-responses.d.ts +88 -88
- package/dist/protocols/openai-images.d.ts +17 -17
- package/dist/protocols/openai-responses.d.ts +567 -567
- package/dist/protocols/openai-responses.js +1 -1
- package/dist/protocols/openai-speech.d.ts +17 -17
- package/dist/protocols/openai-transcription.d.ts +47 -47
- package/dist/protocols/replicate-images.d.ts +1 -1
- package/dist/protocols/runway-video.d.ts +1 -1
- package/dist/protocols/shared.d.ts +12 -1
- package/dist/protocols/shared.js +17 -1
- package/dist/protocols/stability-images.d.ts +2 -2
- package/dist/protocols/utils/bedrock-cache.d.ts +2 -2
- package/dist/protocols/utils/bedrock-media.d.ts +4 -4
- package/dist/protocols/utils/openai-options.d.ts +1 -1
- package/dist/protocols/utils/speech-stream.d.ts +1 -1
- package/dist/protocols/utils/tool-schema.d.ts +10 -5
- package/dist/protocols/utils/tool-stream.d.ts +152 -152
- package/dist/protocols/venice-chat.d.ts +109 -110
- package/dist/protocols/venice-chat.js +0 -1
- package/dist/protocols/xai-images.d.ts +1 -1
- package/dist/protocols/xai-responses.d.ts +79 -79
- package/dist/protocols/xai-video.d.ts +1 -1
- package/dist/protocols/zai-chat.d.ts +77 -78
- package/dist/protocols/zai-chat.js +0 -1
- package/dist/protocols/zai-images.d.ts +1 -1
- package/dist/protocols/zai-messages.d.ts +97 -97
- package/dist/providers/alibaba.d.ts +222 -283
- package/dist/providers/amazon-bedrock-mantle.d.ts +291 -298
- package/dist/providers/amazon-bedrock.d.ts +22 -28
- package/dist/providers/anthropic-compatible.d.ts +86 -90
- package/dist/providers/anthropic.d.ts +86 -90
- package/dist/providers/assemblyai.d.ts +2 -6
- package/dist/providers/azure.d.ts +228 -238
- package/dist/providers/baseten.d.ts +66 -70
- package/dist/providers/black-forest-labs.d.ts +2 -6
- package/dist/providers/cartesia.d.ts +2 -6
- package/dist/providers/cerebras.d.ts +66 -70
- package/dist/providers/cerebras.js +0 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +352 -356
- package/dist/providers/cloudflare-workers-ai.d.ts +66 -70
- package/dist/providers/cohere.d.ts +122 -132
- package/dist/providers/cohere.js +0 -2
- package/dist/providers/deepgram.d.ts +2 -7
- package/dist/providers/deepinfra.d.ts +66 -70
- package/dist/providers/deepinfra.js +0 -1
- package/dist/providers/deepseek.d.ts +66 -70
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/digitalocean.d.ts +137 -141
- package/dist/providers/elevenlabs.d.ts +2 -7
- package/dist/providers/fal.d.ts +2 -7
- package/dist/providers/fireworks.d.ts +66 -70
- package/dist/providers/google-vertex-chat.d.ts +34 -38
- package/dist/providers/google-vertex-interactions.d.ts +31 -41
- package/dist/providers/google-vertex-messages.d.ts +81 -85
- package/dist/providers/google-vertex-mistral.d.ts +23 -27
- package/dist/providers/google-vertex-responses.d.ts +90 -94
- package/dist/providers/google-vertex.d.ts +26 -30
- package/dist/providers/google.d.ts +94 -109
- package/dist/providers/groq.d.ts +111 -115
- package/dist/providers/groq.js +0 -1
- package/dist/providers/meta.d.ts +309 -317
- package/dist/providers/meta.js +1 -1
- package/dist/providers/minimax.d.ts +296 -303
- package/dist/providers/minimax.js +1 -1
- package/dist/providers/mistral.d.ts +22 -26
- package/dist/providers/moonshot.d.ts +296 -303
- package/dist/providers/moonshot.js +0 -1
- package/dist/providers/openai-compatible-responses.d.ts +90 -94
- package/dist/providers/openai-compatible.d.ts +34 -38
- package/dist/providers/openai.d.ts +93 -108
- package/dist/providers/opencode.d.ts +2 -8
- package/dist/providers/openrouter.d.ts +137 -144
- package/dist/providers/replicate.d.ts +2 -6
- package/dist/providers/runway.d.ts +2 -6
- package/dist/providers/stability.d.ts +2 -7
- package/dist/providers/togetherai.d.ts +66 -70
- package/dist/providers/togetherai.js +1 -1
- package/dist/providers/typesafe-ai.d.ts +2 -8
- package/dist/providers/venice.d.ts +58 -63
- package/dist/providers/vercel-ai-gateway.d.ts +2 -12
- package/dist/providers/xai.d.ts +38 -50
- package/dist/providers/zai-coding-plan.d.ts +206 -213
- package/dist/providers/zai.d.ts +40 -46
- package/dist/route/client.d.ts +51 -51
- package/dist/route/media-protocol.d.ts +1 -1
- package/dist/route/transport/http.d.ts +1 -1
- package/dist/route/transport/websocket.d.ts +8 -8
- package/dist/schema/errors.d.ts +19 -19
- package/dist/schema/events.d.ts +3090 -3288
- package/dist/schema/messages.d.ts +8 -7
- package/dist/schema/options.d.ts +2 -1
- package/dist/schema/options.js +2 -1
- package/dist/speech-client.d.ts +8 -8
- package/dist/speech.d.ts +434 -398
- package/dist/testing.d.ts +338 -338
- package/dist/tool-runtime.d.ts +1 -1
- package/dist/transcription-client.d.ts +23 -23
- package/dist/transcription.d.ts +562 -646
- package/dist/utils/sanitize.d.ts +4 -0
- package/dist/utils/sanitize.js +23 -6
- package/dist/video-client.d.ts +8 -8
- package/dist/video.d.ts +416 -372
- package/package.json +6 -6
|
@@ -549,45 +549,19 @@ const detectMaxTokensField = (provider, baseURL) => {
|
|
|
549
549
|
return "max_tokens";
|
|
550
550
|
return "max_completion_tokens";
|
|
551
551
|
};
|
|
552
|
+
// `store` defaults to false on OpenAI and Azure, but org-level logging can still
|
|
553
|
+
// store requests that omit it, so send an explicit `store: false` there. Strict
|
|
554
|
+
// OpenAI-style APIs reject the field with a 400, so omit it everywhere else.
|
|
552
555
|
const detectSupportsStore = (provider, baseURL) => {
|
|
553
556
|
const p = provider.toLowerCase();
|
|
554
557
|
const url = (baseURL ?? "").toLowerCase();
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
p === "zhipuai-coding-plan" ||
|
|
562
|
-
url.includes("api.z.ai") ||
|
|
563
|
-
url.includes("open.bigmodel.cn");
|
|
564
|
-
const isDeepSeek = p === "deepseek" || url.includes("deepseek.com");
|
|
565
|
-
const isCerebras = p === "cerebras" || url.includes("cerebras.ai");
|
|
566
|
-
const isXai = p === "xai" || url.includes("api.x.ai");
|
|
567
|
-
const isChutes = p === "chutes" || url.includes("chutes.ai");
|
|
568
|
-
const isCloudflareWorkersAI = p === "cloudflare-workers-ai" || url.includes("api.cloudflare.com");
|
|
569
|
-
const isCloudflareAiGateway = p === "cloudflare-ai-gateway" || url.includes("gateway.ai.cloudflare.com");
|
|
570
|
-
const isVercelAiGateway = p === "vercel-ai-gateway" || url.includes("ai-gateway.vercel.sh") || url.includes("vercel.sh");
|
|
571
|
-
const isAntLing = p === "ant-ling" || url.includes("api.ant-ling.com");
|
|
572
|
-
const isOpencode = p === "opencode" || url.includes("opencode.ai");
|
|
573
|
-
const isGemini = url.includes("generativelanguage.googleapis.com");
|
|
574
|
-
const isNonStandard = isGemini ||
|
|
575
|
-
isNvidia ||
|
|
576
|
-
isCerebras ||
|
|
577
|
-
isXai ||
|
|
578
|
-
isTogether ||
|
|
579
|
-
isChutes ||
|
|
580
|
-
isDeepSeek ||
|
|
581
|
-
isZai ||
|
|
582
|
-
isMoonshot ||
|
|
583
|
-
isOpencode ||
|
|
584
|
-
isCloudflareWorkersAI ||
|
|
585
|
-
isCloudflareAiGateway ||
|
|
586
|
-
isVercelAiGateway ||
|
|
587
|
-
isAntLing;
|
|
588
|
-
return !isNonStandard;
|
|
558
|
+
return (p === "openai" ||
|
|
559
|
+
p === "azure" ||
|
|
560
|
+
url.includes("api.openai.com") ||
|
|
561
|
+
url.includes(".openai.azure.com") ||
|
|
562
|
+
url.includes(".cognitiveservices.azure.com") ||
|
|
563
|
+
url.includes(".services.ai.azure.com"));
|
|
589
564
|
};
|
|
590
|
-
const detectSupportsUsageInStreaming = () => true;
|
|
591
565
|
const detectSupportsStrictMode = (provider, baseURL) => {
|
|
592
566
|
const p = provider.toLowerCase();
|
|
593
567
|
const url = (baseURL ?? "").toLowerCase();
|
|
@@ -620,11 +594,7 @@ const lowerOptions = (request, supportsStore) => {
|
|
|
620
594
|
// (x-session-affinity, x-grok-conv-id, ...) is unaffected.
|
|
621
595
|
const cacheKey = (request.model.compatibility?.supportsPromptCacheKey ?? false) ? ProviderShared.promptCacheKey(request) : undefined;
|
|
622
596
|
return {
|
|
623
|
-
...(supportsStore
|
|
624
|
-
// For providers that support `store`, ensure stateless `store:false` is sent
|
|
625
|
-
// even when no explicit `providerOptions.store` was supplied, mirroring the
|
|
626
|
-
// native OpenAI Chat default. Non-standard providers omit `store` entirely.
|
|
627
|
-
...(supportsStore && options.store === undefined ? { store: false } : {}),
|
|
597
|
+
...(supportsStore ? { store: options.store ?? false } : {}),
|
|
628
598
|
...(cacheKey ? { prompt_cache_key: cacheKey } : {}),
|
|
629
599
|
...(options.reasoningEffort ? { reasoning_effort: options.reasoningEffort } : {}),
|
|
630
600
|
};
|
|
@@ -642,7 +612,6 @@ export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* (reques
|
|
|
642
612
|
const detectedMaxTokensField = detectMaxTokensField(provider, baseURL);
|
|
643
613
|
const maxTokensField = request.model.compatibility?.maxTokensField ?? detectedMaxTokensField;
|
|
644
614
|
const supportsStore = request.model.compatibility?.supportsStore ?? detectSupportsStore(provider, baseURL);
|
|
645
|
-
const supportsUsageInStreaming = request.model.compatibility?.supportsUsageInStreaming ?? detectSupportsUsageInStreaming();
|
|
646
615
|
const supportsStrictMode = request.model.compatibility?.supportsStrictMode ?? detectSupportsStrictMode(provider, baseURL);
|
|
647
616
|
const zaiToolStream = request.model.compatibility?.zaiToolStream ?? detectZaiToolStream(provider, baseURL, request.model.id);
|
|
648
617
|
const hasHistory = hasToolHistory(request.messages);
|
|
@@ -658,7 +627,7 @@ export const fromRequest = Effect.fn("OpenAIChat.fromRequest")(function* (reques
|
|
|
658
627
|
: flattened.tools.map((tool) => lowerTool(tool, lowering, supportsStrictMode)),
|
|
659
628
|
tool_choice: hasActiveTools && request.toolChoice ? yield* lowerToolChoice(request.toolChoice) : undefined,
|
|
660
629
|
stream: true,
|
|
661
|
-
...(
|
|
630
|
+
...((request.model.compatibility?.streamUsage ?? true) ? { stream_options: { include_usage: true } } : {}),
|
|
662
631
|
...(zaiToolStream && hasActiveTools ? { tool_stream: true } : {}),
|
|
663
632
|
...(maxTokensField === "max_completion_tokens"
|
|
664
633
|
? { max_completion_tokens: generation?.maxTokens }
|
|
@@ -51,8 +51,20 @@ export declare const route: Route<{
|
|
|
51
51
|
readonly file_data: string;
|
|
52
52
|
};
|
|
53
53
|
})[];
|
|
54
|
+
} | {
|
|
55
|
+
readonly role: "tool";
|
|
56
|
+
readonly tool_call_id: string;
|
|
57
|
+
readonly content: string | readonly {
|
|
58
|
+
readonly type: "text";
|
|
59
|
+
readonly text: string;
|
|
60
|
+
readonly cache_control?: {
|
|
61
|
+
readonly type: "ephemeral";
|
|
62
|
+
readonly ttl?: string | undefined;
|
|
63
|
+
} | undefined;
|
|
64
|
+
}[];
|
|
54
65
|
} | {
|
|
55
66
|
readonly [x: string]: unknown;
|
|
67
|
+
readonly role: "assistant";
|
|
56
68
|
readonly content: string | readonly {
|
|
57
69
|
readonly type: "text";
|
|
58
70
|
readonly text: string;
|
|
@@ -61,72 +73,60 @@ export declare const route: Route<{
|
|
|
61
73
|
readonly ttl?: string | undefined;
|
|
62
74
|
} | undefined;
|
|
63
75
|
}[] | null;
|
|
64
|
-
readonly role: "assistant";
|
|
65
|
-
readonly reasoning?: string | undefined;
|
|
66
|
-
readonly reasoning_content?: string | undefined;
|
|
67
|
-
readonly reasoning_text?: string | undefined;
|
|
68
76
|
readonly tool_calls?: readonly {
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly type: "function";
|
|
69
79
|
readonly function: {
|
|
70
80
|
readonly name: string;
|
|
71
81
|
readonly arguments: string;
|
|
72
82
|
};
|
|
73
|
-
readonly id: string;
|
|
74
|
-
readonly type: "function";
|
|
75
83
|
readonly extra_content?: {
|
|
76
84
|
readonly google: {
|
|
77
85
|
readonly thought_signature: string;
|
|
78
86
|
};
|
|
79
87
|
} | undefined;
|
|
80
88
|
}[] | undefined;
|
|
89
|
+
readonly reasoning_content?: string | undefined;
|
|
90
|
+
readonly reasoning?: string | undefined;
|
|
91
|
+
readonly reasoning_text?: string | undefined;
|
|
81
92
|
readonly reasoning_details?: unknown;
|
|
82
|
-
} | {
|
|
83
|
-
readonly role: "tool";
|
|
84
|
-
readonly tool_call_id: string;
|
|
85
|
-
readonly content: string | readonly {
|
|
86
|
-
readonly type: "text";
|
|
87
|
-
readonly text: string;
|
|
88
|
-
readonly cache_control?: {
|
|
89
|
-
readonly type: "ephemeral";
|
|
90
|
-
readonly ttl?: string | undefined;
|
|
91
|
-
} | undefined;
|
|
92
|
-
}[];
|
|
93
93
|
})[];
|
|
94
|
-
readonly stream: true;
|
|
95
|
-
readonly max_completion_tokens?: number | undefined;
|
|
96
|
-
readonly max_tokens?: number | undefined;
|
|
97
|
-
readonly temperature?: number | undefined;
|
|
98
94
|
readonly tools?: readonly {
|
|
95
|
+
readonly type: "function";
|
|
99
96
|
readonly function: {
|
|
100
|
-
readonly description: string;
|
|
101
97
|
readonly name: string;
|
|
98
|
+
readonly description: string;
|
|
102
99
|
readonly parameters: {
|
|
103
100
|
readonly [x: string]: unknown;
|
|
104
101
|
};
|
|
105
102
|
readonly strict?: boolean | undefined;
|
|
106
103
|
};
|
|
107
|
-
readonly type: "function";
|
|
108
104
|
readonly cache_control?: {
|
|
109
105
|
readonly type: "ephemeral";
|
|
110
106
|
readonly ttl?: string | undefined;
|
|
111
107
|
} | undefined;
|
|
112
108
|
}[] | undefined;
|
|
113
|
-
readonly
|
|
114
|
-
readonly seed?: number | undefined;
|
|
115
|
-
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
109
|
+
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
116
110
|
readonly type: "function";
|
|
117
111
|
readonly function: {
|
|
118
112
|
readonly name: string;
|
|
119
113
|
};
|
|
120
114
|
} | undefined;
|
|
121
|
-
readonly
|
|
122
|
-
readonly frequency_penalty?: number | undefined;
|
|
123
|
-
readonly presence_penalty?: number | undefined;
|
|
124
|
-
readonly store?: boolean | undefined;
|
|
125
|
-
readonly prompt_cache_key?: string | undefined;
|
|
126
|
-
readonly reasoning_effort?: import("../index.js").ReasoningEffort | undefined;
|
|
115
|
+
readonly stream: true;
|
|
127
116
|
readonly stream_options?: {
|
|
128
117
|
readonly include_usage: boolean;
|
|
129
118
|
} | undefined;
|
|
119
|
+
readonly store?: boolean | undefined;
|
|
120
|
+
readonly prompt_cache_key?: string | undefined;
|
|
121
|
+
readonly reasoning_effort?: import("../index.js").ReasoningEffort | undefined;
|
|
130
122
|
readonly tool_stream?: boolean | undefined;
|
|
123
|
+
readonly max_completion_tokens?: number | undefined;
|
|
124
|
+
readonly max_tokens?: number | undefined;
|
|
125
|
+
readonly temperature?: number | undefined;
|
|
126
|
+
readonly top_p?: number | undefined;
|
|
127
|
+
readonly frequency_penalty?: number | undefined;
|
|
128
|
+
readonly presence_penalty?: number | undefined;
|
|
129
|
+
readonly seed?: number | undefined;
|
|
130
|
+
readonly stop?: readonly string[] | undefined;
|
|
131
131
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
132
132
|
export * as OpenAICompatibleChat from "./openai-compatible-chat.js";
|
|
@@ -6,64 +6,16 @@ export type OpenAICompatibleResponsesLanguageModelInput = RouteRoutedLanguageMod
|
|
|
6
6
|
* auth while the semantic protocol remains provider-neutral.
|
|
7
7
|
*/
|
|
8
8
|
export declare const route: Route<{
|
|
9
|
+
readonly model: string;
|
|
9
10
|
readonly input: readonly ({
|
|
10
|
-
readonly
|
|
11
|
-
readonly id
|
|
12
|
-
readonly
|
|
13
|
-
readonly status?: string | undefined;
|
|
14
|
-
readonly action?: {
|
|
15
|
-
readonly [x: string]: unknown;
|
|
16
|
-
} | null | undefined;
|
|
17
|
-
} | {
|
|
18
|
-
readonly [x: string]: unknown;
|
|
19
|
-
readonly id: string;
|
|
20
|
-
readonly type: "file_search_call";
|
|
21
|
-
readonly status?: string | undefined;
|
|
22
|
-
readonly queries?: readonly string[] | undefined;
|
|
23
|
-
readonly results?: readonly {
|
|
24
|
-
readonly [x: string]: unknown;
|
|
25
|
-
}[] | null | undefined;
|
|
26
|
-
} | {
|
|
27
|
-
readonly [x: string]: unknown;
|
|
28
|
-
readonly id: string;
|
|
29
|
-
readonly type: "code_interpreter_call";
|
|
30
|
-
readonly status?: string | undefined;
|
|
31
|
-
readonly code?: string | null | undefined;
|
|
32
|
-
readonly container_id?: string | null | undefined;
|
|
33
|
-
readonly outputs?: readonly {
|
|
34
|
-
readonly [x: string]: unknown;
|
|
35
|
-
}[] | null | undefined;
|
|
36
|
-
} | {
|
|
37
|
-
readonly [x: string]: unknown;
|
|
38
|
-
readonly id: string;
|
|
39
|
-
readonly type: "mcp_call";
|
|
40
|
-
readonly status?: string | undefined;
|
|
41
|
-
readonly name?: string | undefined;
|
|
42
|
-
readonly output?: string | null | undefined;
|
|
43
|
-
readonly error?: unknown;
|
|
44
|
-
readonly arguments?: string | undefined;
|
|
45
|
-
readonly server_label?: string | undefined;
|
|
11
|
+
readonly type: "compaction";
|
|
12
|
+
readonly id?: string | null | undefined;
|
|
13
|
+
readonly encrypted_content: string;
|
|
46
14
|
} | {
|
|
47
15
|
readonly type: "configuration_update";
|
|
48
16
|
readonly reasoning: {
|
|
49
17
|
readonly effort: import("../index.js").ReasoningEffort;
|
|
50
18
|
};
|
|
51
|
-
} | {
|
|
52
|
-
readonly [x: string]: unknown;
|
|
53
|
-
readonly type: string;
|
|
54
|
-
readonly id: string;
|
|
55
|
-
} | {
|
|
56
|
-
readonly type: "reasoning";
|
|
57
|
-
readonly summary: readonly {
|
|
58
|
-
readonly type: "summary_text";
|
|
59
|
-
readonly text: string;
|
|
60
|
-
}[];
|
|
61
|
-
readonly id?: string | undefined;
|
|
62
|
-
readonly encrypted_content?: string | null | undefined;
|
|
63
|
-
} | {
|
|
64
|
-
readonly type: "compaction";
|
|
65
|
-
readonly encrypted_content: string;
|
|
66
|
-
readonly id?: string | null | undefined;
|
|
67
19
|
} | {
|
|
68
20
|
readonly type: "message";
|
|
69
21
|
readonly role: "system";
|
|
@@ -74,6 +26,7 @@ export declare const route: Route<{
|
|
|
74
26
|
readonly content: string;
|
|
75
27
|
} | {
|
|
76
28
|
readonly type: "message";
|
|
29
|
+
readonly role: "user";
|
|
77
30
|
readonly content: readonly ({
|
|
78
31
|
readonly type: "input_image";
|
|
79
32
|
readonly image_url: string;
|
|
@@ -88,26 +41,33 @@ export declare const route: Route<{
|
|
|
88
41
|
readonly type: "input_text";
|
|
89
42
|
readonly text: string;
|
|
90
43
|
})[];
|
|
91
|
-
readonly role: "user";
|
|
92
44
|
readonly id?: string | undefined;
|
|
93
45
|
readonly status?: string | undefined;
|
|
94
46
|
} | {
|
|
95
47
|
readonly type: "message";
|
|
48
|
+
readonly id?: string | undefined;
|
|
49
|
+
readonly role: "assistant";
|
|
96
50
|
readonly content: readonly {
|
|
97
51
|
readonly type: "output_text";
|
|
98
52
|
readonly text: string;
|
|
99
53
|
}[];
|
|
100
|
-
readonly role: "assistant";
|
|
101
|
-
readonly id?: string | undefined;
|
|
102
|
-
readonly status?: string | undefined;
|
|
103
54
|
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
55
|
+
readonly status?: string | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: "reasoning";
|
|
58
|
+
readonly id?: string | undefined;
|
|
59
|
+
readonly summary: readonly {
|
|
60
|
+
readonly type: "summary_text";
|
|
61
|
+
readonly text: string;
|
|
62
|
+
}[];
|
|
63
|
+
readonly encrypted_content?: string | null | undefined;
|
|
104
64
|
} | {
|
|
105
65
|
readonly type: "function_call";
|
|
106
|
-
readonly name: string;
|
|
107
|
-
readonly arguments: string;
|
|
108
|
-
readonly call_id: string;
|
|
109
66
|
readonly id?: string | undefined;
|
|
67
|
+
readonly call_id: string;
|
|
68
|
+
readonly name: string;
|
|
110
69
|
readonly namespace?: string | undefined;
|
|
70
|
+
readonly arguments: string;
|
|
111
71
|
} | {
|
|
112
72
|
readonly type: "function_call_output";
|
|
113
73
|
readonly call_id: string;
|
|
@@ -128,59 +88,99 @@ export declare const route: Route<{
|
|
|
128
88
|
readonly type: "input_video";
|
|
129
89
|
readonly video_url: string;
|
|
130
90
|
})[];
|
|
91
|
+
} | {
|
|
92
|
+
readonly [x: string]: unknown;
|
|
93
|
+
readonly type: "web_search_call";
|
|
94
|
+
readonly id: string;
|
|
95
|
+
readonly status?: string | undefined;
|
|
96
|
+
readonly action?: {
|
|
97
|
+
readonly [x: string]: unknown;
|
|
98
|
+
} | null | undefined;
|
|
99
|
+
} | {
|
|
100
|
+
readonly [x: string]: unknown;
|
|
101
|
+
readonly type: "file_search_call";
|
|
102
|
+
readonly id: string;
|
|
103
|
+
readonly status?: string | undefined;
|
|
104
|
+
readonly queries?: readonly string[] | undefined;
|
|
105
|
+
readonly results?: readonly {
|
|
106
|
+
readonly [x: string]: unknown;
|
|
107
|
+
}[] | null | undefined;
|
|
108
|
+
} | {
|
|
109
|
+
readonly [x: string]: unknown;
|
|
110
|
+
readonly type: "code_interpreter_call";
|
|
111
|
+
readonly id: string;
|
|
112
|
+
readonly status?: string | undefined;
|
|
113
|
+
readonly code?: string | null | undefined;
|
|
114
|
+
readonly container_id?: string | null | undefined;
|
|
115
|
+
readonly outputs?: readonly {
|
|
116
|
+
readonly [x: string]: unknown;
|
|
117
|
+
}[] | null | undefined;
|
|
118
|
+
} | {
|
|
119
|
+
readonly [x: string]: unknown;
|
|
120
|
+
readonly type: "mcp_call";
|
|
121
|
+
readonly id: string;
|
|
122
|
+
readonly status?: string | undefined;
|
|
123
|
+
readonly server_label?: string | undefined;
|
|
124
|
+
readonly name?: string | undefined;
|
|
125
|
+
readonly arguments?: string | undefined;
|
|
126
|
+
readonly output?: string | null | undefined;
|
|
127
|
+
readonly error?: unknown;
|
|
128
|
+
} | {
|
|
129
|
+
readonly [x: string]: unknown;
|
|
130
|
+
readonly type: string;
|
|
131
|
+
readonly id: string;
|
|
131
132
|
})[];
|
|
132
|
-
readonly model: string;
|
|
133
|
-
readonly stream: true;
|
|
134
|
-
readonly metadata?: {
|
|
135
|
-
readonly [x: string]: string;
|
|
136
|
-
} | undefined;
|
|
137
133
|
readonly instructions?: string | undefined;
|
|
138
|
-
readonly reasoning?: {
|
|
139
|
-
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
140
|
-
readonly effort?: import("../index.js").ReasoningEffort | undefined;
|
|
141
|
-
} | undefined;
|
|
142
|
-
readonly temperature?: number | undefined;
|
|
143
134
|
readonly tools?: readonly ({
|
|
144
|
-
readonly [x: string]: unknown;
|
|
145
|
-
readonly type: string;
|
|
146
|
-
} | {
|
|
147
135
|
readonly type: "function";
|
|
148
|
-
readonly description: string;
|
|
149
136
|
readonly name: string;
|
|
137
|
+
readonly description: string;
|
|
150
138
|
readonly parameters: {
|
|
151
139
|
readonly [x: string]: unknown;
|
|
152
140
|
};
|
|
153
141
|
readonly strict?: boolean | undefined;
|
|
142
|
+
} | {
|
|
143
|
+
readonly [x: string]: unknown;
|
|
144
|
+
readonly type: string;
|
|
154
145
|
})[] | undefined;
|
|
155
|
-
readonly
|
|
156
|
-
readonly verbosity?: import("./utils/open-responses-options.js").TextVerbosity | undefined;
|
|
157
|
-
} | undefined;
|
|
158
|
-
readonly service_tier?: import("./utils/open-responses-options.js").ServiceTier | undefined;
|
|
159
|
-
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
146
|
+
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
160
147
|
readonly type: "function";
|
|
161
148
|
readonly name: string;
|
|
162
149
|
} | {
|
|
163
150
|
readonly type: "allowed_tools";
|
|
164
|
-
readonly mode: "
|
|
151
|
+
readonly mode: "auto" | "none" | "required";
|
|
165
152
|
readonly tools: readonly {
|
|
166
153
|
readonly type: "function";
|
|
167
154
|
readonly name: string;
|
|
168
155
|
}[];
|
|
169
156
|
} | undefined;
|
|
170
|
-
readonly top_p?: number | undefined;
|
|
171
|
-
readonly frequency_penalty?: number | undefined;
|
|
172
|
-
readonly presence_penalty?: number | undefined;
|
|
173
157
|
readonly store?: boolean | undefined;
|
|
174
|
-
readonly
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
readonly
|
|
178
|
-
readonly truncation?: "auto" | "disabled" | undefined;
|
|
158
|
+
readonly metadata?: {
|
|
159
|
+
readonly [x: string]: string;
|
|
160
|
+
} | undefined;
|
|
161
|
+
readonly safety_identifier?: string | undefined;
|
|
179
162
|
readonly stream_options?: {
|
|
180
163
|
readonly include_obfuscation?: boolean | undefined;
|
|
181
164
|
} | undefined;
|
|
182
|
-
readonly safety_identifier?: string | undefined;
|
|
183
165
|
readonly top_logprobs?: number | undefined;
|
|
166
|
+
readonly truncation?: "auto" | "disabled" | undefined;
|
|
167
|
+
readonly service_tier?: import("./utils/open-responses-options.js").ServiceTier | undefined;
|
|
168
|
+
readonly prompt_cache_key?: string | undefined;
|
|
169
|
+
readonly include?: readonly import("./utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
170
|
+
readonly reasoning?: {
|
|
171
|
+
readonly effort?: import("../index.js").ReasoningEffort | undefined;
|
|
172
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
173
|
+
} | undefined;
|
|
174
|
+
readonly text?: {
|
|
175
|
+
readonly verbosity?: import("./utils/open-responses-options.js").TextVerbosity | undefined;
|
|
176
|
+
} | undefined;
|
|
177
|
+
readonly max_output_tokens?: number | undefined;
|
|
184
178
|
readonly max_tool_calls?: number | undefined;
|
|
179
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
180
|
+
readonly temperature?: number | undefined;
|
|
181
|
+
readonly top_p?: number | undefined;
|
|
182
|
+
readonly presence_penalty?: number | undefined;
|
|
183
|
+
readonly frequency_penalty?: number | undefined;
|
|
184
|
+
readonly stream: true;
|
|
185
185
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
186
186
|
export * as OpenAICompatibleResponses from "./openai-compatible-responses.js";
|
|
@@ -30,12 +30,12 @@ interface State {
|
|
|
30
30
|
readonly usage?: MediaUsage;
|
|
31
31
|
}
|
|
32
32
|
export declare const protocol: MediaProtocol.Streamed<Request, {
|
|
33
|
-
readonly id: string;
|
|
34
33
|
readonly type: "generation-queued";
|
|
34
|
+
readonly id: string;
|
|
35
35
|
readonly position?: number | undefined;
|
|
36
36
|
} | {
|
|
37
|
-
readonly id: string;
|
|
38
37
|
readonly type: "generation-progress";
|
|
38
|
+
readonly id: string;
|
|
39
39
|
readonly progress?: number | undefined;
|
|
40
40
|
} | {
|
|
41
41
|
readonly type: "image-partial";
|
|
@@ -47,11 +47,6 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
|
|
|
47
47
|
readonly image: Media.Asset;
|
|
48
48
|
} | {
|
|
49
49
|
readonly type: "finish";
|
|
50
|
-
readonly providerMetadata?: {
|
|
51
|
-
readonly [x: string]: {
|
|
52
|
-
readonly [x: string]: unknown;
|
|
53
|
-
};
|
|
54
|
-
} | undefined;
|
|
55
50
|
readonly usage?: {
|
|
56
51
|
readonly type: "tokens";
|
|
57
52
|
readonly input?: number | undefined;
|
|
@@ -74,7 +69,7 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
|
|
|
74
69
|
readonly seconds: number;
|
|
75
70
|
} | undefined;
|
|
76
71
|
readonly notices?: readonly {
|
|
77
|
-
readonly type: "
|
|
72
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
78
73
|
readonly message: string;
|
|
79
74
|
readonly providerMetadata?: {
|
|
80
75
|
readonly [x: string]: {
|
|
@@ -82,16 +77,21 @@ export declare const protocol: MediaProtocol.Streamed<Request, {
|
|
|
82
77
|
};
|
|
83
78
|
} | undefined;
|
|
84
79
|
}[] | undefined;
|
|
80
|
+
readonly providerMetadata?: {
|
|
81
|
+
readonly [x: string]: {
|
|
82
|
+
readonly [x: string]: unknown;
|
|
83
|
+
};
|
|
84
|
+
} | undefined;
|
|
85
85
|
}, Frame, State>;
|
|
86
86
|
export declare const model: (input: MediaRoute.ModelInput) => ImageModel<OpenAIImageOptions>;
|
|
87
87
|
export declare const OpenAIImages: {
|
|
88
88
|
readonly protocol: MediaProtocol.Streamed<Request, {
|
|
89
|
-
readonly id: string;
|
|
90
89
|
readonly type: "generation-queued";
|
|
90
|
+
readonly id: string;
|
|
91
91
|
readonly position?: number | undefined;
|
|
92
92
|
} | {
|
|
93
|
-
readonly id: string;
|
|
94
93
|
readonly type: "generation-progress";
|
|
94
|
+
readonly id: string;
|
|
95
95
|
readonly progress?: number | undefined;
|
|
96
96
|
} | {
|
|
97
97
|
readonly type: "image-partial";
|
|
@@ -103,11 +103,6 @@ export declare const OpenAIImages: {
|
|
|
103
103
|
readonly image: Media.Asset;
|
|
104
104
|
} | {
|
|
105
105
|
readonly type: "finish";
|
|
106
|
-
readonly providerMetadata?: {
|
|
107
|
-
readonly [x: string]: {
|
|
108
|
-
readonly [x: string]: unknown;
|
|
109
|
-
};
|
|
110
|
-
} | undefined;
|
|
111
106
|
readonly usage?: {
|
|
112
107
|
readonly type: "tokens";
|
|
113
108
|
readonly input?: number | undefined;
|
|
@@ -130,7 +125,7 @@ export declare const OpenAIImages: {
|
|
|
130
125
|
readonly seconds: number;
|
|
131
126
|
} | undefined;
|
|
132
127
|
readonly notices?: readonly {
|
|
133
|
-
readonly type: "
|
|
128
|
+
readonly type: "filtered" | "moderated" | "other";
|
|
134
129
|
readonly message: string;
|
|
135
130
|
readonly providerMetadata?: {
|
|
136
131
|
readonly [x: string]: {
|
|
@@ -138,7 +133,12 @@ export declare const OpenAIImages: {
|
|
|
138
133
|
};
|
|
139
134
|
} | undefined;
|
|
140
135
|
}[] | undefined;
|
|
136
|
+
readonly providerMetadata?: {
|
|
137
|
+
readonly [x: string]: {
|
|
138
|
+
readonly [x: string]: unknown;
|
|
139
|
+
};
|
|
140
|
+
} | undefined;
|
|
141
141
|
}, Frame, State>;
|
|
142
|
-
readonly model:
|
|
142
|
+
readonly model: typeof model;
|
|
143
143
|
};
|
|
144
144
|
export {};
|