@openclaw/ai 2026.9.2 → 2026.9.3
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 +3 -2
- package/dist/anthropic-CZy5U0NY.mjs +376 -0
- package/dist/{anthropic-payload-policy-d46X2pR0.d.mts → anthropic-payload-policy-wuRCb6MH.d.mts} +16 -6
- package/dist/{anthropic-compaction-replay-DB2FGLQc.mjs → anthropic-stream-reducer-B_yo_7pf.mjs} +923 -181
- package/dist/{api-registry-DWtPjzyn.d.mts → api-registry-CB1-1oQ2.d.mts} +2 -2
- package/dist/assistant-output-iqnlJCV2.mjs +16 -0
- package/dist/assistant-text-phase-C20rxWwP.mjs +55 -0
- package/dist/{azure-openai-responses-C5bZRfAP.mjs → azure-openai-responses-Crpa40QR.mjs} +5 -5
- package/dist/{base64-CEFBpSkN.mjs → base64-D-su8YVo.mjs} +1 -27
- package/dist/{diagnostics-DfFyKeX_.mjs → diagnostics-dV98PqIy.mjs} +96 -21
- package/dist/diagnostics.d.mts +3 -1
- package/dist/diagnostics.mjs +3 -3
- package/dist/{event-stream-BhT5T1Ay.d.mts → event-stream-C1Z2piyk.d.mts} +11 -3
- package/dist/{event-stream-BgDvQeum.mjs → event-stream-D8PARQfL.mjs} +45 -1
- package/dist/event-stream-I_GlBsuZ.d.mts +1 -0
- package/dist/event-stream.d.mts +2 -2
- package/dist/event-stream.mjs +1 -1
- package/dist/{github-copilot-headers-NCJtz9i0.mjs → github-copilot-headers-B37TB3rB.mjs} +3 -10
- package/dist/github-copilot-request-facts-BTEBMeOv.mjs +16 -0
- package/dist/{google-4qeuE8iX.mjs → google-BDPriaVe.mjs} +10 -10
- package/dist/google-messages-CVn9eFpF.mjs +449 -0
- package/dist/google-shared-BedY23XS.mjs +185 -0
- package/dist/{google-vertex-O9BcnB6X.mjs → google-vertex-DMz8XQCn.mjs} +7 -6
- package/dist/{host-CEvLw30U.mjs → host-CWuF-sS3.mjs} +44 -39
- package/dist/{host-DjzGmdZ2.d.mts → host-DK3wmS3e.d.mts} +3 -3
- package/dist/host-policy-CAopLRKA.mjs +37 -0
- package/dist/{index-FnHM2FcI.d.mts → index-CQ6LTHw8.d.mts} +3 -3
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/internal/anthropic.d.mts +7 -7
- package/dist/internal/anthropic.mjs +4 -4
- package/dist/internal/google-model-family.d.mts +5 -0
- package/dist/internal/google-model-family.mjs +15 -0
- package/dist/internal/openai-responses-payload-policy.d.mts +1 -1
- package/dist/internal/openai-responses-payload-policy.mjs +1 -1
- package/dist/internal/openai.d.mts +8 -103
- package/dist/internal/openai.mjs +10 -10
- package/dist/internal/retry-after.d.mts +2 -4
- package/dist/internal/retry-after.mjs +57 -8
- package/dist/internal/runtime.d.mts +7 -6
- package/dist/internal/runtime.mjs +8 -7
- package/dist/internal/shared.d.mts +14 -3
- package/dist/internal/shared.mjs +6 -4
- package/dist/internal/tool-schema.d.mts +63 -0
- package/dist/internal/tool-schema.mjs +3 -0
- package/dist/{json-parse-BuAJEbdW.mjs → json-parse-Dw_hnxsA.mjs} +1 -1
- package/dist/{mistral-Tb6oalqH.mjs → mistral--m-Jm6VZ.mjs} +13 -37
- package/dist/model-transport-url-DKocrEsb.d.mts +28 -0
- package/dist/{openai-chatgpt-responses-yUXjPNfu.mjs → openai-chatgpt-responses-nDZccFW-.mjs} +48 -38
- package/dist/openai-completions-KuoZyx0d.mjs +187 -0
- package/dist/{openai-completions-compat-CpjYUArk.d.mts → openai-completions-compat-CXn3T1we.d.mts} +26 -4
- package/dist/{openai-completions-stream-BsrBe3Gg.mjs → openai-completions-stream-BQk3SkLD.mjs} +622 -452
- package/dist/openai-prompt-cache-BI0rkM-5.mjs +220 -0
- package/dist/openai-prompt-cache-rrutvqxq.d.mts +16 -0
- package/dist/openai-provider-client-ha_WxTyj.mjs +24 -0
- package/dist/openai-reasoning-effort-BK7FbcLT.mjs +167 -0
- package/dist/{openai-responses-CCL41ALM.mjs → openai-responses-D99dOzKI.mjs} +14 -29
- package/dist/{openai-responses-compaction-window-BMVHFOtq.mjs → openai-responses-compaction-window-D5jbzCi3.mjs} +7 -170
- package/dist/{openai-responses-contracts-rF5DDRNS.d.mts → openai-responses-contracts-B55afwRo.d.mts} +3 -3
- package/dist/{openai-responses-prompt-observer-internal-D0bhBfgL.mjs → openai-responses-prompt-observer-internal-tApyTLVu.mjs} +3 -3
- package/dist/{openai-responses-shared-Bmma_3Qc.mjs → openai-responses-shared-ZyQEzS5i.mjs} +44 -115
- package/dist/openai-tool-projection-793cE3QX.d.mts +37 -0
- package/dist/{openai-tool-schema-_pTAJqKF.mjs → openai-tool-schema-CzjyYXun.mjs} +38 -556
- package/dist/openai-tool-schema-ynZBgqW-.d.mts +38 -0
- package/dist/openai-transport-params-DNasp2fU.mjs +674 -0
- package/dist/{provider-error-9TraxGvt.mjs → provider-error-C6TbKiey.mjs} +23 -6
- package/dist/{provider-options-Bcc_p-TU.d.mts → provider-options-BXr9Ec83.d.mts} +4 -39
- package/dist/{provider-transcript-transform-BaMbI1hr.mjs → provider-transcript-transform-pPmUIwKt.mjs} +1 -1
- package/dist/provider-types-CAV0Og3m.d.mts +29 -0
- package/dist/provider-types.d.mts +6 -31
- package/dist/providers.d.mts +2 -2
- package/dist/providers.mjs +11 -11
- package/dist/{reasoning-tag-text-partitioner-DLCNXki6.mjs → reasoning-tag-text-partitioner-BQBi4B9d.mjs} +19 -12
- package/dist/record-coerce-DwRYMj3t.mjs +32 -0
- package/dist/retry-after-CdCURCVg.d.mts +15 -0
- package/dist/{sanitize-unicode-D6xUvZaS.mjs → sanitize-unicode-Bb-v9meu.mjs} +1 -1
- package/dist/session-affinity-CCH7eYdB.mjs +20 -0
- package/dist/{simple-options-BjHCCh4v.mjs → simple-options-tcKOqnpF.mjs} +3 -3
- package/dist/{src-2qBGKg8O.mjs → src-B2Q_6G8V.mjs} +1 -1
- package/dist/{stream-first-event-timeout-DcNjoFQE.mjs → stream-first-event-timeout-2hfrquuz.mjs} +1 -1
- package/dist/string-coerce-fsri9iCu.mjs +34 -0
- package/dist/{string-normalization--fwJ4S2q.mjs → string-normalization-CmLIasuf.mjs} +1 -1
- package/dist/{tool-schema-json-projection-mJhXDcyz.mjs → tool-schema-json-projection-ClptDdAO.mjs} +2 -38
- package/dist/{transport-stream-shared-CZqMhfIw.mjs → transport-stream-shared-Cu3ZPhNW.mjs} +5 -5
- package/dist/{transport-stream-shared-xnaqxmbP.d.mts → transport-stream-shared-DOxpGJ-H.d.mts} +4 -4
- package/dist/transport-utils-CCooe-cr.mjs +121 -0
- package/dist/transports.d.mts +113 -41
- package/dist/transports.mjs +162 -1276
- package/dist/types-BADKjDBI.d.mts +1 -0
- package/dist/{types-CJ1-Ht7A.d.mts → types-Dy1q0CSu.d.mts} +72 -57
- package/dist/types.d.mts +5 -5
- package/dist/types.mjs +3 -3
- package/dist/utf16-slice-CvGodqok.mjs +29 -0
- package/dist/{validation-CJZtym2g.mjs → validation-BDzVDnTs.mjs} +9 -1
- package/dist/{validation-AKZBDGQd.d.mts → validation-CaFUZN9B.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/dist/validation.mjs +1 -1
- package/package.json +13 -3
- package/dist/anthropic-BDdqdVLK.mjs +0 -886
- package/dist/event-stream-zctLx0yr.d.mts +0 -1
- package/dist/google-shared-CWeG8RIl.mjs +0 -636
- package/dist/google-thinking-level-C-V3tecN.mjs +0 -9
- package/dist/openai-completions-BIUV3RDT.mjs +0 -403
- package/dist/openai-prompt-cache-CGnVB74a.mjs +0 -21
- package/dist/openai-prompt-cache-CNoIfHYC.d.mts +0 -16
- package/dist/transport-utils-7il795_9.mjs +0 -138
- package/dist/types-3Lnm-QSJ.d.mts +0 -1
- package/dist/utf16-slice-qz3nsy87.mjs +0 -84
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
+
import { t as AssistantMessageEventStream } from "./event-stream-D8PARQfL.mjs";
|
|
3
|
+
import { i as clampThinkingLevel } from "./sanitize-unicode-Bb-v9meu.mjs";
|
|
4
|
+
import { s as resolveOpenAICompletionsCompat } from "./openai-prompt-cache-BI0rkM-5.mjs";
|
|
5
|
+
import { t as resolveCacheRetention } from "./cache-retention-0x979a5V.mjs";
|
|
6
|
+
import { n as buildBaseOptions, o as reasoningTagTextPolicy } from "./simple-options-tcKOqnpF.mjs";
|
|
7
|
+
import { _ as createOpenAIProviderAcceptanceHook, y as isOpenAICompletionsThinkingEnabled } from "./openai-transport-params-DNasp2fU.mjs";
|
|
8
|
+
import { n as getEnvApiKey } from "./env-api-keys-bktO00EJ.mjs";
|
|
9
|
+
import { _ as transportAbortError, t as assignTransportErrorDetails, y as withProviderResponseHook } from "./transport-stream-shared-Cu3ZPhNW.mjs";
|
|
10
|
+
import { a as tagUnresolvedTextAsCommentary, t as clearPendingCommentaryText } from "./assistant-text-phase-C20rxWwP.mjs";
|
|
11
|
+
import { t as createAssistantOutput } from "./assistant-output-iqnlJCV2.mjs";
|
|
12
|
+
import { t as resolveOpencodeSessionHeaders } from "./session-affinity-CCH7eYdB.mjs";
|
|
13
|
+
import { a as convertMessages, i as buildOpenAICompletionsRequest, s as finalizeOpenAICompletionsToolCalls, t as processCompletionsStream } from "./openai-completions-stream-BQk3SkLD.mjs";
|
|
14
|
+
import { i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-2hfrquuz.mjs";
|
|
15
|
+
import { n as hasCopilotVisionInput, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-B37TB3rB.mjs";
|
|
16
|
+
import { t as createOpenAIProviderClient } from "./openai-provider-client-ha_WxTyj.mjs";
|
|
17
|
+
//#region packages/ai/src/providers/openai-completions.ts
|
|
18
|
+
var openai_completions_exports = /* @__PURE__ */ __exportAll({
|
|
19
|
+
convertMessages: () => convertMessages,
|
|
20
|
+
streamOpenAICompletions: () => streamOpenAICompletions,
|
|
21
|
+
streamSimpleOpenAICompletions: () => streamSimpleOpenAICompletions
|
|
22
|
+
});
|
|
23
|
+
const streamOpenAICompletions = (model, context, options) => {
|
|
24
|
+
const stream = new AssistantMessageEventStream();
|
|
25
|
+
(async () => {
|
|
26
|
+
const output = createAssistantOutput(model);
|
|
27
|
+
const provisionalCommentaryTags = /* @__PURE__ */ new Map();
|
|
28
|
+
let firstEventAbort;
|
|
29
|
+
try {
|
|
30
|
+
const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
|
|
31
|
+
const compat = resolveOpenAICompletionsCompat(model);
|
|
32
|
+
const shouldEmitReasoning = Boolean(model.reasoning && options?.reasoningEffort && isOpenAICompletionsThinkingEnabled(options.reasoningEffort));
|
|
33
|
+
const cacheRetention = resolveCacheRetention(options?.cacheRetention);
|
|
34
|
+
const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId;
|
|
35
|
+
const client = createClient(model, context, apiKey, resolveOpencodeSessionHeaders(model, options), cacheSessionId, compat);
|
|
36
|
+
let params = buildOpenAICompletionsRequest(model, context, options, {
|
|
37
|
+
mode: "direct",
|
|
38
|
+
compat,
|
|
39
|
+
cacheRetention
|
|
40
|
+
});
|
|
41
|
+
const nextParams = await options?.onPayload?.(params, model);
|
|
42
|
+
if (nextParams !== void 0) params = nextParams;
|
|
43
|
+
firstEventAbort = createFirstStreamEventAbortController(options?.signal);
|
|
44
|
+
const requestOptions = {
|
|
45
|
+
signal: firstEventAbort.signal,
|
|
46
|
+
...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
|
|
47
|
+
maxRetries: 0
|
|
48
|
+
};
|
|
49
|
+
const { data: openaiStream, response } = await client.chat.completions.create(params, requestOptions).withResponse();
|
|
50
|
+
const hookedOpenAIStream = withProviderResponseHook({
|
|
51
|
+
stream: openaiStream,
|
|
52
|
+
signal: firstEventAbort.signal,
|
|
53
|
+
abort: firstEventAbort.abort,
|
|
54
|
+
hook: createOpenAIProviderAcceptanceHook(options, response, model),
|
|
55
|
+
onReady: () => stream.push({
|
|
56
|
+
type: "start",
|
|
57
|
+
partial: output
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
const finishedBlocks = /* @__PURE__ */ new Set();
|
|
61
|
+
const contentIndices = /* @__PURE__ */ new WeakMap();
|
|
62
|
+
let openTextBlock;
|
|
63
|
+
let openThinkingBlock;
|
|
64
|
+
const finishBlock = (block) => {
|
|
65
|
+
const contentIndex = contentIndices.get(block);
|
|
66
|
+
if (contentIndex === void 0 || finishedBlocks.has(block)) return;
|
|
67
|
+
finishedBlocks.add(block);
|
|
68
|
+
if (block.type === "text") {
|
|
69
|
+
openTextBlock = void 0;
|
|
70
|
+
stream.push({
|
|
71
|
+
type: "text_end",
|
|
72
|
+
contentIndex,
|
|
73
|
+
content: block.text,
|
|
74
|
+
partial: output
|
|
75
|
+
});
|
|
76
|
+
} else if (block.type === "thinking") {
|
|
77
|
+
openThinkingBlock = void 0;
|
|
78
|
+
stream.push({
|
|
79
|
+
type: "thinking_end",
|
|
80
|
+
contentIndex,
|
|
81
|
+
content: block.thinking,
|
|
82
|
+
partial: output
|
|
83
|
+
});
|
|
84
|
+
} else if (block.type === "toolCall") stream.push({
|
|
85
|
+
type: "toolcall_end",
|
|
86
|
+
contentIndex,
|
|
87
|
+
toolCall: block,
|
|
88
|
+
partial: output
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
const directEventStream = { push(event) {
|
|
92
|
+
if (event.type === "text_start" || event.type === "thinking_start" || event.type === "toolcall_start") {
|
|
93
|
+
const block = output.content[event.contentIndex];
|
|
94
|
+
if (block) {
|
|
95
|
+
contentIndices.set(block, event.contentIndex);
|
|
96
|
+
if (block.type === "text") openTextBlock = block;
|
|
97
|
+
else if (block.type === "thinking") openThinkingBlock = block;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
stream.push(event);
|
|
101
|
+
} };
|
|
102
|
+
try {
|
|
103
|
+
await processCompletionsStream(hookedOpenAIStream, output, model, directEventStream, {
|
|
104
|
+
mode: "direct",
|
|
105
|
+
beforeContentBlock(nextType) {
|
|
106
|
+
if (openThinkingBlock) finishBlock(openThinkingBlock);
|
|
107
|
+
if (openTextBlock && nextType !== "toolCall") finishBlock(openTextBlock);
|
|
108
|
+
},
|
|
109
|
+
provisionalCommentaryTags,
|
|
110
|
+
signal: options?.signal,
|
|
111
|
+
emitReasoning: shouldEmitReasoning,
|
|
112
|
+
strictReasoningTags: reasoningTagTextPolicy.isStrict(options),
|
|
113
|
+
firstEventTimeoutMs: getFirstStreamEventTimeoutMs(options),
|
|
114
|
+
abortFirstEventStream: firstEventAbort.abort,
|
|
115
|
+
onFirstEventTimeout: getFirstStreamEventTimeoutHandler(options)
|
|
116
|
+
});
|
|
117
|
+
if (options?.signal?.aborted) throw transportAbortError(options.signal);
|
|
118
|
+
if (output.stopReason === "aborted" || output.stopReason === "error") throw new Error(output.errorMessage || (output.stopReason === "aborted" ? "Request was aborted" : "Provider returned an invalid tool call"));
|
|
119
|
+
} catch (error) {
|
|
120
|
+
for (const block of output.content) if (block.type !== "toolCall") finishBlock(block);
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
for (const block of output.content) if (block.type !== "toolCall" || output.stopReason === "toolUse") finishBlock(block);
|
|
124
|
+
stream.push({
|
|
125
|
+
type: "done",
|
|
126
|
+
reason: output.stopReason,
|
|
127
|
+
message: output
|
|
128
|
+
});
|
|
129
|
+
stream.end();
|
|
130
|
+
} catch (error) {
|
|
131
|
+
const terminal = assignTransportErrorDetails(output, error, options?.signal);
|
|
132
|
+
finalizeOpenAICompletionsToolCalls(output, { allowSilentToolCallPromotion: false });
|
|
133
|
+
clearPendingCommentaryText(provisionalCommentaryTags);
|
|
134
|
+
tagUnresolvedTextAsCommentary(output);
|
|
135
|
+
for (const block of output.content) {
|
|
136
|
+
delete block.index;
|
|
137
|
+
delete block.partialArgs;
|
|
138
|
+
delete block.streamIndex;
|
|
139
|
+
}
|
|
140
|
+
stream.push({
|
|
141
|
+
type: "error",
|
|
142
|
+
reason: terminal.stopReason,
|
|
143
|
+
error: output
|
|
144
|
+
});
|
|
145
|
+
stream.end();
|
|
146
|
+
} finally {
|
|
147
|
+
firstEventAbort?.dispose();
|
|
148
|
+
}
|
|
149
|
+
})();
|
|
150
|
+
return stream;
|
|
151
|
+
};
|
|
152
|
+
const streamSimpleOpenAICompletions = (model, context, options) => {
|
|
153
|
+
const apiKey = options?.apiKey || getEnvApiKey(model.provider);
|
|
154
|
+
if (!apiKey) throw new Error(`No API key for provider: ${model.provider}`);
|
|
155
|
+
const base = buildBaseOptions(model, options, apiKey);
|
|
156
|
+
const clampedReasoning = options?.reasoning ? clampThinkingLevel(model, options.reasoning) : void 0;
|
|
157
|
+
const reasoningEffort = clampedReasoning === "off" ? void 0 : clampedReasoning === "max" ? "xhigh" : clampedReasoning;
|
|
158
|
+
const toolChoice = options?.toolChoice;
|
|
159
|
+
return streamOpenAICompletions(model, context, {
|
|
160
|
+
...base,
|
|
161
|
+
reasoningEffort,
|
|
162
|
+
toolChoice
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
function createClient(model, context, apiKey, optionsHeaders, sessionId, compat = resolveOpenAICompletionsCompat(model)) {
|
|
166
|
+
if (!apiKey) throw new Error(`No API key for provider: ${model.provider}`);
|
|
167
|
+
const headers = { ...model.headers };
|
|
168
|
+
if (model.provider === "github-copilot") {
|
|
169
|
+
const hasImages = hasCopilotVisionInput(context.messages);
|
|
170
|
+
const copilotHeaders = buildCopilotDynamicHeaders({
|
|
171
|
+
messages: context.messages,
|
|
172
|
+
hasImages
|
|
173
|
+
});
|
|
174
|
+
Object.assign(headers, copilotHeaders);
|
|
175
|
+
}
|
|
176
|
+
if (sessionId && compat.sessionAffinity !== "none") {
|
|
177
|
+
if (compat.sessionAffinity === "openrouter") headers["x-session-id"] = sessionId;
|
|
178
|
+
else {
|
|
179
|
+
headers.session_id = sessionId;
|
|
180
|
+
headers["x-client-request-id"] = sessionId;
|
|
181
|
+
headers["x-session-affinity"] = sessionId;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return createOpenAIProviderClient(model, apiKey, headers, optionsHeaders);
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
export { streamOpenAICompletions as n, streamSimpleOpenAICompletions as r, openai_completions_exports as t };
|
package/dist/{openai-completions-compat-CpjYUArk.d.mts → openai-completions-compat-CXn3T1we.d.mts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import { D as Model, j as OpenAICompletionsCompat } from "./types-
|
|
3
|
-
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-
|
|
1
|
+
import "./index-CQ6LTHw8.mjs";
|
|
2
|
+
import { D as Model, j as OpenAICompletionsCompat } from "./types-Dy1q0CSu.mjs";
|
|
3
|
+
import { a as AiProviderRequestPolicyInput, i as AiProviderRequestCapabilities } from "./host-DK3wmS3e.mjs";
|
|
4
4
|
//#region packages/ai/src/transports/openai-completions-compat.d.ts
|
|
5
5
|
type ProviderRequestCapabilities = AiProviderRequestCapabilities;
|
|
6
6
|
type OpenAICompletionsSessionAffinity = "none" | "openai" | "openrouter";
|
|
@@ -30,7 +30,29 @@ type ResolvedOpenAICompletionsCompat = Omit<Required<OpenAICompletionsCompat>, "
|
|
|
30
30
|
sessionAffinity: OpenAICompletionsSessionAffinity;
|
|
31
31
|
visibleReasoningDetailTypes: string[];
|
|
32
32
|
requiresNonEmptyUserOrAssistantMessage: boolean;
|
|
33
|
+
configuredSupportsLongCacheRetention?: boolean;
|
|
33
34
|
};
|
|
35
|
+
/** Native OpenAI defaults never apply to a configured proxy endpoint. */
|
|
36
|
+
declare function isNativeOpenAIEndpoint(model: {
|
|
37
|
+
provider?: string;
|
|
38
|
+
baseUrl?: string;
|
|
39
|
+
}): boolean;
|
|
40
|
+
declare function isOpenAICodexResponsesModel(model: {
|
|
41
|
+
provider?: string;
|
|
42
|
+
api?: string;
|
|
43
|
+
baseUrl?: string;
|
|
44
|
+
}): boolean;
|
|
45
|
+
declare function usesNativeOpenAICodexResponsesBackend(model: {
|
|
46
|
+
provider?: string;
|
|
47
|
+
api?: string;
|
|
48
|
+
baseUrl?: string;
|
|
49
|
+
}): boolean;
|
|
50
|
+
declare function resolveOpenAIPromptCacheKeySupport(model: {
|
|
51
|
+
api?: string;
|
|
52
|
+
provider?: string;
|
|
53
|
+
baseUrl?: string;
|
|
54
|
+
compat?: Pick<OpenAICompletionsCompat, "supportsPromptCacheKey" | "supportsLongCacheRetention"> | null;
|
|
55
|
+
}): boolean;
|
|
34
56
|
/** Detects endpoint capabilities and defaults for an OpenAI-completions model. */
|
|
35
57
|
declare function detectOpenAICompletionsCompat(model: Pick<Model<"openai-completions">, "provider" | "baseUrl" | "id"> & {
|
|
36
58
|
compat?: {
|
|
@@ -40,4 +62,4 @@ declare function detectOpenAICompletionsCompat(model: Pick<Model<"openai-complet
|
|
|
40
62
|
/** Applies explicit model overrides once on top of the canonical transport defaults. */
|
|
41
63
|
declare function resolveOpenAICompletionsCompat(model: Pick<Model<"openai-completions">, "id" | "provider" | "baseUrl" | "compat">, resolveCapabilities?: (input: AiProviderRequestPolicyInput) => ProviderRequestCapabilities): ResolvedOpenAICompletionsCompat;
|
|
42
64
|
//#endregion
|
|
43
|
-
export { detectOpenAICompletionsCompat as n,
|
|
65
|
+
export { resolveOpenAICompletionsCompat as a, isOpenAICodexResponsesModel as i, detectOpenAICompletionsCompat as n, resolveOpenAIPromptCacheKeySupport as o, isNativeOpenAIEndpoint as r, usesNativeOpenAICodexResponsesBackend as s, ResolvedOpenAICompletionsCompat as t };
|