@openclaw/ai 2026.7.2-beta.2 → 2026.7.2-beta.4
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 +6 -5
- package/dist/{anthropic-BIRSg5x9.mjs → anthropic-CrUDIBpM.mjs} +173 -47
- package/dist/{api-registry-Byvoz8Ha.d.mts → api-registry-BMphkFf1.d.mts} +1 -2
- package/dist/{azure-openai-responses-CHi7Wo4A.mjs → azure-openai-responses-CbrpVeEv.mjs} +9 -11
- package/dist/{env-api-keys-DnhYpc27.mjs → env-api-keys-DrgeBuva.mjs} +1 -1
- package/dist/{event-stream-uQspnL8S.d.mts → event-stream-Douf9dob.d.mts} +1 -1
- package/dist/event-stream.d.mts +1 -1
- package/dist/{google-BmsqsNwR.mjs → google-Cs62KA7t.mjs} +4 -4
- package/dist/{google-shared-Dx2aba47.mjs → google-shared-CMLI-tCZ.mjs} +4 -3
- package/dist/{google-vertex-HZ_0rTwS.mjs → google-vertex-B4SD3U0f.mjs} +3 -3
- package/dist/host-WvWBo4h8.d.mts +173 -0
- package/dist/host-XYGZcgO8.mjs +98 -0
- package/dist/index-BVVgDSdq.d.mts +1 -0
- package/dist/index.d.mts +7 -50
- package/dist/index.mjs +1 -1
- package/dist/internal/anthropic.d.mts +9 -3
- package/dist/internal/anthropic.mjs +3 -3
- package/dist/internal/openai.d.mts +2 -279
- package/dist/internal/openai.mjs +5 -5
- package/dist/internal/runtime.d.mts +8 -5
- package/dist/internal/runtime.mjs +22 -12
- package/dist/internal/shared.d.mts +4 -2
- package/dist/internal/shared.mjs +2 -2
- package/dist/{mistral-DxMPt9q9.mjs → mistral-D5Ps7Led.mjs} +26 -10
- package/dist/{model-utils-Q1LSRIdo.mjs → model-utils-1GiZ2_rr.mjs} +3 -1
- package/dist/openai-CoGicoDt.d.mts +332 -0
- package/dist/{openai-chatgpt-responses-BuH2NvsR.mjs → openai-chatgpt-responses-h0o5yV8Y.mjs} +47 -48
- package/dist/{openai-completions-DPR_O2RW.mjs → openai-completions-exO8NFQf.mjs} +342 -102
- package/dist/{openai-responses-Cov-Vdc2.mjs → openai-responses-BHpmtUKo.mjs} +5 -5
- package/dist/{openai-responses-shared-Befb4D6R.mjs → openai-responses-shared-CzCurmY1.mjs} +527 -268
- package/dist/{openai-tool-projection-CFqm42J2.mjs → openai-tool-projection-ITOU9bG1.mjs} +1 -1
- package/dist/provider-error-C4VvV_3t.mjs +41 -0
- package/dist/providers.d.mts +1 -1
- package/dist/providers.mjs +8 -8
- package/dist/{stream-first-event-timeout-RjWszj8c.mjs → stream-first-event-timeout-DP4xEyBY.mjs} +45 -1
- package/dist/{transform-messages-BmS70CP5.mjs → system-prompt-cache-boundary-CbHeV4_l.mjs} +171 -161
- package/dist/transports.d.mts +590 -0
- package/dist/transports.mjs +5701 -0
- package/dist/{types-Cx2zJtyz.d.mts → types-AFwwWium.d.mts} +7 -0
- package/dist/types.d.mts +4 -4
- package/dist/{validation-Cej7htKc.d.mts → validation-sxvxC8J-.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/npm-shrinkwrap.json +43 -50
- package/package.json +36 -10
- package/dist/host-4t713IeR.mjs +0 -37
- /package/dist/{index-BoTnz8cv.d.mts → anthropic-BoTnz8cv.d.mts} +0 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
import { E as Model, L as StreamFn, O as OpenAICompletionsCompat, X as Usage, n as Api, u as Context } from "./types-AFwwWium.mjs";
|
|
2
|
+
import { t as AssistantMessageEventStream } from "./event-stream-Douf9dob.mjs";
|
|
3
|
+
import { n as ApiRegistry } from "./api-registry-BMphkFf1.mjs";
|
|
4
|
+
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-WvWBo4h8.mjs";
|
|
5
|
+
import { B as OpenAIApiReasoningEffort, V as OpenAIReasoningEffort, nt as OpenAICompletionsToolChoice, rt as OpenAIToolProjection } from "./openai-CoGicoDt.mjs";
|
|
6
|
+
import OpenAI from "openai";
|
|
7
|
+
import { ChatCompletionChunk } from "openai/resources/chat/completions.js";
|
|
8
|
+
import { FunctionTool, ResponseCreateParamsStreaming, ResponseInput, ResponseReasoningItem } from "openai/resources/responses/responses.js";
|
|
9
|
+
|
|
10
|
+
//#region packages/ai/src/transports/anthropic-payload-policy.d.ts
|
|
11
|
+
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
12
|
+
type AnthropicServiceTier = "auto" | "standard_only";
|
|
13
|
+
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
14
|
+
type AnthropicEphemeralCacheControl = {
|
|
15
|
+
type: "ephemeral";
|
|
16
|
+
ttl?: "1h";
|
|
17
|
+
};
|
|
18
|
+
type AnthropicPayloadPolicyInput = {
|
|
19
|
+
api?: string;
|
|
20
|
+
baseUrl?: string;
|
|
21
|
+
cacheRetention?: "short" | "long" | "none";
|
|
22
|
+
enableCacheControl?: boolean;
|
|
23
|
+
provider?: string;
|
|
24
|
+
serviceTier?: AnthropicServiceTier;
|
|
25
|
+
};
|
|
26
|
+
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
27
|
+
type AnthropicPayloadPolicy = {
|
|
28
|
+
allowsServiceTier: boolean;
|
|
29
|
+
cacheControl: AnthropicEphemeralCacheControl | undefined;
|
|
30
|
+
serviceTier: AnthropicServiceTier | undefined;
|
|
31
|
+
};
|
|
32
|
+
/** Resolve Anthropic cache-control marker retention for a request endpoint. */
|
|
33
|
+
declare function resolveAnthropicEphemeralCacheControl(baseUrl: string | undefined, cacheRetention: AnthropicPayloadPolicyInput["cacheRetention"]): AnthropicEphemeralCacheControl | undefined;
|
|
34
|
+
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
35
|
+
declare function resolveAnthropicPayloadPolicy(input: AnthropicPayloadPolicyInput): AnthropicPayloadPolicy;
|
|
36
|
+
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
37
|
+
declare function applyAnthropicPayloadPolicyToParams(payloadObj: Record<string, unknown>, policy: AnthropicPayloadPolicy, cacheBreakpointOptOutMessageIndexes: ReadonlySet<number>): void;
|
|
38
|
+
/** @deprecated Anthropic-family provider payload helper; do not use from third-party plugins. */
|
|
39
|
+
declare function applyAnthropicEphemeralCacheControlMarkers(payloadObj: Record<string, unknown>, cacheControl?: AnthropicEphemeralCacheControl | null): void;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region packages/ai/src/transports/anthropic-transport-stream.d.ts
|
|
42
|
+
/** Resolve the Anthropic Messages endpoint URL for the effective base URL. */
|
|
43
|
+
declare function resolveAnthropicMessagesUrl(baseUrl?: string): string;
|
|
44
|
+
/** Create the stream function used by Anthropic Messages transport models. */
|
|
45
|
+
declare function createAnthropicMessagesTransportStreamFn(): StreamFn;
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region packages/ai/src/transports/deepseek-text-filter.d.ts
|
|
48
|
+
interface DeepSeekTextFilter {
|
|
49
|
+
/** Push one streamed text chunk and receive any safe visible text segments. */
|
|
50
|
+
push(chunk: string): string[];
|
|
51
|
+
/** Flush buffered text at stream end, dropping any unterminated DSML block. */
|
|
52
|
+
flush(): string[];
|
|
53
|
+
}
|
|
54
|
+
/** Create an incremental text filter that strips DeepSeek DSML tool blocks. */
|
|
55
|
+
declare function createDeepSeekTextFilter(): DeepSeekTextFilter;
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region packages/ai/src/transports/json-unsafe-integers.d.ts
|
|
58
|
+
/** Quotes integer literals above Number.MAX_SAFE_INTEGER before JSON.parse. */
|
|
59
|
+
declare function quoteUnsafeIntegerLiterals(input: string): string;
|
|
60
|
+
/** Parses JSON while preserving unsafe integer literals as strings. */
|
|
61
|
+
declare function parseJsonPreservingUnsafeIntegers(input: string): unknown;
|
|
62
|
+
/** Parses or accepts an object while preserving unsafe integer literals in string input. */
|
|
63
|
+
declare function parseJsonObjectPreservingUnsafeIntegers(value: unknown): Record<string, unknown> | null;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region packages/ai/src/transports/model-max-tokens-params.d.ts
|
|
66
|
+
/** Resolve the first supported max-token parameter present in a params object. */
|
|
67
|
+
declare function resolveMaxTokensParam(params: Record<string, unknown> | undefined): number | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Canonicalize merged params to `maxTokens`, preserving source precedence from
|
|
70
|
+
* left to right across the provided source objects.
|
|
71
|
+
*/
|
|
72
|
+
declare function canonicalizeMaxTokensParam(params: {
|
|
73
|
+
merged: Record<string, unknown>;
|
|
74
|
+
sources: Array<Record<string, unknown> | undefined>;
|
|
75
|
+
}): void;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region packages/ai/src/transports/model-transport-debug.d.ts
|
|
78
|
+
/**
|
|
79
|
+
* Environment-driven debug controls for model transport logging.
|
|
80
|
+
*
|
|
81
|
+
* Model adapters share these helpers so payload, SSE, and transport diagnostics
|
|
82
|
+
* interpret OpenClaw debug environment variables consistently.
|
|
83
|
+
*/
|
|
84
|
+
type SubsystemLogger = {
|
|
85
|
+
info(message: string): void;
|
|
86
|
+
debug(message: string): void;
|
|
87
|
+
};
|
|
88
|
+
type ModelTransportDebugEnv = NodeJS.ProcessEnv;
|
|
89
|
+
/** Payload debug detail levels accepted by `OPENCLAW_DEBUG_MODEL_PAYLOAD`. */
|
|
90
|
+
type ModelPayloadDebugMode = "off" | "summary" | "tools" | "full-redacted";
|
|
91
|
+
/** SSE debug detail levels accepted by `OPENCLAW_DEBUG_SSE`. */
|
|
92
|
+
type ModelSseDebugMode = "off" | "events" | "peek";
|
|
93
|
+
/** Resolves model payload debug verbosity from `OPENCLAW_DEBUG_MODEL_PAYLOAD`. */
|
|
94
|
+
declare function resolveModelPayloadDebugMode(env?: ModelTransportDebugEnv): ModelPayloadDebugMode;
|
|
95
|
+
/** Resolves SSE stream debug verbosity from `OPENCLAW_DEBUG_SSE`. */
|
|
96
|
+
declare function resolveModelSseDebugMode(env?: ModelTransportDebugEnv): ModelSseDebugMode;
|
|
97
|
+
/** Emits model-fetch metadata at info level by default; other diagnostics require debug env. */
|
|
98
|
+
declare function emitModelTransportDebug(log: SubsystemLogger, message: string): void;
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region packages/ai/src/transports/model-transport-url.d.ts
|
|
101
|
+
/**
|
|
102
|
+
* Debug formatting helpers for model transport endpoints.
|
|
103
|
+
* Keeps logs useful without exposing credentials, request params, or fragments.
|
|
104
|
+
*/
|
|
105
|
+
/** Return a sanitized URL suitable for logs and diagnostics. */
|
|
106
|
+
declare function formatModelTransportDebugUrl(rawUrl: string): string;
|
|
107
|
+
/** Format a configured base URL for debug output, or the implicit default. */
|
|
108
|
+
declare function formatModelTransportDebugBaseUrl(rawUrl: string | undefined): string;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region packages/ai/src/transports/openai-compatible-conversation-turn.d.ts
|
|
111
|
+
/** Returns whether an OpenAI-compatible messages payload contains a usable turn. */
|
|
112
|
+
declare function hasOpenAICompatibleConversationTurn(messages: unknown): boolean;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region packages/ai/src/transports/openai-completions-compat.d.ts
|
|
115
|
+
type ProviderRequestCapabilities = AiProviderRequestCapabilities;
|
|
116
|
+
type OpenAICompletionsCompatDefaults = {
|
|
117
|
+
supportsStore: boolean;
|
|
118
|
+
supportsDeveloperRole: boolean;
|
|
119
|
+
supportsReasoningEffort: boolean;
|
|
120
|
+
supportsUsageInStreaming: boolean;
|
|
121
|
+
maxTokensField: "max_completion_tokens" | "max_tokens";
|
|
122
|
+
thinkingFormat: "openai" | "openrouter" | "deepseek" | "together" | "zai";
|
|
123
|
+
visibleReasoningDetailTypes: string[];
|
|
124
|
+
supportsStrictMode: boolean;
|
|
125
|
+
requiresReasoningContentOnAssistantMessages: boolean;
|
|
126
|
+
requiresNonEmptyUserOrAssistantMessage: boolean;
|
|
127
|
+
};
|
|
128
|
+
type DetectedOpenAICompletionsCompat = {
|
|
129
|
+
capabilities: ProviderRequestCapabilities;
|
|
130
|
+
defaults: OpenAICompletionsCompatDefaults;
|
|
131
|
+
};
|
|
132
|
+
/** Detects endpoint capabilities and defaults for an OpenAI-completions model. */
|
|
133
|
+
declare function detectOpenAICompletionsCompat(model: Pick<Model<"openai-completions">, "provider" | "baseUrl" | "id"> & {
|
|
134
|
+
compat?: {
|
|
135
|
+
supportsStore?: boolean;
|
|
136
|
+
} | null;
|
|
137
|
+
}, resolveCapabilities?: (input: AiProviderRequestPolicyInput) => ProviderRequestCapabilities): DetectedOpenAICompletionsCompat;
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region packages/ai/src/transports/openai-completions-string-content.d.ts
|
|
140
|
+
/** Flatten string-only text block content arrays into newline-joined strings. */
|
|
141
|
+
declare function flattenCompletionMessagesToStringContent(messages: unknown[]): unknown[];
|
|
142
|
+
/** Strip completion messages to role/content fields for strict providers. */
|
|
143
|
+
declare function stripCompletionMessagesToRoleContent(messages: unknown[]): unknown[];
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region packages/ai/src/transports/openai-transport-shared.d.ts
|
|
146
|
+
declare const GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP = "skip_thought_signature_validator";
|
|
147
|
+
declare const log: {
|
|
148
|
+
debug(message: string, data?: Record<string, unknown>): void;
|
|
149
|
+
info(message: string, data?: Record<string, unknown>): void;
|
|
150
|
+
warn(message: string, data?: Record<string, unknown>): void;
|
|
151
|
+
};
|
|
152
|
+
type BaseOpenAIStreamOptions = {
|
|
153
|
+
temperature?: number;
|
|
154
|
+
topP?: number;
|
|
155
|
+
maxTokens?: number;
|
|
156
|
+
stop?: string[];
|
|
157
|
+
signal?: AbortSignal;
|
|
158
|
+
apiKey?: string;
|
|
159
|
+
cacheRetention?: "none" | "short" | "long";
|
|
160
|
+
sessionId?: string;
|
|
161
|
+
promptCacheKey?: string;
|
|
162
|
+
authProfileId?: string;
|
|
163
|
+
onPayload?: (payload: unknown, model: Model) => unknown;
|
|
164
|
+
headers?: Record<string, string>;
|
|
165
|
+
firstEventTimeoutMs?: number;
|
|
166
|
+
onFirstEventTimeout?: (reason: Error) => void;
|
|
167
|
+
openclawCodeModeToolSurface?: boolean;
|
|
168
|
+
responseFormat?: Record<string, unknown>;
|
|
169
|
+
frequencyPenalty?: number;
|
|
170
|
+
presencePenalty?: number;
|
|
171
|
+
seed?: number;
|
|
172
|
+
};
|
|
173
|
+
type OpenAICompletionsOptions = BaseOpenAIStreamOptions & {
|
|
174
|
+
toolChoice?: OpenAICompletionsToolChoice;
|
|
175
|
+
reasoning?: OpenAIReasoningEffort;
|
|
176
|
+
reasoningEffort?: OpenAIReasoningEffort;
|
|
177
|
+
};
|
|
178
|
+
type OpenAIModeCompatInput = Omit<OpenAICompletionsCompat, "thinkingFormat"> & {
|
|
179
|
+
thinkingFormat?: string;
|
|
180
|
+
requiresStringContent?: boolean;
|
|
181
|
+
strictMessageKeys?: boolean;
|
|
182
|
+
unsupportedToolSchemaKeywords?: unknown;
|
|
183
|
+
omitEmptyArrayItems?: unknown;
|
|
184
|
+
visibleReasoningDetailTypes?: string[];
|
|
185
|
+
};
|
|
186
|
+
type OpenAIModeModel = Omit<Model, "compat"> & {
|
|
187
|
+
compat?: OpenAIModeCompatInput | null;
|
|
188
|
+
};
|
|
189
|
+
type MutableAssistantOutput = {
|
|
190
|
+
role: "assistant";
|
|
191
|
+
content: Array<Record<string, unknown>>;
|
|
192
|
+
api: Api;
|
|
193
|
+
provider: string;
|
|
194
|
+
model: string;
|
|
195
|
+
usage: {
|
|
196
|
+
input: number;
|
|
197
|
+
output: number;
|
|
198
|
+
cacheRead: number;
|
|
199
|
+
cacheWrite: number;
|
|
200
|
+
reasoningTokens?: number;
|
|
201
|
+
totalTokens: number;
|
|
202
|
+
cost: Usage["cost"];
|
|
203
|
+
};
|
|
204
|
+
stopReason: string;
|
|
205
|
+
timestamp: number;
|
|
206
|
+
responseId?: string;
|
|
207
|
+
errorMessage?: string;
|
|
208
|
+
errorCode?: string;
|
|
209
|
+
errorType?: string;
|
|
210
|
+
errorBody?: string;
|
|
211
|
+
};
|
|
212
|
+
type ModelStreamCooperativeScheduler = {
|
|
213
|
+
afterEvent: () => Promise<void>;
|
|
214
|
+
};
|
|
215
|
+
declare function throwIfModelStreamAborted(signal?: AbortSignal): void;
|
|
216
|
+
declare function createModelStreamCooperativeScheduler(signal?: AbortSignal): ModelStreamCooperativeScheduler;
|
|
217
|
+
declare function resolveCacheRetention(cacheRetention: string | undefined): "short" | "long" | "none";
|
|
218
|
+
declare function resolvePromptCacheKey(options: Pick<BaseOpenAIStreamOptions, "promptCacheKey" | "sessionId"> | undefined, cacheRetention: "short" | "long" | "none"): string | undefined;
|
|
219
|
+
declare function sortTransportToolsByName<T extends {
|
|
220
|
+
name?: string;
|
|
221
|
+
description?: string;
|
|
222
|
+
}>(tools: readonly T[]): T[];
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region packages/ai/src/transports/openai-transport-params.d.ts
|
|
225
|
+
declare function enforceCodeModeResponsesToolSurface(payload: unknown): void;
|
|
226
|
+
declare function assertCodeModeResponsesToolSurface(payload: unknown): void;
|
|
227
|
+
declare function resolveOpenAIStrictToolFlagWithDiagnostics(projection: OpenAIToolProjection, strictSetting: boolean | null | undefined, context: {
|
|
228
|
+
transport: "responses" | "completions";
|
|
229
|
+
model: OpenAIModeModel;
|
|
230
|
+
}): boolean | undefined;
|
|
231
|
+
declare function isOpenAICodexResponsesModel(model: Model): boolean;
|
|
232
|
+
declare function usesNativeOpenAICodexResponsesBackend(model: Model): boolean;
|
|
233
|
+
declare function buildOpenAIClientHeaders(model: Model, context: Context, optionHeaders?: Record<string, string>, turnHeaders?: Record<string, string>, sessionId?: string): Record<string, string>;
|
|
234
|
+
declare function buildOpenAISdkClientOptions(model: Model): {
|
|
235
|
+
timeout?: number;
|
|
236
|
+
};
|
|
237
|
+
declare function buildOpenAISdkRequestOptions(model: Model, signal?: AbortSignal, options?: {
|
|
238
|
+
stream?: boolean;
|
|
239
|
+
}): {
|
|
240
|
+
signal?: AbortSignal;
|
|
241
|
+
timeout?: number;
|
|
242
|
+
headers?: Record<string, string>;
|
|
243
|
+
} | undefined;
|
|
244
|
+
declare function getCompat(model: OpenAIModeModel): {
|
|
245
|
+
supportsStore: boolean;
|
|
246
|
+
supportsDeveloperRole: boolean;
|
|
247
|
+
supportsReasoningEffort: boolean;
|
|
248
|
+
reasoningEffortMap: Record<string, string>;
|
|
249
|
+
supportsUsageInStreaming: boolean;
|
|
250
|
+
maxTokensField: string;
|
|
251
|
+
requiresToolResultName: boolean;
|
|
252
|
+
requiresAssistantAfterToolResult: boolean;
|
|
253
|
+
requiresThinkingAsText: boolean;
|
|
254
|
+
thinkingFormat: string;
|
|
255
|
+
openRouterRouting: Record<string, unknown>;
|
|
256
|
+
vercelGatewayRouting: {};
|
|
257
|
+
supportsStrictMode: boolean;
|
|
258
|
+
supportsPromptCacheKey: boolean;
|
|
259
|
+
supportsLongCacheRetention: boolean;
|
|
260
|
+
requiresStringContent: boolean;
|
|
261
|
+
strictMessageKeys: boolean;
|
|
262
|
+
visibleReasoningDetailTypes: string[];
|
|
263
|
+
requiresReasoningContentOnAssistantMessages: boolean;
|
|
264
|
+
requiresNonEmptyUserOrAssistantMessage: boolean;
|
|
265
|
+
};
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region packages/ai/src/transports/openai-completions-transport.d.ts
|
|
268
|
+
declare function createSseDoneDetector(): {
|
|
269
|
+
observe(chunk: Uint8Array): void;
|
|
270
|
+
finish(): void;
|
|
271
|
+
sawDone: () => boolean;
|
|
272
|
+
};
|
|
273
|
+
declare function createOpenAICompletionsClient(model: Model, context: Context, apiKey: string, optionHeaders?: Record<string, string>, opts?: {
|
|
274
|
+
fetch?: typeof globalThis.fetch;
|
|
275
|
+
}): OpenAI;
|
|
276
|
+
declare function buildOpenAICompletionsClientConfig(model: Model, context: Context, optionHeaders?: Record<string, string>): {
|
|
277
|
+
baseURL: string;
|
|
278
|
+
defaultHeaders: Record<string, string>;
|
|
279
|
+
defaultQuery?: Record<string, string>;
|
|
280
|
+
};
|
|
281
|
+
declare function createOpenAICompletionsTransportStreamFn(): StreamFn;
|
|
282
|
+
declare function processOpenAICompletionsStream(responseStream: AsyncIterable<ChatCompletionChunk>, output: MutableAssistantOutput, model: Model, stream: {
|
|
283
|
+
push(event: unknown): void;
|
|
284
|
+
}, options?: {
|
|
285
|
+
signal?: AbortSignal;
|
|
286
|
+
emitReasoning?: boolean;
|
|
287
|
+
firstEventTimeoutMs?: number;
|
|
288
|
+
abortFirstEventStream?: (reason: Error) => void;
|
|
289
|
+
onFirstEventTimeout?: (reason: Error) => void;
|
|
290
|
+
sawStreamDONE?: () => boolean;
|
|
291
|
+
}): Promise<void>;
|
|
292
|
+
declare function shouldEmitOpenAICompletionsReasoningForModel(model: OpenAIModeModel, options: OpenAICompletionsOptions | undefined): boolean;
|
|
293
|
+
declare function buildOpenAICompletionsParams(model: OpenAIModeModel, context: Context, options: OpenAICompletionsOptions | undefined): Record<string, unknown>;
|
|
294
|
+
declare function parseTransportChunkUsage(rawUsage: NonNullable<ChatCompletionChunk["usage"]> & {
|
|
295
|
+
cost?: unknown;
|
|
296
|
+
prompt_tokens_details?: {
|
|
297
|
+
cache_write_tokens?: number | null;
|
|
298
|
+
};
|
|
299
|
+
}, model: Model): MutableAssistantOutput["usage"];
|
|
300
|
+
declare const completionsTesting: {
|
|
301
|
+
getCompat: typeof getCompat;
|
|
302
|
+
createSseDoneDetector: typeof createSseDoneDetector;
|
|
303
|
+
createOpenAICompletionsClient: typeof createOpenAICompletionsClient;
|
|
304
|
+
buildOpenAICompletionsClientConfig: typeof buildOpenAICompletionsClientConfig;
|
|
305
|
+
parseTransportChunkUsage: typeof parseTransportChunkUsage;
|
|
306
|
+
processOpenAICompletionsStream: typeof processOpenAICompletionsStream;
|
|
307
|
+
shouldEmitOpenAICompletionsReasoningForModel: typeof shouldEmitOpenAICompletionsReasoningForModel;
|
|
308
|
+
};
|
|
309
|
+
declare global {
|
|
310
|
+
var openclawOpenAICompletionsTransportTestApi: typeof completionsTesting | undefined;
|
|
311
|
+
}
|
|
312
|
+
//#endregion
|
|
313
|
+
//#region packages/ai/src/transports/openai-reasoning-compat.d.ts
|
|
314
|
+
/** Minimal model fields needed to resolve OpenAI reasoning effort compatibility. */
|
|
315
|
+
type OpenAIReasoningCompatModel = {
|
|
316
|
+
provider?: string | null;
|
|
317
|
+
id?: string | null;
|
|
318
|
+
compat?: unknown;
|
|
319
|
+
};
|
|
320
|
+
/** Resolves the reasoning effort remap for an OpenAI-compatible model. */
|
|
321
|
+
declare function resolveOpenAIReasoningEffortMap(model: OpenAIReasoningCompatModel, fallbackMap?: Record<string, string>): Record<string, string>;
|
|
322
|
+
//#endregion
|
|
323
|
+
//#region packages/ai/src/transports/openai-responses-payload-policy.d.ts
|
|
324
|
+
type OpenAIResponsesPayloadModel = {
|
|
325
|
+
api?: unknown;
|
|
326
|
+
baseUrl?: unknown;
|
|
327
|
+
id?: unknown;
|
|
328
|
+
provider?: unknown;
|
|
329
|
+
contextWindow?: unknown;
|
|
330
|
+
compat?: unknown;
|
|
331
|
+
};
|
|
332
|
+
type OpenAIResponsesPayloadPolicyOptions = {
|
|
333
|
+
extraParams?: Record<string, unknown>;
|
|
334
|
+
storeMode?: "provider-policy" | "disable" | "preserve";
|
|
335
|
+
enablePromptCacheStripping?: boolean;
|
|
336
|
+
enableServerCompaction?: boolean;
|
|
337
|
+
};
|
|
338
|
+
type OpenAIResponsesPayloadPolicy = {
|
|
339
|
+
allowsServiceTier: boolean;
|
|
340
|
+
compactThreshold: number;
|
|
341
|
+
explicitStore: boolean | undefined;
|
|
342
|
+
shouldStripDisabledReasoningPayload: boolean;
|
|
343
|
+
shouldStripInputStatus: boolean;
|
|
344
|
+
shouldStripPromptCache: boolean;
|
|
345
|
+
shouldStripStore: boolean;
|
|
346
|
+
useServerCompaction: boolean;
|
|
347
|
+
};
|
|
348
|
+
/** Resolve payload mutation policy for one OpenAI Responses-style model endpoint. */
|
|
349
|
+
declare function resolveOpenAIResponsesPayloadPolicy(model: OpenAIResponsesPayloadModel, options?: OpenAIResponsesPayloadPolicyOptions): OpenAIResponsesPayloadPolicy;
|
|
350
|
+
/** Mutate a Responses request payload according to the resolved endpoint policy. */
|
|
351
|
+
declare function applyOpenAIResponsesPayloadPolicy(payloadObj: Record<string, unknown>, policy: OpenAIResponsesPayloadPolicy): void;
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region packages/ai/src/transports/openai-responses-replay.d.ts
|
|
354
|
+
/** Resolves the assistant message id that can be replayed to OpenAI Responses. */
|
|
355
|
+
declare function resolveReplayableResponsesMessageId(params: {
|
|
356
|
+
replayResponsesItemIds: boolean;
|
|
357
|
+
textSignatureId?: string;
|
|
358
|
+
fallbackId: string;
|
|
359
|
+
fallbackOrdinal: number;
|
|
360
|
+
previousReplayItemWasReasoning: boolean;
|
|
361
|
+
}): string | undefined;
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region packages/ai/src/transports/openai-responses-transport.d.ts
|
|
364
|
+
declare const OPENAI_RESPONSES_REASONING_REPLAY_META_KEY = "__openclaw_replay";
|
|
365
|
+
type OpenAIResponsesReasoningReplayMetadata = {
|
|
366
|
+
v: 1;
|
|
367
|
+
source: "openai-responses";
|
|
368
|
+
provider: string;
|
|
369
|
+
api: Api;
|
|
370
|
+
model: string;
|
|
371
|
+
baseUrlHash?: string;
|
|
372
|
+
sessionHash?: string;
|
|
373
|
+
authProfileHash?: string;
|
|
374
|
+
};
|
|
375
|
+
type ReplayableResponseReasoningItem = Omit<ResponseReasoningItem, "id"> & {
|
|
376
|
+
id?: string;
|
|
377
|
+
[OPENAI_RESPONSES_REASONING_REPLAY_META_KEY]?: OpenAIResponsesReasoningReplayMetadata;
|
|
378
|
+
};
|
|
379
|
+
type ResponsesClientLike = ReturnType<typeof createOpenAIResponsesClient>;
|
|
380
|
+
type OpenAIResponsesOptions = BaseOpenAIStreamOptions & {
|
|
381
|
+
reasoning?: OpenAIReasoningEffort;
|
|
382
|
+
reasoningEffort?: OpenAIReasoningEffort;
|
|
383
|
+
reasoningSummary?: "auto" | "detailed" | "concise" | null;
|
|
384
|
+
replayResponsesItemIds?: boolean;
|
|
385
|
+
serviceTier?: ResponseCreateParamsStreaming["service_tier"];
|
|
386
|
+
toolChoice?: ResponseCreateParamsStreaming["tool_choice"];
|
|
387
|
+
};
|
|
388
|
+
type OpenAIResponsesReplayContext = {
|
|
389
|
+
provider: string;
|
|
390
|
+
api: Api;
|
|
391
|
+
model: string;
|
|
392
|
+
baseUrlHash?: string;
|
|
393
|
+
sessionHash?: string;
|
|
394
|
+
authProfileHash?: string;
|
|
395
|
+
};
|
|
396
|
+
declare function summarizeResponsesTools(tools: unknown): string;
|
|
397
|
+
declare function stringifyRedactedPayload(value: unknown): string;
|
|
398
|
+
declare function stringifyRedactedEvent(value: unknown): string;
|
|
399
|
+
type ResponsesFailedNoDetailsObservation = {
|
|
400
|
+
event: "openai_responses_response_failed_without_details";
|
|
401
|
+
provider: string;
|
|
402
|
+
api: Api;
|
|
403
|
+
transportModel: string;
|
|
404
|
+
providerRuntimeFailureKind: "no_error_details";
|
|
405
|
+
responseId: string;
|
|
406
|
+
responseStatus: string;
|
|
407
|
+
responseModel: string;
|
|
408
|
+
responseObject: string;
|
|
409
|
+
metadataKeys: string[];
|
|
410
|
+
requestIdHashes: string[];
|
|
411
|
+
failureFieldsPreview: string;
|
|
412
|
+
responsePreview: string;
|
|
413
|
+
};
|
|
414
|
+
type ResponsesFailedEventSummary = {
|
|
415
|
+
message: string;
|
|
416
|
+
responseId?: string;
|
|
417
|
+
observation?: ResponsesFailedNoDetailsObservation;
|
|
418
|
+
};
|
|
419
|
+
declare function buildResponsesFailedNoDetailsObservation(event: Record<string, unknown>, model: Model, response?: Record<string, unknown> | undefined): ResponsesFailedNoDetailsObservation;
|
|
420
|
+
declare function summarizeResponsesFailedNoDetailsObservation(observation: ResponsesFailedNoDetailsObservation): string;
|
|
421
|
+
declare function normalizeResponsesFailedEvent(event: Record<string, unknown>, model: Model): ResponsesFailedEventSummary;
|
|
422
|
+
declare function summarizeResponsesPayload(params: unknown): string;
|
|
423
|
+
declare function isInvalidEncryptedContentError(error: unknown): boolean;
|
|
424
|
+
declare function stripResponsesRequestEncryptedContent(params: OpenAIResponsesRequestParams): OpenAIResponsesRequestParams;
|
|
425
|
+
declare function buildOpenAIResponsesReasoningReplayMetadata(model: Model, options?: Pick<BaseOpenAIStreamOptions, "authProfileId" | "sessionId">): OpenAIResponsesReasoningReplayMetadata;
|
|
426
|
+
declare function tagOpenAIResponsesReasoningReplayItem(item: Record<string, unknown>, model: Model, options?: Pick<BaseOpenAIStreamOptions, "authProfileId" | "sessionId">): Record<string, unknown>;
|
|
427
|
+
declare function prepareOpenAIResponsesReasoningItemForReplay(item: ReplayableResponseReasoningItem, context: OpenAIResponsesReplayContext, blockMetadata?: OpenAIResponsesReasoningReplayMetadata): ReplayableResponseReasoningItem;
|
|
428
|
+
declare function createResponsesStreamWithEncryptedContentRetry(params: {
|
|
429
|
+
client: ResponsesClientLike;
|
|
430
|
+
request: OpenAIResponsesRequestParams;
|
|
431
|
+
requestOptions: unknown;
|
|
432
|
+
model: Model;
|
|
433
|
+
}): Promise<AsyncIterable<unknown>>;
|
|
434
|
+
declare function resolveAzureOpenAIApiVersion(env?: NodeJS.ProcessEnv): string;
|
|
435
|
+
declare function processResponsesStream(openaiStream: AsyncIterable<unknown>, output: MutableAssistantOutput, stream: {
|
|
436
|
+
push(event: unknown): void;
|
|
437
|
+
}, model: Model, options?: {
|
|
438
|
+
serviceTier?: ResponseCreateParamsStreaming["service_tier"];
|
|
439
|
+
applyServiceTierPricing?: (usage: MutableAssistantOutput["usage"], serviceTier?: ResponseCreateParamsStreaming["service_tier"]) => void;
|
|
440
|
+
firstEventTimeoutMs?: number;
|
|
441
|
+
abortFirstEventStream?: (reason: Error) => void;
|
|
442
|
+
onFirstEventTimeout?: (reason: Error) => void;
|
|
443
|
+
signal?: AbortSignal;
|
|
444
|
+
sessionId?: string;
|
|
445
|
+
authProfileId?: string;
|
|
446
|
+
}): Promise<void>;
|
|
447
|
+
declare function createOpenAIResponsesClient(model: Model, context: Context, apiKey: string, optionHeaders?: Record<string, string>, turnHeaders?: Record<string, string>, sessionId?: string): OpenAI;
|
|
448
|
+
declare function createOpenAIResponsesTransportStreamFn(): StreamFn;
|
|
449
|
+
declare function sanitizeOpenAICodexResponsesParams<T extends Record<string, unknown>>(model: Model, params: T): T;
|
|
450
|
+
declare function buildOpenAIResponsesParams(model: Model, context: Context, options: OpenAIResponsesOptions | undefined, metadata?: Record<string, string>): OpenAIResponsesRequestParams;
|
|
451
|
+
declare function createAzureOpenAIResponsesTransportStreamFn(): StreamFn;
|
|
452
|
+
declare function createAzureOpenAIClient(model: Model, context: Context, apiKey: string, optionHeaders?: Record<string, string>, turnHeaders?: Record<string, string>): OpenAI;
|
|
453
|
+
type OpenAIResponsesRequestParams = {
|
|
454
|
+
model: string;
|
|
455
|
+
input: ResponseInput;
|
|
456
|
+
stream: true;
|
|
457
|
+
instructions?: string;
|
|
458
|
+
prompt_cache_key?: string;
|
|
459
|
+
prompt_cache_retention?: "24h";
|
|
460
|
+
metadata?: Record<string, string>;
|
|
461
|
+
store?: boolean;
|
|
462
|
+
max_output_tokens?: number;
|
|
463
|
+
temperature?: number;
|
|
464
|
+
top_p?: number;
|
|
465
|
+
text?: ResponseCreateParamsStreaming["text"];
|
|
466
|
+
service_tier?: ResponseCreateParamsStreaming["service_tier"];
|
|
467
|
+
tools?: FunctionTool[];
|
|
468
|
+
tool_choice?: ResponseCreateParamsStreaming["tool_choice"];
|
|
469
|
+
reasoning?: {
|
|
470
|
+
effort: OpenAIApiReasoningEffort;
|
|
471
|
+
} | {
|
|
472
|
+
effort: OpenAIApiReasoningEffort;
|
|
473
|
+
summary: NonNullable<OpenAIResponsesOptions["reasoningSummary"]>;
|
|
474
|
+
};
|
|
475
|
+
include?: string[];
|
|
476
|
+
};
|
|
477
|
+
declare const responsesTesting: {
|
|
478
|
+
getCompat: typeof getCompat;
|
|
479
|
+
assertCodeModeResponsesToolSurface: typeof assertCodeModeResponsesToolSurface;
|
|
480
|
+
buildOpenAIResponsesParams: typeof buildOpenAIResponsesParams;
|
|
481
|
+
buildOpenAIClientHeaders: typeof buildOpenAIClientHeaders;
|
|
482
|
+
buildOpenAISdkClientOptions: typeof buildOpenAISdkClientOptions;
|
|
483
|
+
buildOpenAISdkRequestOptions: typeof buildOpenAISdkRequestOptions;
|
|
484
|
+
createAzureOpenAIClient: typeof createAzureOpenAIClient;
|
|
485
|
+
createOpenAIResponsesClient: typeof createOpenAIResponsesClient;
|
|
486
|
+
enforceCodeModeResponsesToolSurface: typeof enforceCodeModeResponsesToolSurface;
|
|
487
|
+
sanitizeOpenAICodexResponsesParams: typeof sanitizeOpenAICodexResponsesParams;
|
|
488
|
+
processResponsesStream: typeof processResponsesStream;
|
|
489
|
+
formatModelTransportDebugBaseUrl: typeof formatModelTransportDebugBaseUrl;
|
|
490
|
+
buildResponsesFailedNoDetailsObservation: typeof buildResponsesFailedNoDetailsObservation;
|
|
491
|
+
buildOpenAIResponsesReasoningReplayMetadata: typeof buildOpenAIResponsesReasoningReplayMetadata;
|
|
492
|
+
isInvalidEncryptedContentError: typeof isInvalidEncryptedContentError;
|
|
493
|
+
normalizeResponsesFailedEvent: typeof normalizeResponsesFailedEvent;
|
|
494
|
+
prepareOpenAIResponsesReasoningItemForReplay: typeof prepareOpenAIResponsesReasoningItemForReplay;
|
|
495
|
+
createResponsesStreamWithEncryptedContentRetry: typeof createResponsesStreamWithEncryptedContentRetry;
|
|
496
|
+
resolveAzureOpenAIApiVersion: typeof resolveAzureOpenAIApiVersion;
|
|
497
|
+
stripResponsesRequestEncryptedContent: typeof stripResponsesRequestEncryptedContent;
|
|
498
|
+
tagOpenAIResponsesReasoningReplayItem: typeof tagOpenAIResponsesReasoningReplayItem;
|
|
499
|
+
summarizeResponsesFailedNoDetailsObservation: typeof summarizeResponsesFailedNoDetailsObservation;
|
|
500
|
+
summarizeResponsesPayload: typeof summarizeResponsesPayload;
|
|
501
|
+
summarizeResponsesTools: typeof summarizeResponsesTools;
|
|
502
|
+
stringifyRedactedEvent: typeof stringifyRedactedEvent;
|
|
503
|
+
stringifyRedactedPayload: typeof stringifyRedactedPayload;
|
|
504
|
+
};
|
|
505
|
+
declare global {
|
|
506
|
+
var openclawOpenAIResponsesTransportTestApi: typeof responsesTesting | undefined;
|
|
507
|
+
}
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region packages/ai/src/transports/provider-transport-stream.d.ts
|
|
510
|
+
type ProviderTransportStreamContext = {
|
|
511
|
+
cfg?: unknown;
|
|
512
|
+
agentDir?: string;
|
|
513
|
+
workspaceDir?: string;
|
|
514
|
+
env?: NodeJS.ProcessEnv;
|
|
515
|
+
};
|
|
516
|
+
/** Maps public model APIs to the internal transport API id used by simple runtime dispatch. */
|
|
517
|
+
declare function resolveTransportAwareSimpleApi(api: Api): Api | undefined;
|
|
518
|
+
/** Creates a managed transport stream only when request overrides require it. */
|
|
519
|
+
declare function createTransportAwareStreamFnForModel(model: Model, ctx?: ProviderTransportStreamContext): StreamFn | undefined;
|
|
520
|
+
/** Creates a managed OpenClaw transport stream for explicit fallback/runtime callers. */
|
|
521
|
+
declare function createOpenClawTransportStreamFnForModel(model: Model, ctx?: ProviderTransportStreamContext): StreamFn | undefined;
|
|
522
|
+
declare function createBoundaryAwareStreamFnForModel(model: Model, ctx?: ProviderTransportStreamContext): StreamFn | undefined;
|
|
523
|
+
declare function prepareTransportAwareSimpleModel<TApi extends Api>(model: Model<TApi>, ctx?: ProviderTransportStreamContext): Model;
|
|
524
|
+
declare function buildTransportAwareSimpleStreamFn(model: Model, ctx?: ProviderTransportStreamContext): StreamFn | undefined;
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region packages/ai/src/transports/responses-image-payload-sanitizer.d.ts
|
|
527
|
+
/** Sanitize inline image fields inside a Responses API payload. */
|
|
528
|
+
declare function sanitizeResponsesImagePayload<T extends Record<string, unknown>>(params: T): T;
|
|
529
|
+
//#endregion
|
|
530
|
+
//#region packages/ai/src/transports/simple-completion-transport.d.ts
|
|
531
|
+
declare function normalizeCodexResponsesBaseUrlForOpenAISdk(baseUrl?: string): string;
|
|
532
|
+
declare function prepareModelForSimpleCompletion<TApi extends Api>(params: {
|
|
533
|
+
apiRegistry: ApiRegistry;
|
|
534
|
+
model: Model<TApi>;
|
|
535
|
+
cfg?: unknown;
|
|
536
|
+
}): Model;
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region packages/ai/src/transports/transport-stream-shared.d.ts
|
|
539
|
+
type ContextUsage = NonNullable<Usage["contextUsage"]>;
|
|
540
|
+
type TransportUsage = {
|
|
541
|
+
input: number;
|
|
542
|
+
output: number;
|
|
543
|
+
cacheRead: number;
|
|
544
|
+
cacheWrite: number;
|
|
545
|
+
contextUsage?: ContextUsage;
|
|
546
|
+
totalTokens: number;
|
|
547
|
+
cost: {
|
|
548
|
+
input: number;
|
|
549
|
+
output: number;
|
|
550
|
+
cacheRead: number;
|
|
551
|
+
cacheWrite: number;
|
|
552
|
+
total: number;
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
type WritableTransportStream = {
|
|
556
|
+
push(event: unknown): void;
|
|
557
|
+
end(): void;
|
|
558
|
+
};
|
|
559
|
+
type TransportOutputShape = {
|
|
560
|
+
stopReason: string;
|
|
561
|
+
errorMessage?: string;
|
|
562
|
+
errorCode?: string;
|
|
563
|
+
errorType?: string;
|
|
564
|
+
errorBody?: string;
|
|
565
|
+
};
|
|
566
|
+
declare function sanitizeTransportPayloadText(text: string): string;
|
|
567
|
+
declare function sanitizeNonEmptyTransportPayloadText(text: string, fallback?: string): string;
|
|
568
|
+
declare function coerceTransportToolCallArguments(argumentsValue: unknown): Record<string, unknown>;
|
|
569
|
+
declare function mergeTransportHeaders(...headerSources: Array<Record<string, string> | undefined>): Record<string, string> | undefined;
|
|
570
|
+
declare function mergeTransportMetadata<T extends Record<string, unknown>>(payload: T, metadata?: Record<string, string>): T;
|
|
571
|
+
declare function createEmptyTransportUsage(): TransportUsage;
|
|
572
|
+
declare function createWritableTransportEventStream(): {
|
|
573
|
+
eventStream: AssistantMessageEventStream;
|
|
574
|
+
stream: WritableTransportStream;
|
|
575
|
+
};
|
|
576
|
+
declare function finalizeTransportStream(params: {
|
|
577
|
+
stream: WritableTransportStream;
|
|
578
|
+
output: TransportOutputShape;
|
|
579
|
+
signal?: AbortSignal;
|
|
580
|
+
}): void;
|
|
581
|
+
declare function assignTransportErrorDetails(output: TransportOutputShape, error: unknown, signal?: AbortSignal): void;
|
|
582
|
+
declare function failTransportStream(params: {
|
|
583
|
+
stream: WritableTransportStream;
|
|
584
|
+
output: TransportOutputShape;
|
|
585
|
+
signal?: AbortSignal;
|
|
586
|
+
error: unknown;
|
|
587
|
+
cleanup?: () => void;
|
|
588
|
+
}): void;
|
|
589
|
+
//#endregion
|
|
590
|
+
export { BaseOpenAIStreamOptions, GEMINI_THOUGHT_SIGNATURE_VALIDATOR_SKIP, MutableAssistantOutput, OpenAICompletionsOptions, OpenAIModeModel, WritableTransportStream, applyAnthropicEphemeralCacheControlMarkers, applyAnthropicPayloadPolicyToParams, applyOpenAIResponsesPayloadPolicy, assertCodeModeResponsesToolSurface, assignTransportErrorDetails, buildOpenAIClientHeaders, buildOpenAICompletionsParams, buildOpenAISdkClientOptions, buildOpenAISdkRequestOptions, buildTransportAwareSimpleStreamFn, canonicalizeMaxTokensParam, coerceTransportToolCallArguments, createAnthropicMessagesTransportStreamFn, createAzureOpenAIResponsesTransportStreamFn, createBoundaryAwareStreamFnForModel, createDeepSeekTextFilter, createEmptyTransportUsage, createModelStreamCooperativeScheduler, createOpenAICompletionsTransportStreamFn, createOpenAIResponsesTransportStreamFn, createOpenClawTransportStreamFnForModel, createTransportAwareStreamFnForModel, createWritableTransportEventStream, detectOpenAICompletionsCompat, emitModelTransportDebug, enforceCodeModeResponsesToolSurface, failTransportStream, finalizeTransportStream, flattenCompletionMessagesToStringContent, formatModelTransportDebugBaseUrl, formatModelTransportDebugUrl, getCompat, hasOpenAICompatibleConversationTurn, isOpenAICodexResponsesModel, log, mergeTransportHeaders, mergeTransportMetadata, normalizeCodexResponsesBaseUrlForOpenAISdk, parseJsonObjectPreservingUnsafeIntegers, parseJsonPreservingUnsafeIntegers, prepareModelForSimpleCompletion, prepareTransportAwareSimpleModel, quoteUnsafeIntegerLiterals, resolveAnthropicEphemeralCacheControl, resolveAnthropicMessagesUrl, resolveAnthropicPayloadPolicy, resolveCacheRetention, resolveMaxTokensParam, resolveModelPayloadDebugMode, resolveModelSseDebugMode, resolveOpenAIReasoningEffortMap, resolveOpenAIResponsesPayloadPolicy, resolveOpenAIStrictToolFlagWithDiagnostics, resolvePromptCacheKey, resolveReplayableResponsesMessageId, resolveTransportAwareSimpleApi, sanitizeNonEmptyTransportPayloadText, sanitizeResponsesImagePayload, sanitizeTransportPayloadText, sortTransportToolsByName, stripCompletionMessagesToRoleContent, throwIfModelStreamAborted, usesNativeOpenAICodexResponsesBackend };
|