@openclaw/ai 2026.7.2-beta.2 → 2026.7.2-beta.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/dist/{anthropic-BIRSg5x9.mjs → anthropic-D7SyZQ5v.mjs} +54 -35
- package/dist/{api-registry-Byvoz8Ha.d.mts → api-registry-DXBIXISf.d.mts} +1 -1
- package/dist/{azure-openai-responses-CHi7Wo4A.mjs → azure-openai-responses-BkZgyZ3I.mjs} +5 -4
- package/dist/{event-stream-uQspnL8S.d.mts → event-stream-BPemFrFW.d.mts} +1 -1
- package/dist/event-stream.d.mts +1 -1
- package/dist/{google-BmsqsNwR.mjs → google-C_biGbV7.mjs} +2 -2
- package/dist/{google-shared-Dx2aba47.mjs → google-shared-BK-NoHl8.mjs} +4 -3
- package/dist/{google-vertex-HZ_0rTwS.mjs → google-vertex-CvdzF1U7.mjs} +2 -2
- package/dist/index.d.mts +4 -4
- package/dist/internal/anthropic.d.mts +8 -2
- package/dist/internal/anthropic.mjs +3 -3
- package/dist/internal/openai.d.mts +2 -1
- package/dist/internal/openai.mjs +4 -4
- package/dist/internal/runtime.d.mts +2 -2
- package/dist/internal/runtime.mjs +3 -2
- package/dist/internal/shared.d.mts +4 -2
- package/dist/internal/shared.mjs +2 -2
- package/dist/{mistral-DxMPt9q9.mjs → mistral-BdrQmDWp.mjs} +23 -7
- package/dist/{model-utils-Q1LSRIdo.mjs → model-utils-1GiZ2_rr.mjs} +3 -1
- package/dist/{openai-chatgpt-responses-BuH2NvsR.mjs → openai-chatgpt-responses-DP63Qt01.mjs} +11 -9
- package/dist/{openai-completions-DPR_O2RW.mjs → openai-completions-zLDfebnN.mjs} +39 -15
- package/dist/{openai-responses-Cov-Vdc2.mjs → openai-responses-ClspWt4I.mjs} +3 -3
- package/dist/{openai-responses-shared-Befb4D6R.mjs → openai-responses-shared-CwnGU0KW.mjs} +323 -223
- package/dist/{openai-tool-projection-CFqm42J2.mjs → openai-tool-projection-WHf2nuOI.mjs} +1 -1
- package/dist/provider-error-LMfTEkfO.mjs +40 -0
- package/dist/providers.d.mts +1 -1
- package/dist/providers.mjs +8 -8
- package/dist/{transform-messages-BmS70CP5.mjs → transform-messages-eb6lxDLB.mjs} +8 -2
- package/dist/{types-Cx2zJtyz.d.mts → types-CYORveZ7.d.mts} +6 -0
- package/dist/types.d.mts +3 -3
- package/dist/{validation-Cej7htKc.d.mts → validation-BX8euiDv.d.mts} +1 -1
- package/dist/validation.d.mts +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/{openai-chatgpt-responses-BuH2NvsR.mjs → openai-chatgpt-responses-DP63Qt01.mjs}
RENAMED
|
@@ -3,10 +3,10 @@ import { i as formatThrownValue, n as createAssistantMessageDiagnostic, t as app
|
|
|
3
3
|
import { t as AssistantMessageEventStream } from "./event-stream-D8n2uFee.mjs";
|
|
4
4
|
import { n as getAiTransportHost, r as resolveAiTransportHeaderSentinels } from "./host-4t713IeR.mjs";
|
|
5
5
|
import { t as headersToRecord } from "./headers-B_e4-1J0.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import { M as supportsOpenAITemperature, a as resolveResponsesReasoningEffort, i as processResponsesStream, n as convertResponsesMessages, s as convertResponsesToolPayload } from "./openai-responses-shared-
|
|
6
|
+
import { l as buildBaseOptions, w as stripSystemPromptCacheBoundary } from "./transform-messages-eb6lxDLB.mjs";
|
|
7
|
+
import { M as supportsOpenAITemperature, a as resolveResponsesReasoningEffort, i as processResponsesStream, n as convertResponsesMessages, s as convertResponsesToolPayload } from "./openai-responses-shared-CwnGU0KW.mjs";
|
|
8
8
|
import { i as getFirstStreamEventTimeoutMs, o as clampTimerTimeoutMs, r as getFirstStreamEventTimeoutHandler, s as resolveTimerTimeoutMs, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-RjWszj8c.mjs";
|
|
9
|
-
import { a as clampOpenAIPromptCacheKey } from "./openai-tool-projection-
|
|
9
|
+
import { a as clampOpenAIPromptCacheKey } from "./openai-tool-projection-WHf2nuOI.mjs";
|
|
10
10
|
import { parseRetryAfterHttpDateMs } from "./internal/retry-after.mjs";
|
|
11
11
|
import { i as registerSessionResourceCleanup, n as resolveOpenAICodexAccountId } from "./openai-chatgpt-jwt-DhAAzLkj.mjs";
|
|
12
12
|
import { t as createSseByteGuard } from "./streaming-byte-guard-BrbkbwUu.mjs";
|
|
@@ -38,7 +38,7 @@ function loadNodeOs() {
|
|
|
38
38
|
}
|
|
39
39
|
const os = loadNodeOs();
|
|
40
40
|
const DEFAULT_CODEX_BASE_URL = "https://chatgpt.com/backend-api";
|
|
41
|
-
const
|
|
41
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
42
42
|
const BASE_DELAY_MS = 1e3;
|
|
43
43
|
const REQUEST_COMPRESSION_ZSTD_LEVEL = 3;
|
|
44
44
|
const CODEX_TOOL_CALL_PROVIDERS = /* @__PURE__ */ new Set(["openai", "opencode"]);
|
|
@@ -127,8 +127,9 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
127
127
|
let body = buildRequestBody(model, context, options);
|
|
128
128
|
const nextBody = await options?.onPayload?.(body, model);
|
|
129
129
|
if (nextBody !== void 0) body = nextBody;
|
|
130
|
-
const
|
|
131
|
-
const
|
|
130
|
+
const sessionId = clampOpenAIPromptCacheKey(options?.sessionId);
|
|
131
|
+
const websocketRequestId = sessionId || createCodexRequestId();
|
|
132
|
+
const sseHeaders = buildSSEHeaders(modelHeaders, optionHeaders, accountId, apiKey, sessionId);
|
|
132
133
|
const websocketHeaders = buildWebSocketHeaders(modelHeaders, optionHeaders, accountId, apiKey, websocketRequestId);
|
|
133
134
|
const bodyJson = JSON.stringify(body);
|
|
134
135
|
requestTimeoutMs = resolveRequestTimeoutMs(options);
|
|
@@ -184,7 +185,8 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
184
185
|
const sseBody = compressedBody ?? bodyJson;
|
|
185
186
|
let response;
|
|
186
187
|
let lastError;
|
|
187
|
-
|
|
188
|
+
const maxRetries = options?.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
189
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
188
190
|
if (activeSignal?.aborted) throw new Error("Request was aborted");
|
|
189
191
|
try {
|
|
190
192
|
response = await fetch(resolveCodexUrl(model.baseUrl), {
|
|
@@ -199,7 +201,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
199
201
|
}, model);
|
|
200
202
|
if (response.ok) break;
|
|
201
203
|
const errorText = await readChatGptResponsesErrorTextLimited(response);
|
|
202
|
-
if (attempt <
|
|
204
|
+
if (attempt < maxRetries && isRetryableError(response.status, errorText)) {
|
|
203
205
|
let delayMs = BASE_DELAY_MS * 2 ** attempt;
|
|
204
206
|
const retryAfterMs = response.headers.get("retry-after-ms");
|
|
205
207
|
if (retryAfterMs !== null) {
|
|
@@ -233,7 +235,7 @@ const streamOpenAICodexResponses = (model, context, options) => {
|
|
|
233
235
|
if (error.name === "TimeoutError" && requestTimeoutMs !== void 0) throw new Error(`Request timed out after ${requestTimeoutMs}ms`, { cause: error });
|
|
234
236
|
}
|
|
235
237
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
236
|
-
if (attempt <
|
|
238
|
+
if (attempt < maxRetries && !lastError.message.includes("usage limit")) {
|
|
237
239
|
await sleepWithAbort(BASE_DELAY_MS * 2 ** attempt, activeSignal);
|
|
238
240
|
continue;
|
|
239
241
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { n as getEnvApiKey, r as __exportAll } from "./env-api-keys-DnhYpc27.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-D8n2uFee.mjs";
|
|
3
3
|
import { n as getAiTransportHost } from "./host-4t713IeR.mjs";
|
|
4
|
-
import { n as calculateCost, r as clampThinkingLevel, t as applyProviderReportedUsageCost } from "./model-utils-
|
|
4
|
+
import { n as calculateCost, r as clampThinkingLevel, t as applyProviderReportedUsageCost } from "./model-utils-1GiZ2_rr.mjs";
|
|
5
5
|
import { t as headersToRecord } from "./headers-B_e4-1J0.mjs";
|
|
6
6
|
import { n as parseStreamingJson } from "./json-parse-BvXNt1-7.mjs";
|
|
7
7
|
import { t as sanitizeSurrogates } from "./sanitize-unicode-DT5o51ur.mjs";
|
|
8
|
-
import { C as
|
|
8
|
+
import { C as splitSystemPromptCacheBoundary, i as extractToolResultText, l as buildBaseOptions, n as describeToolResultMediaPlaceholder, o as isImageWithMediaPayload, t as transformMessages, w as stripSystemPromptCacheBoundary } from "./transform-messages-eb6lxDLB.mjs";
|
|
9
9
|
import { a as resolveCacheRetention, i as resolveCloudflareBaseUrl, n as hasCopilotVisionInput, r as isCloudflareProvider, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-BsH5cqGj.mjs";
|
|
10
|
+
import { t as formatProviderError } from "./provider-error-LMfTEkfO.mjs";
|
|
10
11
|
import { t as createReasoningTagTextPartitioner } from "./reasoning-tag-text-partitioner-BlVe67g6.mjs";
|
|
11
12
|
import { a as withFirstStreamEventTimeout, i as getFirstStreamEventTimeoutMs, r as getFirstStreamEventTimeoutHandler, t as createFirstStreamEventAbortController } from "./stream-first-event-timeout-RjWszj8c.mjs";
|
|
12
|
-
import { a as clampOpenAIPromptCacheKey, n as reconcileOpenAICompletionsToolChoice, t as projectOpenAITools } from "./openai-tool-projection-
|
|
13
|
+
import { a as clampOpenAIPromptCacheKey, n as reconcileOpenAICompletionsToolChoice, t as projectOpenAITools } from "./openai-tool-projection-WHf2nuOI.mjs";
|
|
13
14
|
import OpenAI from "openai";
|
|
14
15
|
//#region packages/ai/src/providers/openai-stop-reason.ts
|
|
15
16
|
function mapOpenAIStopReason(reason, options) {
|
|
@@ -72,6 +73,11 @@ function sanitizeToolResultText(text, fallback) {
|
|
|
72
73
|
const sanitized = sanitizeSurrogates(text);
|
|
73
74
|
return sanitized.trim().length > 0 ? sanitized : fallback;
|
|
74
75
|
}
|
|
76
|
+
function isEncryptedReasoningDetail(detail) {
|
|
77
|
+
if (typeof detail !== "object" || detail === null) return false;
|
|
78
|
+
const candidate = detail;
|
|
79
|
+
return candidate.type === "reasoning.encrypted" && typeof candidate.id === "string" && candidate.id.length > 0 && typeof candidate.data === "string" && candidate.data.length > 0;
|
|
80
|
+
}
|
|
75
81
|
const streamOpenAICompletions = (model, context, options) => {
|
|
76
82
|
const stream = new AssistantMessageEventStream();
|
|
77
83
|
(async () => {
|
|
@@ -112,7 +118,7 @@ const streamOpenAICompletions = (model, context, options) => {
|
|
|
112
118
|
const requestOptions = {
|
|
113
119
|
signal: firstEventAbort.signal,
|
|
114
120
|
...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
|
|
115
|
-
|
|
121
|
+
maxRetries: options?.maxRetries ?? 0
|
|
116
122
|
};
|
|
117
123
|
const { data: openaiStream, response } = await client.chat.completions.create(params, requestOptions).withResponse();
|
|
118
124
|
await options?.onResponse?.({
|
|
@@ -129,6 +135,7 @@ const streamOpenAICompletions = (model, context, options) => {
|
|
|
129
135
|
const toolCallBlocksByIndex = /* @__PURE__ */ new Map();
|
|
130
136
|
const toolCallBlocksById = /* @__PURE__ */ new Map();
|
|
131
137
|
const toolCallBlocksByFirstId = /* @__PURE__ */ new Map();
|
|
138
|
+
const pendingReasoningDetailsByToolCallId = /* @__PURE__ */ new Map();
|
|
132
139
|
const blocks = output.content;
|
|
133
140
|
const finishedBlocks = /* @__PURE__ */ new Set();
|
|
134
141
|
const contentIndices = /* @__PURE__ */ new WeakMap();
|
|
@@ -138,7 +145,13 @@ const streamOpenAICompletions = (model, context, options) => {
|
|
|
138
145
|
};
|
|
139
146
|
const getContentIndex = (block) => contentIndices.get(block) ?? -1;
|
|
140
147
|
const rememberFirstToolCallById = (id, block) => {
|
|
141
|
-
if (
|
|
148
|
+
if (toolCallBlocksByFirstId.has(id)) return;
|
|
149
|
+
toolCallBlocksByFirstId.set(id, block);
|
|
150
|
+
const pendingDetail = pendingReasoningDetailsByToolCallId.get(id);
|
|
151
|
+
if (pendingDetail) {
|
|
152
|
+
block.thoughtSignature = pendingDetail;
|
|
153
|
+
pendingReasoningDetailsByToolCallId.delete(id);
|
|
154
|
+
}
|
|
142
155
|
};
|
|
143
156
|
const finishBlock = (block) => {
|
|
144
157
|
const contentIndex = getContentIndex(block);
|
|
@@ -341,10 +354,12 @@ const streamOpenAICompletions = (model, context, options) => {
|
|
|
341
354
|
}
|
|
342
355
|
}
|
|
343
356
|
const reasoningDetails = choiceDelta.reasoning_details;
|
|
344
|
-
if (
|
|
345
|
-
for (const detail of reasoningDetails) if (detail
|
|
357
|
+
if (Array.isArray(reasoningDetails)) {
|
|
358
|
+
for (const detail of reasoningDetails) if (isEncryptedReasoningDetail(detail)) {
|
|
359
|
+
const serializedDetail = JSON.stringify(detail);
|
|
346
360
|
const matchingToolCall = toolCallBlocksByFirstId.get(detail.id);
|
|
347
|
-
if (matchingToolCall) matchingToolCall.thoughtSignature =
|
|
361
|
+
if (matchingToolCall) matchingToolCall.thoughtSignature = serializedDetail;
|
|
362
|
+
else pendingReasoningDetailsByToolCallId.set(detail.id, serializedDetail);
|
|
348
363
|
}
|
|
349
364
|
}
|
|
350
365
|
}
|
|
@@ -373,9 +388,9 @@ const streamOpenAICompletions = (model, context, options) => {
|
|
|
373
388
|
delete block.streamIndex;
|
|
374
389
|
}
|
|
375
390
|
output.stopReason = options?.signal?.aborted ? "aborted" : "error";
|
|
376
|
-
output.errorMessage =
|
|
391
|
+
output.errorMessage = formatProviderError(error);
|
|
377
392
|
const rawMetadata = error?.error?.metadata?.raw;
|
|
378
|
-
if (rawMetadata) output.errorMessage += `\n${rawMetadata}`;
|
|
393
|
+
if (rawMetadata && !output.errorMessage.includes(rawMetadata)) output.errorMessage += `\n${rawMetadata}`;
|
|
379
394
|
stream.push({
|
|
380
395
|
type: "error",
|
|
381
396
|
reason: output.stopReason,
|
|
@@ -412,7 +427,8 @@ function createClient(model, context, apiKey, optionsHeaders, sessionId, compat
|
|
|
412
427
|
});
|
|
413
428
|
Object.assign(headers, copilotHeaders);
|
|
414
429
|
}
|
|
415
|
-
if (sessionId && compat.sendSessionAffinityHeaders)
|
|
430
|
+
if (sessionId && compat.sendSessionAffinityHeaders) if (compat.sessionAffinityFormat === "openrouter") headers["x-session-id"] = sessionId;
|
|
431
|
+
else {
|
|
416
432
|
headers.session_id = sessionId;
|
|
417
433
|
headers["x-client-request-id"] = sessionId;
|
|
418
434
|
headers["x-session-affinity"] = sessionId;
|
|
@@ -469,7 +485,10 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
|
|
|
469
485
|
const toolChoice = reconcileOpenAICompletionsToolChoice(options.toolChoice, toolProjection ?? projectOpenAITools([]));
|
|
470
486
|
if (toolChoice !== void 0) params.tool_choice = toolChoice;
|
|
471
487
|
}
|
|
472
|
-
if (compat.thinkingFormat === "zai" && model.reasoning) params.thinking =
|
|
488
|
+
if (compat.thinkingFormat === "zai" && model.reasoning) params.thinking = options?.reasoningEffort ? {
|
|
489
|
+
type: "enabled",
|
|
490
|
+
clear_thinking: false
|
|
491
|
+
} : { type: "disabled" };
|
|
473
492
|
else if (compat.thinkingFormat === "qwen" && model.reasoning) params.enable_thinking = Boolean(options?.reasoningEffort);
|
|
474
493
|
else if (compat.thinkingFormat === "qwen-chat-template" && model.reasoning) params.chat_template_kwargs = {
|
|
475
494
|
enable_thinking: Boolean(options?.reasoningEffort),
|
|
@@ -491,7 +510,7 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
|
|
|
491
510
|
const offValue = model.thinkingLevelMap?.off;
|
|
492
511
|
if (typeof offValue === "string") params.reasoning_effort = offValue;
|
|
493
512
|
}
|
|
494
|
-
if (model.
|
|
513
|
+
if (model.compat?.openRouterRouting) params.provider = model.compat.openRouterRouting;
|
|
495
514
|
if (model.baseUrl.includes("ai-gateway.vercel.sh") && model.compat?.vercelGatewayRouting) {
|
|
496
515
|
const routing = model.compat.vercelGatewayRouting;
|
|
497
516
|
if (routing.only || routing.order) {
|
|
@@ -785,15 +804,18 @@ function detectCompat(model) {
|
|
|
785
804
|
const isMoonshot = provider === "moonshotai" || provider === "moonshotai-cn" || baseUrl.includes("api.moonshot.");
|
|
786
805
|
const isCloudflareWorkersAI = provider === "cloudflare-workers-ai" || baseUrl.includes("api.cloudflare.com");
|
|
787
806
|
const isCloudflareAiGateway = provider === "cloudflare-ai-gateway" || baseUrl.includes("gateway.ai.cloudflare.com");
|
|
807
|
+
const isOpenRouter = provider === "openrouter" || baseUrl.includes("openrouter.ai");
|
|
788
808
|
const isNonStandard = provider === "cerebras" || baseUrl.includes("cerebras.ai") || provider === "xai" || baseUrl.includes("api.x.ai") || isTogether || baseUrl.includes("chutes.ai") || baseUrl.includes("deepseek.com") || isZai || isMoonshot || provider === "opencode" || baseUrl.includes("opencode.ai") || isCloudflareWorkersAI || isCloudflareAiGateway;
|
|
789
809
|
const useMaxTokens = baseUrl.includes("chutes.ai") || isMoonshot || isCloudflareAiGateway || isTogether || isZai;
|
|
790
810
|
const isGrok = provider === "xai" || baseUrl.includes("api.x.ai");
|
|
791
811
|
const isDeepSeek = provider === "deepseek" || baseUrl.includes("deepseek.com");
|
|
792
812
|
const isXiaomi = provider === "xiaomi" || baseUrl.includes("xiaomimimo.com");
|
|
813
|
+
const supportsOpenRouterDeveloperRole = isOpenRouter && (model.id.startsWith("anthropic/") || model.id.startsWith("openai/"));
|
|
814
|
+
const usesOpenRouterSessionAffinity = isOpenRouter || model.compat?.thinkingFormat === "openrouter" || model.compat?.openRouterRouting !== void 0;
|
|
793
815
|
const cacheControlFormat = provider === "openrouter" && model.id.startsWith("anthropic/") ? "anthropic" : void 0;
|
|
794
816
|
return {
|
|
795
817
|
supportsStore: !isNonStandard,
|
|
796
|
-
supportsDeveloperRole: !isNonStandard,
|
|
818
|
+
supportsDeveloperRole: supportsOpenRouterDeveloperRole || !isNonStandard && !isOpenRouter,
|
|
797
819
|
supportsReasoningEffort: !isGrok && !isZai && !isMoonshot && !isTogether && !isCloudflareAiGateway,
|
|
798
820
|
supportsUsageInStreaming: true,
|
|
799
821
|
maxTokensField: useMaxTokens ? "max_tokens" : "max_completion_tokens",
|
|
@@ -801,13 +823,14 @@ function detectCompat(model) {
|
|
|
801
823
|
requiresAssistantAfterToolResult: false,
|
|
802
824
|
requiresThinkingAsText: false,
|
|
803
825
|
requiresReasoningContentOnAssistantMessages: isDeepSeek || isXiaomi,
|
|
804
|
-
thinkingFormat: isDeepSeek ? "deepseek" : isXiaomi ? "deepseek" : isZai ? "zai" : isTogether ? "together" :
|
|
826
|
+
thinkingFormat: isDeepSeek ? "deepseek" : isXiaomi ? "deepseek" : isZai ? "zai" : isTogether ? "together" : isOpenRouter ? "openrouter" : "openai",
|
|
805
827
|
openRouterRouting: {},
|
|
806
828
|
vercelGatewayRouting: {},
|
|
807
829
|
zaiToolStream: false,
|
|
808
830
|
supportsStrictMode: !isMoonshot && !isTogether && !isCloudflareAiGateway,
|
|
809
831
|
cacheControlFormat,
|
|
810
832
|
sendSessionAffinityHeaders: false,
|
|
833
|
+
sessionAffinityFormat: usesOpenRouterSessionAffinity ? "openrouter" : "openai",
|
|
811
834
|
supportsPromptCacheKey: false,
|
|
812
835
|
supportsLongCacheRetention: !(isTogether || isCloudflareWorkersAI || isCloudflareAiGateway)
|
|
813
836
|
};
|
|
@@ -836,6 +859,7 @@ function getCompat(model) {
|
|
|
836
859
|
supportsStrictMode: model.compat.supportsStrictMode ?? detected.supportsStrictMode,
|
|
837
860
|
cacheControlFormat: model.compat.cacheControlFormat ?? detected.cacheControlFormat,
|
|
838
861
|
sendSessionAffinityHeaders: model.compat.sendSessionAffinityHeaders ?? detected.sendSessionAffinityHeaders,
|
|
862
|
+
sessionAffinityFormat: detected.sessionAffinityFormat,
|
|
839
863
|
supportsPromptCacheKey: model.compat.supportsPromptCacheKey ?? detected.supportsPromptCacheKey,
|
|
840
864
|
supportsLongCacheRetention: model.compat.supportsLongCacheRetention ?? detected.supportsLongCacheRetention
|
|
841
865
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as getEnvApiKey, r as __exportAll } from "./env-api-keys-DnhYpc27.mjs";
|
|
2
2
|
import { t as AssistantMessageEventStream } from "./event-stream-D8n2uFee.mjs";
|
|
3
3
|
import { n as getAiTransportHost } from "./host-4t713IeR.mjs";
|
|
4
|
-
import { l as buildBaseOptions } from "./transform-messages-
|
|
4
|
+
import { l as buildBaseOptions } from "./transform-messages-eb6lxDLB.mjs";
|
|
5
5
|
import { a as resolveCacheRetention, i as resolveCloudflareBaseUrl, n as hasCopilotVisionInput, r as isCloudflareProvider, t as buildCopilotDynamicHeaders } from "./github-copilot-headers-BsH5cqGj.mjs";
|
|
6
|
-
import { M as supportsOpenAITemperature, a as resolveResponsesReasoningEffort, n as convertResponsesMessages, o as runResponsesStreamLifecycle, r as createResponsesAssistantOutput, t as applyCommonResponsesParams } from "./openai-responses-shared-
|
|
7
|
-
import { a as clampOpenAIPromptCacheKey } from "./openai-tool-projection-
|
|
6
|
+
import { M as supportsOpenAITemperature, a as resolveResponsesReasoningEffort, n as convertResponsesMessages, o as runResponsesStreamLifecycle, r as createResponsesAssistantOutput, t as applyCommonResponsesParams } from "./openai-responses-shared-CwnGU0KW.mjs";
|
|
7
|
+
import { a as clampOpenAIPromptCacheKey } from "./openai-tool-projection-WHf2nuOI.mjs";
|
|
8
8
|
import OpenAI from "openai";
|
|
9
9
|
//#region packages/ai/src/providers/openai-responses.ts
|
|
10
10
|
var openai_responses_exports = /* @__PURE__ */ __exportAll({
|