@jeffreycao/copilot-api 2.1.7 → 2.1.9
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 -6
- package/README.zh-CN.md +6 -6
- package/dist/{auth-DYaGY4fS.js → auth-HR8NHHhJ.js} +3 -3
- package/dist/{auth-DYaGY4fS.js.map → auth-HR8NHHhJ.js.map} +1 -1
- package/dist/auth-PIo0IPSc.js +2 -0
- package/dist/{config-DMrKDHiF.js → config-CHzejzwY.js} +2 -2
- package/dist/{config-DMrKDHiF.js.map → config-CHzejzwY.js.map} +1 -1
- package/dist/{debug-2GkXJBt5.js → debug-ChC85ySp.js} +2 -2
- package/dist/{debug-2GkXJBt5.js.map → debug-ChC85ySp.js.map} +1 -1
- package/dist/main.js +3 -3
- package/dist/{models-Do0TBzAz.js → models-CJuY4JZ5.js} +2 -2
- package/dist/{models-Do0TBzAz.js.map → models-CJuY4JZ5.js.map} +1 -1
- package/dist/{server-s6RzK7Oo.js → server-tlEQmO0Y.js} +83 -19
- package/dist/server-tlEQmO0Y.js.map +1 -0
- package/dist/{start-D5W3xtWv.js → start-Bnk7SH7n.js} +6 -6
- package/dist/{start-D5W3xtWv.js.map → start-Bnk7SH7n.js.map} +1 -1
- package/dist/{token-DmNSTe37.js → token-Ctj6sfG4.js} +2 -2
- package/dist/{token-DmNSTe37.js.map → token-Ctj6sfG4.js.map} +1 -1
- package/package.json +1 -1
- package/dist/auth-t5Gi1JB9.js +0 -2
- package/dist/server-s6RzK7Oo.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as isResponsesApiWebSocketEnabled, C as getClaudeTokenMultiplier, D as isAlphaSearchCodexPriorityEnabled, E as getResponsesTransportConfig, M as PATHS, O as isMessagesApiEnabled, S as getClaudeAutoModel, T as getMessageApiWebSearchModel, _ as resolveMappedModel, b as getAlphaSearchModel, d as getModelResponsesApiCompactThreshold$1, f as getReasoningEffortForModel, g as isGpt56OrAbove, h as isContextManagementEnabledForResponses, i as listEnabledProviders, k as isResponsesApiWebSearchEnabled, l as getExtraPromptForModel, m as isContextManagementEnabledForMessages, n as getRawProviderConfig, o as resolveEffectiveProviderType, p as getSmallModel, s as resolveProviderAuthType, t as getProviderConfig, u as getModelMappings, v as setModelMappings, w as getConfig, x as getAnthropicApiKey } from "./config-
|
|
2
|
-
import { A as buildCodexRequestHeaders, B as createPooledWebSocketStream, C as compactAutoContinuePromptStarts, D as compactTextOnlyGuard, E as compactSystemPromptStarts, F as createResponsesHttpEventStream, H as state, I as fetchResponsesWithLifecycle, L as createResponsesSafeStream, M as generateTraceId, N as requestContext, P as resolveTraceId$1, R as encodePoolKeyPart, U as HTTPError, V as createWebSocketUrl, W as forwardError, b as prepareInteractionHeaders, c as getUUID, d as isResponsesStream, f as parseUserIdMetadata, g as copilotHeaders, h as copilotBaseUrl, j as forwardCodexResponses, k as CODEX_API_BASE_URL, l as isAsyncIterable, o as generateRequestIdFromPayload, p as getCopilotUsage, r as setupCodexToken, s as getRootSessionId, u as isNullish, v as copilotWebSocketHeaders, w as compactMessageSections, x as prepareMessageProxyHeaders, y as prepareForCompact, z as isTerminalResponsesStreamChunk } from "./token-
|
|
1
|
+
import { A as isResponsesApiWebSocketEnabled, C as getClaudeTokenMultiplier, D as isAlphaSearchCodexPriorityEnabled, E as getResponsesTransportConfig, M as PATHS, O as isMessagesApiEnabled, S as getClaudeAutoModel, T as getMessageApiWebSearchModel, _ as resolveMappedModel, b as getAlphaSearchModel, d as getModelResponsesApiCompactThreshold$1, f as getReasoningEffortForModel, g as isGpt56OrAbove, h as isContextManagementEnabledForResponses, i as listEnabledProviders, k as isResponsesApiWebSearchEnabled, l as getExtraPromptForModel, m as isContextManagementEnabledForMessages, n as getRawProviderConfig, o as resolveEffectiveProviderType, p as getSmallModel, s as resolveProviderAuthType, t as getProviderConfig, u as getModelMappings, v as setModelMappings, w as getConfig, x as getAnthropicApiKey } from "./config-CHzejzwY.js";
|
|
2
|
+
import { A as buildCodexRequestHeaders, B as createPooledWebSocketStream, C as compactAutoContinuePromptStarts, D as compactTextOnlyGuard, E as compactSystemPromptStarts, F as createResponsesHttpEventStream, H as state, I as fetchResponsesWithLifecycle, L as createResponsesSafeStream, M as generateTraceId, N as requestContext, P as resolveTraceId$1, R as encodePoolKeyPart, U as HTTPError, V as createWebSocketUrl, W as forwardError, b as prepareInteractionHeaders, c as getUUID, d as isResponsesStream, f as parseUserIdMetadata, g as copilotHeaders, h as copilotBaseUrl, j as forwardCodexResponses, k as CODEX_API_BASE_URL, l as isAsyncIterable, o as generateRequestIdFromPayload, p as getCopilotUsage, r as setupCodexToken, s as getRootSessionId, u as isNullish, v as copilotWebSocketHeaders, w as compactMessageSections, x as prepareMessageProxyHeaders, y as prepareForCompact, z as isTerminalResponsesStreamChunk } from "./token-Ctj6sfG4.js";
|
|
3
3
|
import { a as isDeferredToolName, c as parseMcpToolSearchSentinel, d as shouldEnableResponsesToolSearch, i as isBridgeToolSearchName, l as resolveBridgeToolSearchName, o as listDeferredToolNames, r as formatToolSearchBridgeArguments, s as normalizeToolSearchBridgeArguments, t as BRIDGE_TOOL_SEARCH_NAME, u as selectDeferredToolsByNames } from "./tool-search-Ds1vbmGG.js";
|
|
4
|
-
import { i as toClientModelId, r as normalizeSdkModelId, t as findEndpointModel } from "./models-
|
|
4
|
+
import { i as toClientModelId, r as normalizeSdkModelId, t as findEndpointModel } from "./models-CJuY4JZ5.js";
|
|
5
5
|
import consola from "consola";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import fs, { readFileSync } from "node:fs";
|
|
@@ -640,8 +640,19 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
640
640
|
output: 4.4
|
|
641
641
|
}
|
|
642
642
|
},
|
|
643
|
+
"glm-5.3": {
|
|
644
|
+
contextWindow: 1e6,
|
|
645
|
+
inputModalities: ["text"],
|
|
646
|
+
maxOutputTokens: 64e3,
|
|
647
|
+
pricing: {
|
|
648
|
+
cachedInput: .26,
|
|
649
|
+
input: 1.4,
|
|
650
|
+
output: 4.4
|
|
651
|
+
}
|
|
652
|
+
},
|
|
643
653
|
"grok-4.5": {
|
|
644
654
|
contextWindow: 5e5,
|
|
655
|
+
defaultReasoningEffort: "high",
|
|
645
656
|
inputModalities: ["text", "image"],
|
|
646
657
|
maxOutputTokens: 64e3,
|
|
647
658
|
pricing: { tiers: [{
|
|
@@ -653,7 +664,12 @@ const builtinProviderModelRegistry = new class BuiltinProviderModelRegistry {
|
|
|
653
664
|
cachedInput: 1,
|
|
654
665
|
input: 4,
|
|
655
666
|
output: 12
|
|
656
|
-
}] }
|
|
667
|
+
}] },
|
|
668
|
+
reasoningEfforts: [
|
|
669
|
+
"low",
|
|
670
|
+
"medium",
|
|
671
|
+
"high"
|
|
672
|
+
]
|
|
657
673
|
},
|
|
658
674
|
"deepseek-v4-flash": {
|
|
659
675
|
contextWindow: 1e6,
|
|
@@ -2892,6 +2908,21 @@ const setContextCacheControl = (part) => {
|
|
|
2892
2908
|
};
|
|
2893
2909
|
//#endregion
|
|
2894
2910
|
//#region src/routes/provider/utils.ts
|
|
2911
|
+
const RESPONSES_REASONING_EFFORTS = new Set([
|
|
2912
|
+
"none",
|
|
2913
|
+
"minimal",
|
|
2914
|
+
"low",
|
|
2915
|
+
"medium",
|
|
2916
|
+
"high",
|
|
2917
|
+
"xhigh",
|
|
2918
|
+
"max"
|
|
2919
|
+
]);
|
|
2920
|
+
const REASONING_EFFORT_ALIASES = {
|
|
2921
|
+
minimal: "low",
|
|
2922
|
+
xhigh: "high",
|
|
2923
|
+
max: "high",
|
|
2924
|
+
ultra: "high"
|
|
2925
|
+
};
|
|
2895
2926
|
const applyModelDefaults = (payload, modelConfig) => {
|
|
2896
2927
|
payload.temperature ??= modelConfig?.temperature;
|
|
2897
2928
|
payload.top_p ??= modelConfig?.topP;
|
|
@@ -2900,6 +2931,24 @@ const applyModelDefaults = (payload, modelConfig) => {
|
|
|
2900
2931
|
const applyMissingExtraBody = (payload, options) => {
|
|
2901
2932
|
for (const [key, value] of Object.entries(options.extraBody ?? {})) if (!Object.hasOwn(payload, key)) payload[key] = value;
|
|
2902
2933
|
};
|
|
2934
|
+
const normalizeProviderResponsesReasoningEffort = (payload, providerConfig) => {
|
|
2935
|
+
const currentEffort = payload.reasoning?.effort;
|
|
2936
|
+
if (typeof currentEffort !== "string") return;
|
|
2937
|
+
const modelConfig = providerConfig.models?.[payload.model];
|
|
2938
|
+
const builtinModelConfig = builtinProviderModelRegistry.getModelConfig(providerConfig.name, payload.model);
|
|
2939
|
+
const configuredEfforts = normalizeResponsesReasoningEfforts(modelConfig?.reasoningEfforts);
|
|
2940
|
+
const builtinEfforts = normalizeResponsesReasoningEfforts(builtinModelConfig?.reasoningEfforts);
|
|
2941
|
+
const supportedEfforts = configuredEfforts.length > 0 ? configuredEfforts : builtinEfforts;
|
|
2942
|
+
if (supportedEfforts.length === 0 || supportedEfforts.includes(currentEffort)) return;
|
|
2943
|
+
const aliasedEffort = REASONING_EFFORT_ALIASES[currentEffort];
|
|
2944
|
+
const fallbackEffort = aliasedEffort && supportedEfforts.includes(aliasedEffort) ? aliasedEffort : selectSupportedReasoningEffort(supportedEfforts, modelConfig?.defaultReasoningEffort, builtinModelConfig?.defaultReasoningEffort);
|
|
2945
|
+
if (payload.reasoning && fallbackEffort) payload.reasoning.effort = fallbackEffort;
|
|
2946
|
+
};
|
|
2947
|
+
const normalizeResponsesReasoningEfforts = (efforts) => (efforts ?? []).filter((effort) => RESPONSES_REASONING_EFFORTS.has(effort));
|
|
2948
|
+
const selectSupportedReasoningEffort = (supportedEfforts, ...defaults) => {
|
|
2949
|
+
for (const defaultEffort of defaults) if (defaultEffort && supportedEfforts.includes(defaultEffort)) return defaultEffort;
|
|
2950
|
+
return supportedEfforts[0];
|
|
2951
|
+
};
|
|
2903
2952
|
//#endregion
|
|
2904
2953
|
//#region src/routes/provider/chat-completions/handler.ts
|
|
2905
2954
|
const logger$14 = createHandlerLogger("provider-chat-completions-handler");
|
|
@@ -3449,16 +3498,15 @@ function mapOpenAIStopReasonToAnthropic(finishReason) {
|
|
|
3449
3498
|
content_filter: "end_turn"
|
|
3450
3499
|
}[finishReason];
|
|
3451
3500
|
}
|
|
3452
|
-
//#endregion
|
|
3453
|
-
//#region src/routes/messages/non-stream-translation.ts
|
|
3454
|
-
const THINKING_TEXT = "Thinking...";
|
|
3455
3501
|
const COPILOT_TOOL_CONTENT_SUPPORT_TYPE = ["array", "image"];
|
|
3456
3502
|
function translateToOpenAI(payload, options = {}) {
|
|
3457
3503
|
const modelId = payload.model;
|
|
3458
3504
|
const model = state.models?.data.find((m) => m.id === modelId);
|
|
3459
3505
|
const thinkingBudget = getThinkingBudget(payload, model);
|
|
3460
3506
|
const reasoningEffort = getReasoningEffort(payload, options);
|
|
3461
|
-
const
|
|
3507
|
+
const { sessionId: metadataPromptCacheKey } = parseUserIdMetadata(payload.metadata?.user_id);
|
|
3508
|
+
const sessionAffinity = requestContext.getStore()?.sessionAffinity?.trim() || null;
|
|
3509
|
+
const promptCacheKey = metadataPromptCacheKey ?? sessionAffinity;
|
|
3462
3510
|
return {
|
|
3463
3511
|
model: modelId,
|
|
3464
3512
|
messages: translateAnthropicMessagesToOpenAI(payload, modelId, {
|
|
@@ -3600,7 +3648,7 @@ function handleAssistantMessage(message, modelId, capabilities) {
|
|
|
3600
3648
|
if (message.content.length === 0) return [];
|
|
3601
3649
|
const toolUseBlocks = message.content.filter((block) => block.type === "tool_use");
|
|
3602
3650
|
let thinkingBlocks = message.content.filter((block) => block.type === "thinking");
|
|
3603
|
-
if (modelId.startsWith("claude")) thinkingBlocks = thinkingBlocks.filter((b) => b.thinking
|
|
3651
|
+
if (modelId.startsWith("claude")) thinkingBlocks = thinkingBlocks.filter((b) => b.thinking !== "Thinking..." && b.signature && !b.signature.includes("@"));
|
|
3604
3652
|
const thinkingContents = thinkingBlocks.filter((b) => b.thinking && b.thinking !== "Thinking...").map((b) => b.thinking);
|
|
3605
3653
|
const allThinkingContent = thinkingContents.length > 0 ? thinkingContents.join("\n\n") : void 0;
|
|
3606
3654
|
const signature = thinkingBlocks.find((b) => b.signature)?.signature;
|
|
@@ -3762,7 +3810,7 @@ function getAnthropicThinkBlocks(reasoningText, reasoningOpaque) {
|
|
|
3762
3810
|
}];
|
|
3763
3811
|
if (reasoningOpaque && reasoningOpaque.length > 0) return [{
|
|
3764
3812
|
type: "thinking",
|
|
3765
|
-
thinking:
|
|
3813
|
+
thinking: "",
|
|
3766
3814
|
signature: reasoningOpaque
|
|
3767
3815
|
}];
|
|
3768
3816
|
return [];
|
|
@@ -4612,7 +4660,7 @@ function handleReasoningOpaque(delta, events, state) {
|
|
|
4612
4660
|
index: state.contentBlockIndex,
|
|
4613
4661
|
delta: {
|
|
4614
4662
|
type: "thinking_delta",
|
|
4615
|
-
thinking:
|
|
4663
|
+
thinking: ""
|
|
4616
4664
|
}
|
|
4617
4665
|
}, {
|
|
4618
4666
|
type: "content_block_delta",
|
|
@@ -5193,7 +5241,7 @@ const createCompactionThinkingBlock = (item) => {
|
|
|
5193
5241
|
if (!item.id || !item.encrypted_content) return null;
|
|
5194
5242
|
return {
|
|
5195
5243
|
type: "thinking",
|
|
5196
|
-
thinking:
|
|
5244
|
+
thinking: "",
|
|
5197
5245
|
signature: encodeCompactionCarrierSignature({
|
|
5198
5246
|
id: item.id,
|
|
5199
5247
|
encrypted_content: item.encrypted_content
|
|
@@ -5734,7 +5782,6 @@ const openFunctionCallBlock = (state, params) => {
|
|
|
5734
5782
|
}
|
|
5735
5783
|
const { blockIndex } = functionCallState;
|
|
5736
5784
|
if (!state.openBlocks.has(blockIndex)) {
|
|
5737
|
-
closeOpenBlocks(state, events);
|
|
5738
5785
|
events.push({
|
|
5739
5786
|
type: "content_block_start",
|
|
5740
5787
|
index: blockIndex,
|
|
@@ -5964,6 +6011,7 @@ const createCompactionContextManagement = (compactThreshold) => [{
|
|
|
5964
6011
|
compact_threshold: compactThreshold
|
|
5965
6012
|
}];
|
|
5966
6013
|
const applyResponsesApiContextManagement = (payload, maxPromptTokens, options) => {
|
|
6014
|
+
if (!payload.model.startsWith("gpt")) return false;
|
|
5967
6015
|
if (responsesUtilsDependencies.isGpt56OrAbove(payload.model)) return false;
|
|
5968
6016
|
if (hasTerminalCompactionTrigger(payload)) return isContextManagementEnabledForSource(options.source);
|
|
5969
6017
|
if (payload.context_management !== void 0) return true;
|
|
@@ -6561,6 +6609,7 @@ async function handleProviderMessagesForProvider(c, options) {
|
|
|
6561
6609
|
const handleOpenAIResponsesProviderWebSearchMessages = async (c, options) => {
|
|
6562
6610
|
const { modelConfig, payload, provider, providerConfig, usageEndpoint } = options;
|
|
6563
6611
|
const responsesPayload = prepareWebSearchResponsesPayload(payload);
|
|
6612
|
+
normalizeProviderResponsesReasoningEffort(responsesPayload, providerConfig);
|
|
6564
6613
|
debugJson(logger$10, "provider.messages.responses.web_search.request", {
|
|
6565
6614
|
payload: responsesPayload,
|
|
6566
6615
|
provider
|
|
@@ -6624,6 +6673,7 @@ const handleOpenAIResponsesProviderMessages = async (c, options) => {
|
|
|
6624
6673
|
const selectedModel = providerConfig.name === "codex" ? getModels().data.find((model) => model.id === payload.model) : void 0;
|
|
6625
6674
|
const wantsStream = payload.stream === true;
|
|
6626
6675
|
const responsesPayload = translateAnthropicMessagesToResponsesPayload(payload);
|
|
6676
|
+
normalizeProviderResponsesReasoningEffort(responsesPayload, providerConfig);
|
|
6627
6677
|
if (providerConfig.name === "codex" && !wantsStream) responsesPayload.stream = true;
|
|
6628
6678
|
if (applyResponsesApiContextManagement(responsesPayload, selectedModel?.capabilities.limits.max_prompt_tokens, { source: "messages" })) compactInputByLatestCompaction(responsesPayload);
|
|
6629
6679
|
debugJson(logger$10, "provider.messages.responses.request", {
|
|
@@ -8142,19 +8192,27 @@ async function getProviderCodexCandidates(provider, requestHeaders) {
|
|
|
8142
8192
|
function isMessagesFallbackProviderType(type) {
|
|
8143
8193
|
return type === "anthropic" || type === "openai-compatible";
|
|
8144
8194
|
}
|
|
8195
|
+
function describeProviderAdapter(type) {
|
|
8196
|
+
if (type === "anthropic") return "Messages";
|
|
8197
|
+
if (type === "openai-responses") return "Messages-to-Responses";
|
|
8198
|
+
return "Messages-to-Chat";
|
|
8199
|
+
}
|
|
8145
8200
|
function createProviderCodexCandidate(providerConfig, modelId, remoteModel, modelConfig, effectiveType) {
|
|
8146
8201
|
const builtinModelConfig = builtinProviderModelRegistry.getModelConfig(providerConfig.name, modelId);
|
|
8147
8202
|
const configuredReasoningEfforts = normalizeReasoningEfforts(modelConfig?.reasoningEfforts);
|
|
8148
|
-
const
|
|
8203
|
+
const remoteReasoningEfforts = normalizeRemoteReasoningEfforts(remoteModel);
|
|
8204
|
+
const builtinReasoningEfforts = normalizeReasoningEfforts(builtinModelConfig?.reasoningEfforts);
|
|
8205
|
+
const reasoningEfforts = configuredReasoningEfforts.length > 0 ? configuredReasoningEfforts : remoteReasoningEfforts.length > 0 ? remoteReasoningEfforts : builtinReasoningEfforts;
|
|
8149
8206
|
const configuredModalities = normalizeInputModalities(modelConfig?.inputModalities);
|
|
8150
8207
|
const remoteModalities = normalizeInputModalities(remoteModel?.input_modalities ?? remoteModel?.modalities);
|
|
8151
8208
|
const builtinModalities = normalizeInputModalities(builtinModelConfig?.inputModalities);
|
|
8152
8209
|
const displayName = getStringField$1(remoteModel ?? {}, "display_name") ?? getStringField$1(remoteModel ?? {}, "name") ?? modelId;
|
|
8153
|
-
const adapterName = effectiveType
|
|
8210
|
+
const adapterName = describeProviderAdapter(effectiveType);
|
|
8211
|
+
const requiresCatalogMatch = effectiveType === "openai-responses" && modelId.startsWith("gpt");
|
|
8154
8212
|
return {
|
|
8155
8213
|
slug: `${providerConfig.name}/${modelId}`,
|
|
8156
8214
|
catalogSlug: modelId,
|
|
8157
|
-
catalogMatchRequired:
|
|
8215
|
+
catalogMatchRequired: requiresCatalogMatch,
|
|
8158
8216
|
providerName: providerConfig.name,
|
|
8159
8217
|
displayName: `${displayName} (${providerConfig.name})`,
|
|
8160
8218
|
description: `${displayName} through the ${providerConfig.name} ${adapterName} adapter.`,
|
|
@@ -8167,7 +8225,7 @@ function createProviderCodexCandidate(providerConfig, modelId, remoteModel, mode
|
|
|
8167
8225
|
maxOutputTokens: positiveNumber(modelConfig?.maxOutputTokens ?? getFirstPositiveNumber(remoteModel, ["max_output_tokens"]) ?? builtinModelConfig?.maxOutputTokens, 32e3),
|
|
8168
8226
|
inputModalities: resolveInputModalities(providerConfig.name, configuredModalities, remoteModalities, builtinModalities),
|
|
8169
8227
|
reasoningEfforts,
|
|
8170
|
-
defaultReasoningEffort: selectDefaultReasoningEffort(reasoningEfforts, modelConfig?.defaultReasoningEffort)
|
|
8228
|
+
defaultReasoningEffort: selectDefaultReasoningEffort(reasoningEfforts, modelConfig?.defaultReasoningEffort ?? builtinModelConfig?.defaultReasoningEffort)
|
|
8171
8229
|
};
|
|
8172
8230
|
}
|
|
8173
8231
|
function normalizeRemoteReasoningEfforts(model) {
|
|
@@ -9937,7 +9995,8 @@ async function handleProviderResponsesForProvider(c, options) {
|
|
|
9937
9995
|
type: "invalid_request_error"
|
|
9938
9996
|
} }, 400);
|
|
9939
9997
|
const effectiveType = resolveEffectiveProviderType(providerConfig, payload.model);
|
|
9940
|
-
|
|
9998
|
+
normalizeProviderResponsesReasoningEffort(payload, providerConfig);
|
|
9999
|
+
if (shouldFallbackToMessages$1(c, payload.model, effectiveType)) return await handleResponsesViaMessages(c, {
|
|
9941
10000
|
payload,
|
|
9942
10001
|
publicModel: options.publicModel ?? payload.model,
|
|
9943
10002
|
targetModel: `${provider}/${payload.model}`
|
|
@@ -9978,6 +10037,11 @@ async function handleProviderResponsesForProvider(c, options) {
|
|
|
9978
10037
|
recordUsage(normalizeResponsesUsage((await upstreamResponse.clone().json()).usage));
|
|
9979
10038
|
return createProviderProxyResponse(upstreamResponse);
|
|
9980
10039
|
}
|
|
10040
|
+
const shouldFallbackToMessages$1 = (c, modelId, effectiveType) => {
|
|
10041
|
+
if (effectiveType === "anthropic" || effectiveType === "openai-compatible") return true;
|
|
10042
|
+
if (isCodexUserAgent(c.req.header("user-agent"))) return !modelId.startsWith("gpt");
|
|
10043
|
+
return false;
|
|
10044
|
+
};
|
|
9981
10045
|
const createProviderResponsesUsageRecorder = (payload, provider, modelConfig, pricingCurrency) => {
|
|
9982
10046
|
const sessionAffinity = requestContext.getStore()?.sessionAffinity?.trim() || null;
|
|
9983
10047
|
return createProviderTokenUsageRecorder({
|
|
@@ -10433,4 +10497,4 @@ server.route("/:provider/images", providerImageRoutes);
|
|
|
10433
10497
|
//#endregion
|
|
10434
10498
|
export { server };
|
|
10435
10499
|
|
|
10436
|
-
//# sourceMappingURL=server-
|
|
10500
|
+
//# sourceMappingURL=server-tlEQmO0Y.js.map
|