@zpi-dev/agent-sdk 0.1.60 → 0.1.61
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 +1 -1
- package/dist/{chunk-AR5RMMMN.js → chunk-GPIEWH3K.js} +324 -309
- package/dist/chunk-GPIEWH3K.js.map +1 -0
- package/dist/{chunk-4WFFCN2C.js → chunk-YPFTXFZL.js} +527 -479
- package/dist/chunk-YPFTXFZL.js.map +1 -0
- package/dist/host.js +3 -5
- package/dist/host.js.map +1 -1
- package/dist/index.js +2 -4
- package/dist/{src-7WDJXP5P.js → src-GYA4LFM7.js} +2 -4
- package/dist/types/ai/src/types.d.ts +2 -1
- package/dist/types/ai/src/utils/text.d.ts +1 -5
- package/dist/types/ai/src/utils/transcript.d.ts +0 -13
- package/dist/types/coding-agent/src/core/agent-session.d.ts +3 -2
- package/dist/types/coding-agent/src/core/dynamic-context.d.ts +3 -0
- package/dist/types/coding-agent/src/core/resources.d.ts +1 -1
- package/dist/types/coding-agent/src/core/sdk.d.ts +1 -3
- package/dist/types/coding-agent/src/core/session-manager.d.ts +1 -0
- package/dist/types/coding-agent/src/core/system-prompt.d.ts +9 -2
- package/dist/types/coding-agent/src/plugins/assembly.d.ts +1 -2
- package/dist/types/coding-agent/src/plugins/types.d.ts +3 -2
- package/package.json +5 -5
- package/dist/chunk-4WFFCN2C.js.map +0 -1
- package/dist/chunk-AR5RMMMN.js.map +0 -1
- package/dist/chunk-RAZL7ZAW.js +0 -13451
- package/dist/chunk-RAZL7ZAW.js.map +0 -1
- package/dist/chunk-TUOZKHGN.js +0 -21
- package/dist/chunk-TUOZKHGN.js.map +0 -1
- package/dist/chunk-YBW5XDR7.js +0 -48
- package/dist/node-WXHENNL2.js +0 -21
- package/dist/node-WXHENNL2.js.map +0 -1
- package/dist/node-XSTAMDFW.js +0 -2225
- package/dist/node-XSTAMDFW.js.map +0 -1
- package/dist/src-7WDJXP5P.js.map +0 -1
- /package/dist/{chunk-YBW5XDR7.js.map → src-GYA4LFM7.js.map} +0 -0
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import { createRequire } from "node:module"; const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
+
}) : x)(function(x) {
|
|
11
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
+
try {
|
|
16
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
17
|
+
} catch (e) {
|
|
18
|
+
throw mod = 0, e;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var __export = (target, all) => {
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
35
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
36
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
10
41
|
|
|
11
|
-
// node_modules/openai/internal/auth/x509-transport-state.js
|
|
42
|
+
// ../../node_modules/openai/internal/auth/x509-transport-state.js
|
|
12
43
|
var require_x509_transport_state = __commonJS({
|
|
13
|
-
"node_modules/openai/internal/auth/x509-transport-state.js"(exports, module) {
|
|
44
|
+
"../../node_modules/openai/internal/auth/x509-transport-state.js"(exports, module) {
|
|
14
45
|
"use strict";
|
|
15
46
|
if (typeof module !== "undefined" && module !== globalThis.module && typeof exports !== "undefined" && module.exports === exports) {
|
|
16
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -37,7 +68,7 @@ var require_x509_transport_state = __commonJS({
|
|
|
37
68
|
}
|
|
38
69
|
});
|
|
39
70
|
|
|
40
|
-
//
|
|
71
|
+
// ../ai/src/utils/transcript.ts
|
|
41
72
|
function normalizeContext(context) {
|
|
42
73
|
const head = context.systemPrompt || context.tools?.length ? [{ role: "system", content: context.systemPrompt ?? "", toolsAdded: context.tools, timestamp: 0 }] : [];
|
|
43
74
|
return { messages: [...head, ...context.messages] };
|
|
@@ -123,38 +154,6 @@ function getInitialSystemMessage(messages) {
|
|
|
123
154
|
const first = messages[0];
|
|
124
155
|
return first && isSystemMessage(first) ? first : void 0;
|
|
125
156
|
}
|
|
126
|
-
function getCurrentSystemMessage(messages) {
|
|
127
|
-
const content = [];
|
|
128
|
-
const sections = /* @__PURE__ */ new Map();
|
|
129
|
-
let timestamp;
|
|
130
|
-
for (const message of messages) {
|
|
131
|
-
if (!isSystemMessage(message)) continue;
|
|
132
|
-
timestamp ??= message.timestamp;
|
|
133
|
-
const text = contentText(message.content);
|
|
134
|
-
if (text.length > 0) content.push(text);
|
|
135
|
-
for (const [name, value] of Object.entries(message.sections ?? {})) {
|
|
136
|
-
if (value === null) sections.delete(name);
|
|
137
|
-
else sections.set(name, value);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
const tools = getCurrentTools(messages);
|
|
141
|
-
if (timestamp === void 0 && tools.length === 0) return void 0;
|
|
142
|
-
return {
|
|
143
|
-
role: "system",
|
|
144
|
-
content: content.join("\n\n"),
|
|
145
|
-
...sections.size > 0 ? { sections: Object.fromEntries(sections) } : {},
|
|
146
|
-
...tools.length > 0 ? { toolsAdded: tools } : {},
|
|
147
|
-
timestamp: timestamp ?? 0
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
function collapseSystemMessages(context) {
|
|
151
|
-
const head = getCurrentSystemMessage(context.messages);
|
|
152
|
-
const messages = context.messages.filter((message) => message.role !== "system");
|
|
153
|
-
return { messages: head ? [head, ...messages] : messages };
|
|
154
|
-
}
|
|
155
|
-
function resolveTranscript(context, supportsMidConvoSystemMessages) {
|
|
156
|
-
return supportsMidConvoSystemMessages ? context : collapseSystemMessages(context);
|
|
157
|
-
}
|
|
158
157
|
function getDeclaredTools(messages) {
|
|
159
158
|
const definitions = /* @__PURE__ */ new Map();
|
|
160
159
|
for (const message of messages) {
|
|
@@ -177,7 +176,7 @@ function hasToolRedefinitions(messages) {
|
|
|
177
176
|
return false;
|
|
178
177
|
}
|
|
179
178
|
|
|
180
|
-
//
|
|
179
|
+
// ../ai/src/providers/catalog.json
|
|
181
180
|
var catalog_default = {
|
|
182
181
|
"openai-chatgpt": [
|
|
183
182
|
{
|
|
@@ -998,7 +997,7 @@ var catalog_default = {
|
|
|
998
997
|
]
|
|
999
998
|
};
|
|
1000
999
|
|
|
1001
|
-
//
|
|
1000
|
+
// ../ai/src/providers/registry.ts
|
|
1002
1001
|
var providerPresets = [
|
|
1003
1002
|
{
|
|
1004
1003
|
id: "openai-chatgpt",
|
|
@@ -1129,7 +1128,7 @@ function discoverProviderCredentials(env) {
|
|
|
1129
1128
|
});
|
|
1130
1129
|
}
|
|
1131
1130
|
|
|
1132
|
-
//
|
|
1131
|
+
// ../ai/src/providers/discovery.ts
|
|
1133
1132
|
var positive = (value) => typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : void 0;
|
|
1134
1133
|
function normalizeModel(value, input, catalog) {
|
|
1135
1134
|
const item = typeof value === "string" ? { id: value } : value;
|
|
@@ -1305,7 +1304,10 @@ async function fetchProviderModels(input, fetcher = fetch) {
|
|
|
1305
1304
|
}
|
|
1306
1305
|
}
|
|
1307
1306
|
|
|
1308
|
-
//
|
|
1307
|
+
// ../ai/src/api/anthropic-messages.ts
|
|
1308
|
+
import Anthropic from "@anthropic-ai/sdk";
|
|
1309
|
+
|
|
1310
|
+
// ../ai/src/utils/context-breakdown.ts
|
|
1309
1311
|
function measureContextBreakdown(payload) {
|
|
1310
1312
|
const counts = { messages: 0, system_tools: 0, system_prompt: 0, skills: 0, other: 0 };
|
|
1311
1313
|
const rows = Array.isArray(payload.messages) ? payload.messages : Array.isArray(payload.input) ? payload.input : [];
|
|
@@ -1355,7 +1357,7 @@ function measureContextBreakdown(payload) {
|
|
|
1355
1357
|
}));
|
|
1356
1358
|
}
|
|
1357
1359
|
|
|
1358
|
-
//
|
|
1360
|
+
// ../ai/src/utils/cost.ts
|
|
1359
1361
|
function calculateCost(model, usage) {
|
|
1360
1362
|
const inputTokens = usage.input + usage.cacheRead + usage.cacheWrite;
|
|
1361
1363
|
let rates = model.cost;
|
|
@@ -1376,12 +1378,12 @@ function calculateCost(model, usage) {
|
|
|
1376
1378
|
return usage.cost;
|
|
1377
1379
|
}
|
|
1378
1380
|
|
|
1379
|
-
//
|
|
1381
|
+
// ../ai/src/utils/diagnostics.ts
|
|
1380
1382
|
function appendAssistantMessageDiagnostic(message, diagnostic) {
|
|
1381
1383
|
message.diagnostics = [...message.diagnostics ?? [], diagnostic];
|
|
1382
1384
|
}
|
|
1383
1385
|
|
|
1384
|
-
//
|
|
1386
|
+
// ../ai/src/utils/error-body.ts
|
|
1385
1387
|
var MAX_PROVIDER_ERROR_BODY_CHARS = 4e3;
|
|
1386
1388
|
function normalizeProviderError(error) {
|
|
1387
1389
|
if (!(error instanceof Error)) {
|
|
@@ -1449,12 +1451,12 @@ function safeJsonStringify(value) {
|
|
|
1449
1451
|
}
|
|
1450
1452
|
}
|
|
1451
1453
|
|
|
1452
|
-
//
|
|
1454
|
+
// ../ai/src/utils/headers.ts
|
|
1453
1455
|
function headersToRecord(headers) {
|
|
1454
1456
|
return Object.fromEntries(headers.entries());
|
|
1455
1457
|
}
|
|
1456
1458
|
|
|
1457
|
-
//
|
|
1459
|
+
// ../ai/src/utils/json-parse.ts
|
|
1458
1460
|
var VALID_JSON_ESCAPES = /* @__PURE__ */ new Set(['"', "\\", "/", "b", "f", "n", "r", "t"]);
|
|
1459
1461
|
function isControlCharacter(char) {
|
|
1460
1462
|
const codePoint = char.codePointAt(0);
|
|
@@ -1531,7 +1533,7 @@ function parseJsonWithRepair(json) {
|
|
|
1531
1533
|
}
|
|
1532
1534
|
}
|
|
1533
1535
|
|
|
1534
|
-
//
|
|
1536
|
+
// ../ai/src/utils/media-policy.ts
|
|
1535
1537
|
var DEFAULT_MODEL_REQUEST_MEDIA_BUDGET_BYTES = 40 * 1024 * 1024;
|
|
1536
1538
|
var MEDIA_BUDGET_CURRENT_ATTACHMENT_TOO_LARGE = "MEDIA_BUDGET_CURRENT_ATTACHMENT_TOO_LARGE";
|
|
1537
1539
|
var MediaBudgetError = class extends Error {
|
|
@@ -1666,7 +1668,7 @@ function projectCompactMediaForRetry(messages) {
|
|
|
1666
1668
|
return { messages: projected, replacedMediaCount };
|
|
1667
1669
|
}
|
|
1668
1670
|
|
|
1669
|
-
//
|
|
1671
|
+
// ../ai/src/utils/event-stream.ts
|
|
1670
1672
|
var AssistantMessageEventStream = class {
|
|
1671
1673
|
queue = [];
|
|
1672
1674
|
head = 0;
|
|
@@ -1722,7 +1724,7 @@ function createAssistantMessageEventStream() {
|
|
|
1722
1724
|
return new AssistantMessageEventStream();
|
|
1723
1725
|
}
|
|
1724
1726
|
|
|
1725
|
-
//
|
|
1727
|
+
// ../ai/src/utils/model-performance.ts
|
|
1726
1728
|
var MeasuredAssistantStream = class extends AssistantMessageEventStream {
|
|
1727
1729
|
started;
|
|
1728
1730
|
first;
|
|
@@ -1795,7 +1797,7 @@ var MeasuredAssistantStream = class extends AssistantMessageEventStream {
|
|
|
1795
1797
|
}
|
|
1796
1798
|
};
|
|
1797
1799
|
|
|
1798
|
-
//
|
|
1800
|
+
// ../ai/src/utils/model-retry.ts
|
|
1799
1801
|
var TERMINAL_CODES = /* @__PURE__ */ new Set([
|
|
1800
1802
|
"MODEL_RECOVERY_DEADLINE",
|
|
1801
1803
|
"1005",
|
|
@@ -1928,7 +1930,7 @@ function modelFailure(error, signal) {
|
|
|
1928
1930
|
};
|
|
1929
1931
|
}
|
|
1930
1932
|
|
|
1931
|
-
//
|
|
1933
|
+
// ../ai/src/utils/provider-cache.ts
|
|
1932
1934
|
function finalizeProviderCacheControl(messages, options = {}) {
|
|
1933
1935
|
const indexes = messages.flatMap((message, index) => message.role === "system" ? [] : [index]);
|
|
1934
1936
|
const tail = indexes.at(options.skipCacheWrite ? -2 : -1);
|
|
@@ -1951,12 +1953,12 @@ function assertProviderCacheControlLimit(request) {
|
|
|
1951
1953
|
);
|
|
1952
1954
|
}
|
|
1953
1955
|
|
|
1954
|
-
//
|
|
1956
|
+
// ../ai/src/utils/provider-env.ts
|
|
1955
1957
|
function getProviderEnvValue(name, env) {
|
|
1956
1958
|
return env?.[name] || (typeof process !== "undefined" ? process.env[name] : void 0);
|
|
1957
1959
|
}
|
|
1958
1960
|
|
|
1959
|
-
//
|
|
1961
|
+
// ../ai/src/utils/provider-retry.ts
|
|
1960
1962
|
var DEFAULT_MAX_RETRY_DELAY_MS = 6e4;
|
|
1961
1963
|
function isProviderError(error) {
|
|
1962
1964
|
if (!(error instanceof Error) || !("status" in error) || !("headers" in error)) return false;
|
|
@@ -2038,7 +2040,7 @@ async function retryProviderRequest(request, options = {}) {
|
|
|
2038
2040
|
}
|
|
2039
2041
|
}
|
|
2040
2042
|
|
|
2041
|
-
//
|
|
2043
|
+
// ../ai/src/utils/option-map/types.ts
|
|
2042
2044
|
var RestrictedCelError = class extends Error {
|
|
2043
2045
|
offset;
|
|
2044
2046
|
constructor(message, offset) {
|
|
@@ -2048,7 +2050,7 @@ var RestrictedCelError = class extends Error {
|
|
|
2048
2050
|
}
|
|
2049
2051
|
};
|
|
2050
2052
|
|
|
2051
|
-
//
|
|
2053
|
+
// ../ai/src/utils/option-map/evaluator.ts
|
|
2052
2054
|
function evaluateRestrictedCel(expression, input) {
|
|
2053
2055
|
assertRestrictedCelValue(input, expression.offset);
|
|
2054
2056
|
return freezeJson(evaluate(expression, input));
|
|
@@ -2191,7 +2193,7 @@ function isJsonObject2(value) {
|
|
|
2191
2193
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2192
2194
|
}
|
|
2193
2195
|
|
|
2194
|
-
//
|
|
2196
|
+
// ../ai/src/utils/option-map/parser.ts
|
|
2195
2197
|
function parseRestrictedCel(tokens, variableName) {
|
|
2196
2198
|
return new Parser(tokens, variableName).parse();
|
|
2197
2199
|
}
|
|
@@ -2353,7 +2355,7 @@ var Parser = class {
|
|
|
2353
2355
|
}
|
|
2354
2356
|
};
|
|
2355
2357
|
|
|
2356
|
-
//
|
|
2358
|
+
// ../ai/src/utils/option-map/tokenizer.ts
|
|
2357
2359
|
var DOUBLE_OPERATORS = /* @__PURE__ */ new Set(["&&", "||", "==", "!=", "<=", ">="]);
|
|
2358
2360
|
var SINGLE_OPERATORS = /* @__PURE__ */ new Set(["+", "-", "*", "/", "%", "!", "<", ">"]);
|
|
2359
2361
|
var PUNCTUATION = /* @__PURE__ */ new Set(["{", "}", "[", "]", "(", ")", ",", ":", "?", "."]);
|
|
@@ -2469,7 +2471,7 @@ function readWhile(source, offset, pattern) {
|
|
|
2469
2471
|
return cursor;
|
|
2470
2472
|
}
|
|
2471
2473
|
|
|
2472
|
-
//
|
|
2474
|
+
// ../ai/src/utils/option-map/compiler.ts
|
|
2473
2475
|
var optionMapCache = /* @__PURE__ */ new Map();
|
|
2474
2476
|
function compileModelOptionMap(source, variableName) {
|
|
2475
2477
|
const normalizedSource = normalizeSource(source);
|
|
@@ -2518,7 +2520,7 @@ function isJsonObject3(value) {
|
|
|
2518
2520
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2519
2521
|
}
|
|
2520
2522
|
|
|
2521
|
-
//
|
|
2523
|
+
// ../ai/src/utils/reasoning.ts
|
|
2522
2524
|
var reasoningParameterKeys = [
|
|
2523
2525
|
"reasoning_effort",
|
|
2524
2526
|
"thinking",
|
|
@@ -2666,7 +2668,7 @@ function editableReasoningConfig(model) {
|
|
|
2666
2668
|
};
|
|
2667
2669
|
}
|
|
2668
2670
|
|
|
2669
|
-
//
|
|
2671
|
+
// ../ai/src/utils/redact-error.ts
|
|
2670
2672
|
function redactProviderError(message, secrets) {
|
|
2671
2673
|
const values = /* @__PURE__ */ new Set();
|
|
2672
2674
|
for (const secret of secrets) {
|
|
@@ -2680,26 +2682,19 @@ function redactProviderError(message, secrets) {
|
|
|
2680
2682
|
return message;
|
|
2681
2683
|
}
|
|
2682
2684
|
|
|
2683
|
-
//
|
|
2685
|
+
// ../ai/src/utils/sanitize-unicode.ts
|
|
2684
2686
|
function sanitizeSurrogates(text) {
|
|
2685
2687
|
return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
|
|
2686
2688
|
}
|
|
2687
2689
|
|
|
2688
|
-
//
|
|
2689
|
-
function getSystemMessageText(message) {
|
|
2690
|
-
const parts = [contentText(message.content)];
|
|
2691
|
-
for (const text of Object.values(message.sections ?? {})) {
|
|
2692
|
-
if (text !== null) parts.push(text);
|
|
2693
|
-
}
|
|
2694
|
-
return parts.filter((part) => part.length > 0).join("\n\n");
|
|
2695
|
-
}
|
|
2690
|
+
// ../ai/src/utils/text.ts
|
|
2696
2691
|
function renderSystemMessageUpdate(message) {
|
|
2697
2692
|
const parts = [];
|
|
2698
2693
|
const text = contentText(message.content);
|
|
2699
2694
|
if (text.length > 0) parts.push(text);
|
|
2700
2695
|
for (const [name, value] of Object.entries(message.sections ?? {})) {
|
|
2701
2696
|
parts.push(
|
|
2702
|
-
value === null ? `
|
|
2697
|
+
value === null ? `Context block ${JSON.stringify(name)} is withdrawn. All earlier versions of this block no longer apply.` : `Context block ${JSON.stringify(name)} replaces all earlier versions of this block. Apply it until a later context update replaces or withdraws it, including updates carried in user messages:
|
|
2703
2698
|
|
|
2704
2699
|
${value}`
|
|
2705
2700
|
);
|
|
@@ -2707,7 +2702,7 @@ ${value}`
|
|
|
2707
2702
|
return parts.join("\n\n");
|
|
2708
2703
|
}
|
|
2709
2704
|
|
|
2710
|
-
//
|
|
2705
|
+
// ../ai/src/api/constrained-sampling.ts
|
|
2711
2706
|
var UnsupportedStrictJsonSchemaError = class extends Error {
|
|
2712
2707
|
};
|
|
2713
2708
|
var UNSUPPORTED_STRICT_SCHEMA_KEYS = [
|
|
@@ -2832,7 +2827,7 @@ function resolveJsonSchemaStrictSampling(tool, supportsStrictMode) {
|
|
|
2832
2827
|
return void 0;
|
|
2833
2828
|
}
|
|
2834
2829
|
|
|
2835
|
-
//
|
|
2830
|
+
// ../ai/src/api/github-copilot-headers.ts
|
|
2836
2831
|
function inferCopilotInitiator(messages) {
|
|
2837
2832
|
const last = messages[messages.length - 1];
|
|
2838
2833
|
return last && last.role !== "user" ? "agent" : "user";
|
|
@@ -2859,7 +2854,7 @@ function buildCopilotDynamicHeaders(params) {
|
|
|
2859
2854
|
return headers;
|
|
2860
2855
|
}
|
|
2861
2856
|
|
|
2862
|
-
//
|
|
2857
|
+
// ../ai/src/utils/estimate.ts
|
|
2863
2858
|
var CHARS_PER_TOKEN = 4;
|
|
2864
2859
|
var ESTIMATED_IMAGE_CHARS = 4800;
|
|
2865
2860
|
function calculateContextTokens(usage) {
|
|
@@ -2887,7 +2882,7 @@ function estimateTextAndImageContentTokens(content) {
|
|
|
2887
2882
|
function estimateMessageTokens(message) {
|
|
2888
2883
|
let chars = 0;
|
|
2889
2884
|
if (message.role === "system") {
|
|
2890
|
-
return estimateTextTokens(
|
|
2885
|
+
return estimateTextTokens(renderSystemMessageUpdate(message)) + estimateToolsTokens(message.toolsAdded) + estimateToolsTokens(message.toolsRemoved);
|
|
2891
2886
|
}
|
|
2892
2887
|
if (message.role === "user") return estimateTextAndImageContentTokens(message.content);
|
|
2893
2888
|
if (message.role === "toolResult") return estimateTextAndImageContentTokens(message.content);
|
|
@@ -2943,7 +2938,7 @@ function estimateToolsTokens(tools) {
|
|
|
2943
2938
|
return estimateTextTokens(safeJsonStringify2(tools));
|
|
2944
2939
|
}
|
|
2945
2940
|
|
|
2946
|
-
//
|
|
2941
|
+
// ../ai/src/api/simple-options.ts
|
|
2947
2942
|
var CONTEXT_SAFETY_TOKENS = 4096;
|
|
2948
2943
|
var MIN_MAX_TOKENS = 1;
|
|
2949
2944
|
function clampMaxTokensToContext(model, context, maxTokens) {
|
|
@@ -3003,7 +2998,7 @@ function adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens, reasoningLeve
|
|
|
3003
2998
|
return { maxTokens, thinkingBudget };
|
|
3004
2999
|
}
|
|
3005
3000
|
|
|
3006
|
-
//
|
|
3001
|
+
// ../ai/src/api/transform-messages.ts
|
|
3007
3002
|
function transformMessages(messages, model, normalizeId) {
|
|
3008
3003
|
const ids = /* @__PURE__ */ new Map();
|
|
3009
3004
|
const used = /* @__PURE__ */ new Set();
|
|
@@ -3064,10 +3059,25 @@ function transformMessages(messages, model, normalizeId) {
|
|
|
3064
3059
|
if (content.length) result.push({ ...message, content });
|
|
3065
3060
|
}
|
|
3066
3061
|
interrupted();
|
|
3067
|
-
|
|
3062
|
+
const ordered = [];
|
|
3063
|
+
const updates = [];
|
|
3064
|
+
const calls = /* @__PURE__ */ new Set();
|
|
3065
|
+
for (const message of result) {
|
|
3066
|
+
if (message.role === "system" && calls.size) {
|
|
3067
|
+
updates.push(message);
|
|
3068
|
+
continue;
|
|
3069
|
+
}
|
|
3070
|
+
ordered.push(message);
|
|
3071
|
+
if (message.role === "assistant") {
|
|
3072
|
+
for (const block of message.content) if (block.type === "toolCall") calls.add(block.id);
|
|
3073
|
+
}
|
|
3074
|
+
if (message.role === "toolResult") calls.delete(message.toolCallId);
|
|
3075
|
+
if (!calls.size) ordered.push(...updates.splice(0));
|
|
3076
|
+
}
|
|
3077
|
+
return ordered;
|
|
3068
3078
|
}
|
|
3069
3079
|
|
|
3070
|
-
//
|
|
3080
|
+
// ../ai/src/api/anthropic-messages.ts
|
|
3071
3081
|
function resolveCacheRetention(cacheRetention, env) {
|
|
3072
3082
|
if (cacheRetention) {
|
|
3073
3083
|
return cacheRetention;
|
|
@@ -3366,10 +3376,7 @@ async function* iterateAnthropicEvents(response, signal) {
|
|
|
3366
3376
|
}
|
|
3367
3377
|
var stream = (model, context, options) => {
|
|
3368
3378
|
const stream3 = new MeasuredAssistantStream(options);
|
|
3369
|
-
let normalizedContext =
|
|
3370
|
-
context,
|
|
3371
|
-
getAnthropicCompat(model).supportsMidConvoSystemMessages
|
|
3372
|
-
);
|
|
3379
|
+
let normalizedContext = context;
|
|
3373
3380
|
const currentTools = getCurrentTools(normalizedContext.messages);
|
|
3374
3381
|
(async () => {
|
|
3375
3382
|
const providerThinkingLevel = model.compat?.supportsMidConvoEffort ? options?.effort ?? "high" : void 0;
|
|
@@ -3878,10 +3885,10 @@ function buildParams(model, context, isOAuthToken2, options) {
|
|
|
3878
3885
|
const { cacheControl } = getCacheControl(model, options?.cacheRetention, options?.env);
|
|
3879
3886
|
const compat = getAnthropicCompat(model);
|
|
3880
3887
|
const initialSystemMessage = getInitialSystemMessage(context.messages);
|
|
3881
|
-
const initialSystemText = initialSystemMessage ?
|
|
3888
|
+
const initialSystemText = initialSystemMessage ? renderSystemMessageUpdate(initialSystemMessage) : "";
|
|
3882
3889
|
const initialSystemSegments = initialSystemMessage ? [
|
|
3883
3890
|
contentText(initialSystemMessage.content),
|
|
3884
|
-
|
|
3891
|
+
renderSystemMessageUpdate({ ...initialSystemMessage, content: "" })
|
|
3885
3892
|
].filter(Boolean).map((text) => ({
|
|
3886
3893
|
type: "text",
|
|
3887
3894
|
text: sanitizeSurrogates(text),
|
|
@@ -3901,7 +3908,8 @@ function buildParams(model, context, isOAuthToken2, options) {
|
|
|
3901
3908
|
cacheControl,
|
|
3902
3909
|
compat.allowEmptySignature,
|
|
3903
3910
|
model.compat?.supportsMidConvoEffort === true ? model.provider : void 0,
|
|
3904
|
-
nativeToolChanges
|
|
3911
|
+
nativeToolChanges,
|
|
3912
|
+
compat.supportsMidConvoSystemMessages
|
|
3905
3913
|
);
|
|
3906
3914
|
const activeEffort = options?.effort ?? "high";
|
|
3907
3915
|
const betaFeatures = getBetaFeatures(model, context, isOAuthToken2, nativeToolChanges, options);
|
|
@@ -4019,14 +4027,9 @@ function convertToolResult(msg) {
|
|
|
4019
4027
|
is_error: msg.isError
|
|
4020
4028
|
};
|
|
4021
4029
|
}
|
|
4022
|
-
function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allowEmptySignature = false, managedProvider, nativeToolChanges = false) {
|
|
4030
|
+
function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allowEmptySignature = false, managedProvider, nativeToolChanges = false, nativeSystemMessages = false) {
|
|
4023
4031
|
const params = [];
|
|
4024
4032
|
const assistantLevels = /* @__PURE__ */ new Map();
|
|
4025
|
-
const pendingSystemMessages = [];
|
|
4026
|
-
const flushPendingSystemMessages = () => {
|
|
4027
|
-
params.push(...pendingSystemMessages);
|
|
4028
|
-
pendingSystemMessages.length = 0;
|
|
4029
|
-
};
|
|
4030
4033
|
for (let i = 0; i < transformedMessages.length; i++) {
|
|
4031
4034
|
const msg = transformedMessages[i];
|
|
4032
4035
|
const firstParamIndex = params.length;
|
|
@@ -4049,16 +4052,16 @@ function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allow
|
|
|
4049
4052
|
}
|
|
4050
4053
|
}
|
|
4051
4054
|
if (blocks.length > 0) {
|
|
4052
|
-
const pending = { role: "system", content: blocks };
|
|
4055
|
+
const pending = { role: nativeSystemMessages ? "system" : "user", content: blocks };
|
|
4053
4056
|
if (msg.cacheControl && cacheControl) markMessageCacheControl(pending, cacheControl);
|
|
4054
|
-
|
|
4057
|
+
params.push(pending);
|
|
4055
4058
|
}
|
|
4056
4059
|
} else if (msg.role === "user") {
|
|
4057
4060
|
if (typeof msg.content === "string") {
|
|
4058
4061
|
if (msg.content.trim().length > 0) {
|
|
4059
4062
|
params.push({
|
|
4060
4063
|
role: "user",
|
|
4061
|
-
content: sanitizeSurrogates(msg.content)
|
|
4064
|
+
content: [{ type: "text", text: sanitizeSurrogates(msg.content) }]
|
|
4062
4065
|
});
|
|
4063
4066
|
}
|
|
4064
4067
|
} else {
|
|
@@ -4092,7 +4095,6 @@ function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allow
|
|
|
4092
4095
|
});
|
|
4093
4096
|
}
|
|
4094
4097
|
} else if (msg.role === "assistant") {
|
|
4095
|
-
flushPendingSystemMessages();
|
|
4096
4098
|
const blocks = [];
|
|
4097
4099
|
for (const block of msg.content) {
|
|
4098
4100
|
if (block.type === "text") {
|
|
@@ -4167,7 +4169,6 @@ function convertMessages(transformedMessages, isOAuthToken2, cacheControl, allow
|
|
|
4167
4169
|
if (msg.role !== "toolResult" && msg.cacheControl && cacheControl && params.length > firstParamIndex)
|
|
4168
4170
|
markMessageCacheControl(params[params.length - 1], cacheControl);
|
|
4169
4171
|
}
|
|
4170
|
-
flushPendingSystemMessages();
|
|
4171
4172
|
return { messages: params, assistantLevels };
|
|
4172
4173
|
}
|
|
4173
4174
|
function isAnthropicEffort(value) {
|
|
@@ -4250,7 +4251,7 @@ function markMessageCacheControl(message, cacheControl) {
|
|
|
4250
4251
|
}
|
|
4251
4252
|
}
|
|
4252
4253
|
|
|
4253
|
-
// node_modules/openai/internal/tslib.mjs
|
|
4254
|
+
// ../../node_modules/openai/internal/tslib.mjs
|
|
4254
4255
|
function __classPrivateFieldSet(receiver, state2, value, kind, f) {
|
|
4255
4256
|
if (kind === "m")
|
|
4256
4257
|
throw new TypeError("Private method is not writable");
|
|
@@ -4268,7 +4269,7 @@ function __classPrivateFieldGet(receiver, state2, kind, f) {
|
|
|
4268
4269
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state2.get(receiver);
|
|
4269
4270
|
}
|
|
4270
4271
|
|
|
4271
|
-
// node_modules/openai/internal/utils/uuid.mjs
|
|
4272
|
+
// ../../node_modules/openai/internal/utils/uuid.mjs
|
|
4272
4273
|
var uuid4 = function() {
|
|
4273
4274
|
const { crypto: crypto2 } = globalThis;
|
|
4274
4275
|
if (crypto2?.randomUUID) {
|
|
@@ -4280,7 +4281,7 @@ var uuid4 = function() {
|
|
|
4280
4281
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
4281
4282
|
};
|
|
4282
4283
|
|
|
4283
|
-
// node_modules/openai/internal/errors.mjs
|
|
4284
|
+
// ../../node_modules/openai/internal/errors.mjs
|
|
4284
4285
|
function isAbortError(err) {
|
|
4285
4286
|
return typeof err === "object" && err !== null && // Spec-compliant fetch implementations
|
|
4286
4287
|
("name" in err && err.name === "AbortError" || // Expo fetch
|
|
@@ -4312,7 +4313,7 @@ var castToError = (err) => {
|
|
|
4312
4313
|
return new Error(err);
|
|
4313
4314
|
};
|
|
4314
4315
|
|
|
4315
|
-
// node_modules/openai/core/error.mjs
|
|
4316
|
+
// ../../node_modules/openai/core/error.mjs
|
|
4316
4317
|
var OpenAIError = class extends Error {
|
|
4317
4318
|
};
|
|
4318
4319
|
var APIError = class _APIError extends OpenAIError {
|
|
@@ -4446,7 +4447,7 @@ var SubjectTokenProviderError = class extends OpenAIError {
|
|
|
4446
4447
|
}
|
|
4447
4448
|
};
|
|
4448
4449
|
|
|
4449
|
-
// node_modules/openai/internal/utils/values.mjs
|
|
4450
|
+
// ../../node_modules/openai/internal/utils/values.mjs
|
|
4450
4451
|
var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
4451
4452
|
var isAbsoluteURL = (url) => {
|
|
4452
4453
|
return startsWithSchemeRegexp.test(url);
|
|
@@ -4489,7 +4490,7 @@ var safeJSON = (text) => {
|
|
|
4489
4490
|
}
|
|
4490
4491
|
};
|
|
4491
4492
|
|
|
4492
|
-
// node_modules/openai/internal/utils/sleep.mjs
|
|
4493
|
+
// ../../node_modules/openai/internal/utils/sleep.mjs
|
|
4493
4494
|
var sleep = (ms, ...signals) => new Promise((resolve, reject) => {
|
|
4494
4495
|
const activeSignals = [...new Set(signals.filter((signal) => signal != null))];
|
|
4495
4496
|
let timeout;
|
|
@@ -4539,7 +4540,7 @@ var sleep = (ms, ...signals) => new Promise((resolve, reject) => {
|
|
|
4539
4540
|
}
|
|
4540
4541
|
});
|
|
4541
4542
|
|
|
4542
|
-
// node_modules/openai/internal/utils/abort.mjs
|
|
4543
|
+
// ../../node_modules/openai/internal/utils/abort.mjs
|
|
4543
4544
|
var weakGlobals = globalThis;
|
|
4544
4545
|
var finalizer = (
|
|
4545
4546
|
// oxlint-disable-next-line anti-slop/no-runtime-typeof -- Weak references and finalizers are optional host capabilities, so probe them before constructing either.
|
|
@@ -4612,7 +4613,7 @@ function addRequestAbortListener(signal, abort, requestSignal) {
|
|
|
4612
4613
|
return cleanup;
|
|
4613
4614
|
}
|
|
4614
4615
|
|
|
4615
|
-
// node_modules/openai/internal/shims.mjs
|
|
4616
|
+
// ../../node_modules/openai/internal/shims.mjs
|
|
4616
4617
|
function getDefaultFetch() {
|
|
4617
4618
|
if (typeof fetch !== "undefined") {
|
|
4618
4619
|
return fetch;
|
|
@@ -4684,7 +4685,7 @@ async function CancelReadableStream(stream3) {
|
|
|
4684
4685
|
await cancelPromise;
|
|
4685
4686
|
}
|
|
4686
4687
|
|
|
4687
|
-
// node_modules/openai/internal/utils/bytes.mjs
|
|
4688
|
+
// ../../node_modules/openai/internal/utils/bytes.mjs
|
|
4688
4689
|
function concatBytes(buffers) {
|
|
4689
4690
|
let length = 0;
|
|
4690
4691
|
for (const buffer of buffers) {
|
|
@@ -4709,7 +4710,7 @@ function decodeUTF8(bytes) {
|
|
|
4709
4710
|
return (decodeUTF8_ ?? (decoder = new globalThis.TextDecoder(), decodeUTF8_ = decoder.decode.bind(decoder)))(bytes);
|
|
4710
4711
|
}
|
|
4711
4712
|
|
|
4712
|
-
// node_modules/openai/internal/decoders/line.mjs
|
|
4713
|
+
// ../../node_modules/openai/internal/decoders/line.mjs
|
|
4713
4714
|
var _LineDecoder_instances;
|
|
4714
4715
|
var _LineDecoder_buffer;
|
|
4715
4716
|
var _LineDecoder_start;
|
|
@@ -4870,7 +4871,7 @@ function lineEndingLength(buffer, index) {
|
|
|
4870
4871
|
return 0;
|
|
4871
4872
|
}
|
|
4872
4873
|
|
|
4873
|
-
// node_modules/openai/internal/utils/log.mjs
|
|
4874
|
+
// ../../node_modules/openai/internal/utils/log.mjs
|
|
4874
4875
|
var levelNumbers = {
|
|
4875
4876
|
off: 0,
|
|
4876
4877
|
error: 200,
|
|
@@ -5003,7 +5004,7 @@ var formatRequestDetails = (details) => {
|
|
|
5003
5004
|
return details;
|
|
5004
5005
|
};
|
|
5005
5006
|
|
|
5006
|
-
// node_modules/openai/core/streaming.mjs
|
|
5007
|
+
// ../../node_modules/openai/core/streaming.mjs
|
|
5007
5008
|
var _Stream_instances;
|
|
5008
5009
|
var _Stream_client;
|
|
5009
5010
|
var _Stream_isTeeBranch;
|
|
@@ -5590,7 +5591,7 @@ function partition(str, delimiter) {
|
|
|
5590
5591
|
return [str, "", ""];
|
|
5591
5592
|
}
|
|
5592
5593
|
|
|
5593
|
-
// node_modules/openai/internal/parse.mjs
|
|
5594
|
+
// ../../node_modules/openai/internal/parse.mjs
|
|
5594
5595
|
async function defaultParseResponse(client, props) {
|
|
5595
5596
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
5596
5597
|
let jsonBodyLength;
|
|
@@ -5658,10 +5659,10 @@ function addRequestID(value, response) {
|
|
|
5658
5659
|
});
|
|
5659
5660
|
}
|
|
5660
5661
|
|
|
5661
|
-
// node_modules/openai/version.mjs
|
|
5662
|
+
// ../../node_modules/openai/version.mjs
|
|
5662
5663
|
var VERSION = "7.19.0";
|
|
5663
5664
|
|
|
5664
|
-
// node_modules/openai/internal/detect-platform.mjs
|
|
5665
|
+
// ../../node_modules/openai/internal/detect-platform.mjs
|
|
5665
5666
|
var isRunningInBrowser = () => {
|
|
5666
5667
|
return (
|
|
5667
5668
|
// @ts-ignore
|
|
@@ -5795,7 +5796,7 @@ var getPlatformHeaders = () => {
|
|
|
5795
5796
|
return _platformHeaders ?? (_platformHeaders = getPlatformProperties());
|
|
5796
5797
|
};
|
|
5797
5798
|
|
|
5798
|
-
// node_modules/openai/internal/request-options.mjs
|
|
5799
|
+
// ../../node_modules/openai/internal/request-options.mjs
|
|
5799
5800
|
var jsonRequestBodyObservers = /* @__PURE__ */ new WeakMap();
|
|
5800
5801
|
function observeJSONRequestBody(body, observer) {
|
|
5801
5802
|
let observers = jsonRequestBodyObservers.get(body);
|
|
@@ -5844,7 +5845,7 @@ var FallbackEncoder = ({ headers, body }) => {
|
|
|
5844
5845
|
};
|
|
5845
5846
|
};
|
|
5846
5847
|
|
|
5847
|
-
// node_modules/openai/internal/qs/formats.mjs
|
|
5848
|
+
// ../../node_modules/openai/internal/qs/formats.mjs
|
|
5848
5849
|
var default_format = "RFC3986";
|
|
5849
5850
|
var default_formatter = String;
|
|
5850
5851
|
var formatters = {
|
|
@@ -5853,7 +5854,7 @@ var formatters = {
|
|
|
5853
5854
|
};
|
|
5854
5855
|
var RFC1738 = "RFC1738";
|
|
5855
5856
|
|
|
5856
|
-
// node_modules/openai/internal/qs/utils.mjs
|
|
5857
|
+
// ../../node_modules/openai/internal/qs/utils.mjs
|
|
5857
5858
|
var cachedHas;
|
|
5858
5859
|
var has = (obj, key) => {
|
|
5859
5860
|
const resolvedHas = cachedHas ?? Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
@@ -5940,7 +5941,7 @@ function maybe_map(val, fn) {
|
|
|
5940
5941
|
return fn(val);
|
|
5941
5942
|
}
|
|
5942
5943
|
|
|
5943
|
-
// node_modules/openai/internal/qs/stringify.mjs
|
|
5944
|
+
// ../../node_modules/openai/internal/qs/stringify.mjs
|
|
5944
5945
|
var array_prefix_generators = {
|
|
5945
5946
|
brackets(prefix) {
|
|
5946
5947
|
return String(prefix) + "[]";
|
|
@@ -6233,12 +6234,12 @@ function stringify(object, opts = {}) {
|
|
|
6233
6234
|
return joined.length > 0 ? prefix + joined : "";
|
|
6234
6235
|
}
|
|
6235
6236
|
|
|
6236
|
-
// node_modules/openai/internal/utils/query.mjs
|
|
6237
|
+
// ../../node_modules/openai/internal/utils/query.mjs
|
|
6237
6238
|
function stringifyQuery(query) {
|
|
6238
6239
|
return stringify(query, { arrayFormat: "brackets" });
|
|
6239
6240
|
}
|
|
6240
6241
|
|
|
6241
|
-
// node_modules/openai/internal/data-residency.mjs
|
|
6242
|
+
// ../../node_modules/openai/internal/data-residency.mjs
|
|
6242
6243
|
var endpoints = /* @__PURE__ */ new Map([
|
|
6243
6244
|
["global", "https://api.openai.com/v1"],
|
|
6244
6245
|
["us", "https://us.api.openai.com/v1"],
|
|
@@ -6259,7 +6260,7 @@ function resolveDataResidency(options) {
|
|
|
6259
6260
|
return endpoint;
|
|
6260
6261
|
}
|
|
6261
6262
|
|
|
6262
|
-
// node_modules/openai/core/api-promise.mjs
|
|
6263
|
+
// ../../node_modules/openai/core/api-promise.mjs
|
|
6263
6264
|
var _APIPromise_client;
|
|
6264
6265
|
var APIPromise = class _APIPromise extends Promise {
|
|
6265
6266
|
constructor(client, responsePromise, parseResponse2 = defaultParseResponse) {
|
|
@@ -6322,7 +6323,7 @@ var APIPromise = class _APIPromise extends Promise {
|
|
|
6322
6323
|
};
|
|
6323
6324
|
_APIPromise_client = /* @__PURE__ */ new WeakMap();
|
|
6324
6325
|
|
|
6325
|
-
// node_modules/openai/core/pagination.mjs
|
|
6326
|
+
// ../../node_modules/openai/core/pagination.mjs
|
|
6326
6327
|
var _AbstractPage_client;
|
|
6327
6328
|
var AbstractPage = class {
|
|
6328
6329
|
constructor(client, response, body, options) {
|
|
@@ -6513,7 +6514,7 @@ var TokenPage = class extends AbstractPage {
|
|
|
6513
6514
|
}
|
|
6514
6515
|
};
|
|
6515
6516
|
|
|
6516
|
-
// node_modules/openai/auth/workload-identity-auth.mjs
|
|
6517
|
+
// ../../node_modules/openai/auth/workload-identity-auth.mjs
|
|
6517
6518
|
var SUBJECT_TOKEN_TYPES = {
|
|
6518
6519
|
jwt: "urn:ietf:params:oauth:token-type:jwt",
|
|
6519
6520
|
id: "urn:ietf:params:oauth:token-type:id_token"
|
|
@@ -6725,7 +6726,7 @@ var WorkloadIdentityAuth = class _WorkloadIdentityAuth {
|
|
|
6725
6726
|
}
|
|
6726
6727
|
};
|
|
6727
6728
|
|
|
6728
|
-
// node_modules/openai/internal/auth/x509-api-origin.mjs
|
|
6729
|
+
// ../../node_modules/openai/internal/auth/x509-api-origin.mjs
|
|
6729
6730
|
var X509_API_BASE_URL = "https://mtls.api.openai.com/v1";
|
|
6730
6731
|
function assertX509APIOrigin(value) {
|
|
6731
6732
|
let target;
|
|
@@ -6745,7 +6746,7 @@ function assertX509APIOrigin(value) {
|
|
|
6745
6746
|
return target;
|
|
6746
6747
|
}
|
|
6747
6748
|
|
|
6748
|
-
// node_modules/openai/internal/headers.mjs
|
|
6749
|
+
// ../../node_modules/openai/internal/headers.mjs
|
|
6749
6750
|
var brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders");
|
|
6750
6751
|
var httpTokenHeaderName = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
6751
6752
|
function* iterateHeaders(headers) {
|
|
@@ -6811,7 +6812,7 @@ var buildHeaders = (newHeaders) => {
|
|
|
6811
6812
|
return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
|
|
6812
6813
|
};
|
|
6813
6814
|
|
|
6814
|
-
// node_modules/openai/internal/auth/x509-transport-state-browser.mjs
|
|
6815
|
+
// ../../node_modules/openai/internal/auth/x509-transport-state-browser.mjs
|
|
6815
6816
|
var x509_transport_state_browser_exports = {};
|
|
6816
6817
|
__export(x509_transport_state_browser_exports, {
|
|
6817
6818
|
findRegisteredX509Transport: () => findRegisteredX509Transport,
|
|
@@ -6846,7 +6847,7 @@ var findX509OAuthError = WeakMap.prototype.get.bind(approvedX509OAuthErrors);
|
|
|
6846
6847
|
var rememberX509Credential = WeakMap.prototype.set.bind(approvedX509Credentials);
|
|
6847
6848
|
var findX509Credential = WeakMap.prototype.get.bind(approvedX509Credentials);
|
|
6848
6849
|
|
|
6849
|
-
// node_modules/openai/internal/auth/x509-transport-state.mjs
|
|
6850
|
+
// ../../node_modules/openai/internal/auth/x509-transport-state.mjs
|
|
6850
6851
|
var nodeState = __toESM(require_x509_transport_state(), 1);
|
|
6851
6852
|
var state = typeof nodeState.findRegisteredX509Transport === "function" ? nodeState : x509_transport_state_browser_exports;
|
|
6852
6853
|
var {
|
|
@@ -6864,7 +6865,7 @@ var {
|
|
|
6864
6865
|
findX509Credential: findX509Credential2
|
|
6865
6866
|
} = state;
|
|
6866
6867
|
|
|
6867
|
-
// node_modules/openai/internal/auth/x509-transport-registry.mjs
|
|
6868
|
+
// ../../node_modules/openai/internal/auth/x509-transport-registry.mjs
|
|
6868
6869
|
function resolveX509Transport(value) {
|
|
6869
6870
|
if (!value || typeof value !== "object") {
|
|
6870
6871
|
throw new OpenAIError("X.509 workload identity requires an approved X.509 transport capability.");
|
|
@@ -6876,7 +6877,7 @@ function resolveX509Transport(value) {
|
|
|
6876
6877
|
return registered;
|
|
6877
6878
|
}
|
|
6878
6879
|
|
|
6879
|
-
// node_modules/openai/internal/auth/x509-workload-identity-auth.mjs
|
|
6880
|
+
// ../../node_modules/openai/internal/auth/x509-workload-identity-auth.mjs
|
|
6880
6881
|
var _X509WorkloadIdentityAuth_instances;
|
|
6881
6882
|
var _a;
|
|
6882
6883
|
var _X509WorkloadIdentityAuth_identityProviderId;
|
|
@@ -7593,7 +7594,7 @@ _a = X509WorkloadIdentityAuth, _X509WorkloadIdentityAuth_identityProviderId = /*
|
|
|
7593
7594
|
}
|
|
7594
7595
|
};
|
|
7595
7596
|
|
|
7596
|
-
// node_modules/openai/internal/auth/x509-credential-options.mjs
|
|
7597
|
+
// ../../node_modules/openai/internal/auth/x509-credential-options.mjs
|
|
7597
7598
|
function normalizeX509CredentialOptions(options) {
|
|
7598
7599
|
const { credential } = options;
|
|
7599
7600
|
if (credential === void 0) {
|
|
@@ -7693,7 +7694,7 @@ function prepareX509ClientClone(inherited, overrides, credential, currentlyX509)
|
|
|
7693
7694
|
return { credential: nextCredential, provider: prepareProviderClone(inherited, overrides) };
|
|
7694
7695
|
}
|
|
7695
7696
|
|
|
7696
|
-
// node_modules/openai/internal/uploads.mjs
|
|
7697
|
+
// ../../node_modules/openai/internal/uploads.mjs
|
|
7697
7698
|
var brand_privateStreamingFile = /* @__PURE__ */ Symbol("brand.privateStreamingFile");
|
|
7698
7699
|
function toStreamingFile(data, name, options) {
|
|
7699
7700
|
if (typeof name !== "string" || !name) {
|
|
@@ -8035,7 +8036,7 @@ var addFormValue = async (form, key, value, options) => {
|
|
|
8035
8036
|
}
|
|
8036
8037
|
};
|
|
8037
8038
|
|
|
8038
|
-
// node_modules/openai/internal/to-file.mjs
|
|
8039
|
+
// ../../node_modules/openai/internal/to-file.mjs
|
|
8039
8040
|
var isBlobLike = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function";
|
|
8040
8041
|
var isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value);
|
|
8041
8042
|
var isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function";
|
|
@@ -8099,14 +8100,14 @@ function propsForError(value) {
|
|
|
8099
8100
|
return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`;
|
|
8100
8101
|
}
|
|
8101
8102
|
|
|
8102
|
-
// node_modules/openai/core/resource.mjs
|
|
8103
|
+
// ../../node_modules/openai/core/resource.mjs
|
|
8103
8104
|
var APIResource = class {
|
|
8104
8105
|
constructor(client) {
|
|
8105
8106
|
this._client = client;
|
|
8106
8107
|
}
|
|
8107
8108
|
};
|
|
8108
8109
|
|
|
8109
|
-
// node_modules/openai/internal/utils/path.mjs
|
|
8110
|
+
// ../../node_modules/openai/internal/utils/path.mjs
|
|
8110
8111
|
function encodeURIPath(str) {
|
|
8111
8112
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
8112
8113
|
}
|
|
@@ -8168,7 +8169,7 @@ ${underline}`);
|
|
|
8168
8169
|
};
|
|
8169
8170
|
var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
8170
8171
|
|
|
8171
|
-
// node_modules/openai/resources/chat/completions/messages.mjs
|
|
8172
|
+
// ../../node_modules/openai/resources/chat/completions/messages.mjs
|
|
8172
8173
|
var Messages = class extends APIResource {
|
|
8173
8174
|
/**
|
|
8174
8175
|
* Get the messages in a stored chat completion. Only Chat Completions that have
|
|
@@ -8189,7 +8190,7 @@ var Messages = class extends APIResource {
|
|
|
8189
8190
|
}
|
|
8190
8191
|
};
|
|
8191
8192
|
|
|
8192
|
-
// node_modules/openai/lib/parser.mjs
|
|
8193
|
+
// ../../node_modules/openai/lib/parser.mjs
|
|
8193
8194
|
function isChatCompletionFunctionTool(tool) {
|
|
8194
8195
|
return tool !== void 0 && "function" in tool && tool.function !== void 0;
|
|
8195
8196
|
}
|
|
@@ -8311,11 +8312,11 @@ function validateInputTools(tools) {
|
|
|
8311
8312
|
}
|
|
8312
8313
|
}
|
|
8313
8314
|
|
|
8314
|
-
// node_modules/openai/lib/chatCompletionUtils.mjs
|
|
8315
|
+
// ../../node_modules/openai/lib/chatCompletionUtils.mjs
|
|
8315
8316
|
var isAssistantMessage = (message) => message?.role === "assistant";
|
|
8316
8317
|
var isToolMessage = (message) => message?.role === "tool";
|
|
8317
8318
|
|
|
8318
|
-
// node_modules/openai/lib/EventStream.mjs
|
|
8319
|
+
// ../../node_modules/openai/lib/EventStream.mjs
|
|
8319
8320
|
var _EventStream_instances;
|
|
8320
8321
|
var _EventStream_connectedPromise;
|
|
8321
8322
|
var _EventStream_resolveConnectedPromise;
|
|
@@ -9797,12 +9798,12 @@ _EventStream_connectedPromise = /* @__PURE__ */ new WeakMap(), _EventStream_reso
|
|
|
9797
9798
|
}
|
|
9798
9799
|
};
|
|
9799
9800
|
|
|
9800
|
-
// node_modules/openai/lib/RunnableFunction.mjs
|
|
9801
|
+
// ../../node_modules/openai/lib/RunnableFunction.mjs
|
|
9801
9802
|
function isRunnableFunctionWithParse(fn) {
|
|
9802
9803
|
return typeof fn.parse === "function";
|
|
9803
9804
|
}
|
|
9804
9805
|
|
|
9805
|
-
// node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
9806
|
+
// ../../node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
9806
9807
|
var _AbstractChatCompletionRunner_instances;
|
|
9807
9808
|
var _a2;
|
|
9808
9809
|
var _AbstractChatCompletionRunner_completionArrivedBeforeAbort;
|
|
@@ -10235,7 +10236,7 @@ _a2 = AbstractChatCompletionRunner, _AbstractChatCompletionRunner_completionArri
|
|
|
10235
10236
|
return JSON.stringify(rawContent);
|
|
10236
10237
|
};
|
|
10237
10238
|
|
|
10238
|
-
// node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
10239
|
+
// ../../node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
10239
10240
|
var ChatCompletionRunner = class _ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
10240
10241
|
/** Starts a non-streaming tool loop and returns its event-driven conversation runner. */
|
|
10241
10242
|
static runTools(client, params, options) {
|
|
@@ -10259,7 +10260,7 @@ var ChatCompletionRunner = class _ChatCompletionRunner extends AbstractChatCompl
|
|
|
10259
10260
|
}
|
|
10260
10261
|
};
|
|
10261
10262
|
|
|
10262
|
-
// node_modules/openai/_vendor/partial-json-parser/parser.mjs
|
|
10263
|
+
// ../../node_modules/openai/_vendor/partial-json-parser/parser.mjs
|
|
10263
10264
|
var STR = 1;
|
|
10264
10265
|
var NUM = 2;
|
|
10265
10266
|
var ARR = 4;
|
|
@@ -10484,7 +10485,7 @@ var _parseJSON = (jsonString, allow) => {
|
|
|
10484
10485
|
};
|
|
10485
10486
|
var partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM);
|
|
10486
10487
|
|
|
10487
|
-
// node_modules/openai/lib/ChatCompletionStream.mjs
|
|
10488
|
+
// ../../node_modules/openai/lib/ChatCompletionStream.mjs
|
|
10488
10489
|
var _ChatCompletionStream_instances;
|
|
10489
10490
|
var _ChatCompletionStream_params;
|
|
10490
10491
|
var _ChatCompletionStream_rejectsUnfinishedTurns;
|
|
@@ -12028,7 +12029,7 @@ function assertNever(_x) {
|
|
|
12028
12029
|
return _x;
|
|
12029
12030
|
}
|
|
12030
12031
|
|
|
12031
|
-
// node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
12032
|
+
// ../../node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
12032
12033
|
var ChatCompletionStreamingRunner = class _ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
12033
12034
|
/** Restores a serialized tool run, including intermediate completions and tool-result messages. */
|
|
12034
12035
|
static fromReadableStream(stream3) {
|
|
@@ -12083,7 +12084,7 @@ var ChatCompletionStreamingRunner = class _ChatCompletionStreamingRunner extends
|
|
|
12083
12084
|
}
|
|
12084
12085
|
};
|
|
12085
12086
|
|
|
12086
|
-
// node_modules/openai/resources/chat/completions/completions.mjs
|
|
12087
|
+
// ../../node_modules/openai/resources/chat/completions/completions.mjs
|
|
12087
12088
|
var Completions = class extends APIResource {
|
|
12088
12089
|
constructor() {
|
|
12089
12090
|
super(...arguments);
|
|
@@ -12190,7 +12191,7 @@ var Completions = class extends APIResource {
|
|
|
12190
12191
|
};
|
|
12191
12192
|
Completions.Messages = Messages;
|
|
12192
12193
|
|
|
12193
|
-
// node_modules/openai/resources/chat/chat.mjs
|
|
12194
|
+
// ../../node_modules/openai/resources/chat/chat.mjs
|
|
12194
12195
|
var Chat = class extends APIResource {
|
|
12195
12196
|
constructor() {
|
|
12196
12197
|
super(...arguments);
|
|
@@ -12199,7 +12200,7 @@ var Chat = class extends APIResource {
|
|
|
12199
12200
|
};
|
|
12200
12201
|
Chat.Completions = Completions;
|
|
12201
12202
|
|
|
12202
|
-
// node_modules/openai/resources/admin/organization/admin-api-keys.mjs
|
|
12203
|
+
// ../../node_modules/openai/resources/admin/organization/admin-api-keys.mjs
|
|
12203
12204
|
var AdminAPIKeys = class extends APIResource {
|
|
12204
12205
|
/**
|
|
12205
12206
|
* Create an organization admin API key
|
|
@@ -12273,7 +12274,7 @@ var AdminAPIKeys = class extends APIResource {
|
|
|
12273
12274
|
}
|
|
12274
12275
|
};
|
|
12275
12276
|
|
|
12276
|
-
// node_modules/openai/resources/admin/organization/audit-logs.mjs
|
|
12277
|
+
// ../../node_modules/openai/resources/admin/organization/audit-logs.mjs
|
|
12277
12278
|
var AuditLogs = class extends APIResource {
|
|
12278
12279
|
/**
|
|
12279
12280
|
* List user actions and configuration changes within this organization.
|
|
@@ -12295,7 +12296,7 @@ var AuditLogs = class extends APIResource {
|
|
|
12295
12296
|
}
|
|
12296
12297
|
};
|
|
12297
12298
|
|
|
12298
|
-
// node_modules/openai/resources/admin/organization/certificates.mjs
|
|
12299
|
+
// ../../node_modules/openai/resources/admin/organization/certificates.mjs
|
|
12299
12300
|
var Certificates = class extends APIResource {
|
|
12300
12301
|
/**
|
|
12301
12302
|
* Upload a certificate to the organization. This does **not** automatically
|
|
@@ -12432,7 +12433,7 @@ var Certificates = class extends APIResource {
|
|
|
12432
12433
|
}
|
|
12433
12434
|
};
|
|
12434
12435
|
|
|
12435
|
-
// node_modules/openai/resources/admin/organization/data-retention.mjs
|
|
12436
|
+
// ../../node_modules/openai/resources/admin/organization/data-retention.mjs
|
|
12436
12437
|
var DataRetention = class extends APIResource {
|
|
12437
12438
|
/**
|
|
12438
12439
|
* Retrieves organization data retention controls.
|
|
@@ -12469,7 +12470,7 @@ var DataRetention = class extends APIResource {
|
|
|
12469
12470
|
}
|
|
12470
12471
|
};
|
|
12471
12472
|
|
|
12472
|
-
// node_modules/openai/resources/admin/organization/invites.mjs
|
|
12473
|
+
// ../../node_modules/openai/resources/admin/organization/invites.mjs
|
|
12473
12474
|
var Invites = class extends APIResource {
|
|
12474
12475
|
/**
|
|
12475
12476
|
* Create an invite for a user to the organization. The invite must be accepted by
|
|
@@ -12545,7 +12546,7 @@ var Invites = class extends APIResource {
|
|
|
12545
12546
|
}
|
|
12546
12547
|
};
|
|
12547
12548
|
|
|
12548
|
-
// node_modules/openai/resources/admin/organization/roles.mjs
|
|
12549
|
+
// ../../node_modules/openai/resources/admin/organization/roles.mjs
|
|
12549
12550
|
var Roles = class extends APIResource {
|
|
12550
12551
|
/**
|
|
12551
12552
|
* Creates a custom role for the organization.
|
|
@@ -12634,7 +12635,7 @@ var Roles = class extends APIResource {
|
|
|
12634
12635
|
}
|
|
12635
12636
|
};
|
|
12636
12637
|
|
|
12637
|
-
// node_modules/openai/resources/admin/organization/spend-alerts.mjs
|
|
12638
|
+
// ../../node_modules/openai/resources/admin/organization/spend-alerts.mjs
|
|
12638
12639
|
var SpendAlerts = class extends APIResource {
|
|
12639
12640
|
/**
|
|
12640
12641
|
* Creates an organization spend alert.
|
|
@@ -12737,7 +12738,7 @@ var SpendAlerts = class extends APIResource {
|
|
|
12737
12738
|
}
|
|
12738
12739
|
};
|
|
12739
12740
|
|
|
12740
|
-
// node_modules/openai/resources/admin/organization/spend-limit.mjs
|
|
12741
|
+
// ../../node_modules/openai/resources/admin/organization/spend-limit.mjs
|
|
12741
12742
|
var SpendLimit = class extends APIResource {
|
|
12742
12743
|
/**
|
|
12743
12744
|
* Get the organization's hard spend limit.
|
|
@@ -12791,7 +12792,7 @@ var SpendLimit = class extends APIResource {
|
|
|
12791
12792
|
}
|
|
12792
12793
|
};
|
|
12793
12794
|
|
|
12794
|
-
// node_modules/openai/resources/admin/organization/usage.mjs
|
|
12795
|
+
// ../../node_modules/openai/resources/admin/organization/usage.mjs
|
|
12795
12796
|
var Usage = class extends APIResource {
|
|
12796
12797
|
/**
|
|
12797
12798
|
* Get audio speeches usage details for the organization.
|
|
@@ -12993,7 +12994,7 @@ var Usage = class extends APIResource {
|
|
|
12993
12994
|
}
|
|
12994
12995
|
};
|
|
12995
12996
|
|
|
12996
|
-
// node_modules/openai/resources/admin/organization/groups/roles.mjs
|
|
12997
|
+
// ../../node_modules/openai/resources/admin/organization/groups/roles.mjs
|
|
12997
12998
|
var Roles2 = class extends APIResource {
|
|
12998
12999
|
/**
|
|
12999
13000
|
* Assigns an organization role to a group within the organization.
|
|
@@ -13070,7 +13071,7 @@ var Roles2 = class extends APIResource {
|
|
|
13070
13071
|
}
|
|
13071
13072
|
};
|
|
13072
13073
|
|
|
13073
|
-
// node_modules/openai/resources/admin/organization/groups/users.mjs
|
|
13074
|
+
// ../../node_modules/openai/resources/admin/organization/groups/users.mjs
|
|
13074
13075
|
var Users = class extends APIResource {
|
|
13075
13076
|
/**
|
|
13076
13077
|
* Adds a user to a group.
|
|
@@ -13147,7 +13148,7 @@ var Users = class extends APIResource {
|
|
|
13147
13148
|
}
|
|
13148
13149
|
};
|
|
13149
13150
|
|
|
13150
|
-
// node_modules/openai/resources/admin/organization/groups/groups.mjs
|
|
13151
|
+
// ../../node_modules/openai/resources/admin/organization/groups/groups.mjs
|
|
13151
13152
|
var Groups = class extends APIResource {
|
|
13152
13153
|
constructor() {
|
|
13153
13154
|
super(...arguments);
|
|
@@ -13244,7 +13245,7 @@ var Groups = class extends APIResource {
|
|
|
13244
13245
|
Groups.Users = Users;
|
|
13245
13246
|
Groups.Roles = Roles2;
|
|
13246
13247
|
|
|
13247
|
-
// node_modules/openai/resources/admin/organization/projects/api-keys.mjs
|
|
13248
|
+
// ../../node_modules/openai/resources/admin/organization/projects/api-keys.mjs
|
|
13248
13249
|
var APIKeys = class extends APIResource {
|
|
13249
13250
|
/**
|
|
13250
13251
|
* Retrieves an API key in the project.
|
|
@@ -13305,7 +13306,7 @@ var APIKeys = class extends APIResource {
|
|
|
13305
13306
|
}
|
|
13306
13307
|
};
|
|
13307
13308
|
|
|
13308
|
-
// node_modules/openai/resources/admin/organization/projects/certificates.mjs
|
|
13309
|
+
// ../../node_modules/openai/resources/admin/organization/projects/certificates.mjs
|
|
13309
13310
|
var Certificates2 = class extends APIResource {
|
|
13310
13311
|
/**
|
|
13311
13312
|
* List certificates for this project.
|
|
@@ -13362,7 +13363,7 @@ var Certificates2 = class extends APIResource {
|
|
|
13362
13363
|
}
|
|
13363
13364
|
};
|
|
13364
13365
|
|
|
13365
|
-
// node_modules/openai/resources/admin/organization/projects/data-retention.mjs
|
|
13366
|
+
// ../../node_modules/openai/resources/admin/organization/projects/data-retention.mjs
|
|
13366
13367
|
var DataRetention2 = class extends APIResource {
|
|
13367
13368
|
/**
|
|
13368
13369
|
* Retrieves project data retention controls.
|
|
@@ -13402,7 +13403,7 @@ var DataRetention2 = class extends APIResource {
|
|
|
13402
13403
|
}
|
|
13403
13404
|
};
|
|
13404
13405
|
|
|
13405
|
-
// node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.mjs
|
|
13406
|
+
// ../../node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.mjs
|
|
13406
13407
|
var HostedToolPermissions = class extends APIResource {
|
|
13407
13408
|
/**
|
|
13408
13409
|
* Returns hosted tool permissions for a project.
|
|
@@ -13441,7 +13442,7 @@ var HostedToolPermissions = class extends APIResource {
|
|
|
13441
13442
|
}
|
|
13442
13443
|
};
|
|
13443
13444
|
|
|
13444
|
-
// node_modules/openai/resources/admin/organization/projects/model-permissions.mjs
|
|
13445
|
+
// ../../node_modules/openai/resources/admin/organization/projects/model-permissions.mjs
|
|
13445
13446
|
var ModelPermissions = class extends APIResource {
|
|
13446
13447
|
/**
|
|
13447
13448
|
* Returns model permissions for a project.
|
|
@@ -13498,7 +13499,7 @@ var ModelPermissions = class extends APIResource {
|
|
|
13498
13499
|
}
|
|
13499
13500
|
};
|
|
13500
13501
|
|
|
13501
|
-
// node_modules/openai/resources/admin/organization/projects/rate-limits.mjs
|
|
13502
|
+
// ../../node_modules/openai/resources/admin/organization/projects/rate-limits.mjs
|
|
13502
13503
|
var RateLimits = class extends APIResource {
|
|
13503
13504
|
/**
|
|
13504
13505
|
* Returns the rate limits per model for a project.
|
|
@@ -13538,7 +13539,7 @@ var RateLimits = class extends APIResource {
|
|
|
13538
13539
|
}
|
|
13539
13540
|
};
|
|
13540
13541
|
|
|
13541
|
-
// node_modules/openai/resources/admin/organization/projects/roles.mjs
|
|
13542
|
+
// ../../node_modules/openai/resources/admin/organization/projects/roles.mjs
|
|
13542
13543
|
var Roles3 = class extends APIResource {
|
|
13543
13544
|
/**
|
|
13544
13545
|
* Creates a custom role for a project.
|
|
@@ -13639,7 +13640,7 @@ var Roles3 = class extends APIResource {
|
|
|
13639
13640
|
}
|
|
13640
13641
|
};
|
|
13641
13642
|
|
|
13642
|
-
// node_modules/openai/resources/admin/organization/projects/spend-alerts.mjs
|
|
13643
|
+
// ../../node_modules/openai/resources/admin/organization/projects/spend-alerts.mjs
|
|
13643
13644
|
var SpendAlerts2 = class extends APIResource {
|
|
13644
13645
|
/**
|
|
13645
13646
|
* Creates a project spend alert.
|
|
@@ -13753,7 +13754,7 @@ var SpendAlerts2 = class extends APIResource {
|
|
|
13753
13754
|
}
|
|
13754
13755
|
};
|
|
13755
13756
|
|
|
13756
|
-
// node_modules/openai/resources/admin/organization/projects/spend-limit.mjs
|
|
13757
|
+
// ../../node_modules/openai/resources/admin/organization/projects/spend-limit.mjs
|
|
13757
13758
|
var SpendLimit2 = class extends APIResource {
|
|
13758
13759
|
/**
|
|
13759
13760
|
* Get a project's hard spend limit.
|
|
@@ -13814,7 +13815,7 @@ var SpendLimit2 = class extends APIResource {
|
|
|
13814
13815
|
}
|
|
13815
13816
|
};
|
|
13816
13817
|
|
|
13817
|
-
// node_modules/openai/resources/admin/organization/projects/groups/roles.mjs
|
|
13818
|
+
// ../../node_modules/openai/resources/admin/organization/projects/groups/roles.mjs
|
|
13818
13819
|
var Roles4 = class extends APIResource {
|
|
13819
13820
|
/**
|
|
13820
13821
|
* Assigns a project role to a group within a project.
|
|
@@ -13894,7 +13895,7 @@ var Roles4 = class extends APIResource {
|
|
|
13894
13895
|
}
|
|
13895
13896
|
};
|
|
13896
13897
|
|
|
13897
|
-
// node_modules/openai/resources/admin/organization/projects/groups/groups.mjs
|
|
13898
|
+
// ../../node_modules/openai/resources/admin/organization/projects/groups/groups.mjs
|
|
13898
13899
|
var Groups2 = class extends APIResource {
|
|
13899
13900
|
constructor() {
|
|
13900
13901
|
super(...arguments);
|
|
@@ -13977,7 +13978,7 @@ var Groups2 = class extends APIResource {
|
|
|
13977
13978
|
};
|
|
13978
13979
|
Groups2.Roles = Roles4;
|
|
13979
13980
|
|
|
13980
|
-
// node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs
|
|
13981
|
+
// ../../node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs
|
|
13981
13982
|
var APIKeys2 = class extends APIResource {
|
|
13982
13983
|
/**
|
|
13983
13984
|
* Creates an API key for a service account in the project.
|
|
@@ -13997,7 +13998,7 @@ var APIKeys2 = class extends APIResource {
|
|
|
13997
13998
|
}
|
|
13998
13999
|
};
|
|
13999
14000
|
|
|
14000
|
-
// node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs
|
|
14001
|
+
// ../../node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs
|
|
14001
14002
|
var ServiceAccounts = class extends APIResource {
|
|
14002
14003
|
constructor() {
|
|
14003
14004
|
super(...arguments);
|
|
@@ -14096,7 +14097,7 @@ var ServiceAccounts = class extends APIResource {
|
|
|
14096
14097
|
};
|
|
14097
14098
|
ServiceAccounts.APIKeys = APIKeys2;
|
|
14098
14099
|
|
|
14099
|
-
// node_modules/openai/resources/admin/organization/projects/users/roles.mjs
|
|
14100
|
+
// ../../node_modules/openai/resources/admin/organization/projects/users/roles.mjs
|
|
14100
14101
|
var Roles5 = class extends APIResource {
|
|
14101
14102
|
/**
|
|
14102
14103
|
* Assigns a project role to a user within a project.
|
|
@@ -14176,7 +14177,7 @@ var Roles5 = class extends APIResource {
|
|
|
14176
14177
|
}
|
|
14177
14178
|
};
|
|
14178
14179
|
|
|
14179
|
-
// node_modules/openai/resources/admin/organization/projects/users/users.mjs
|
|
14180
|
+
// ../../node_modules/openai/resources/admin/organization/projects/users/users.mjs
|
|
14180
14181
|
var Users2 = class extends APIResource {
|
|
14181
14182
|
constructor() {
|
|
14182
14183
|
super(...arguments);
|
|
@@ -14282,7 +14283,7 @@ var Users2 = class extends APIResource {
|
|
|
14282
14283
|
};
|
|
14283
14284
|
Users2.Roles = Roles5;
|
|
14284
14285
|
|
|
14285
|
-
// node_modules/openai/resources/admin/organization/projects/projects.mjs
|
|
14286
|
+
// ../../node_modules/openai/resources/admin/organization/projects/projects.mjs
|
|
14286
14287
|
var Projects = class extends APIResource {
|
|
14287
14288
|
constructor() {
|
|
14288
14289
|
super(...arguments);
|
|
@@ -14403,7 +14404,7 @@ Projects.SpendLimit = SpendLimit2;
|
|
|
14403
14404
|
Projects.SpendAlerts = SpendAlerts2;
|
|
14404
14405
|
Projects.Certificates = Certificates2;
|
|
14405
14406
|
|
|
14406
|
-
// node_modules/openai/resources/admin/organization/users/roles.mjs
|
|
14407
|
+
// ../../node_modules/openai/resources/admin/organization/users/roles.mjs
|
|
14407
14408
|
var Roles6 = class extends APIResource {
|
|
14408
14409
|
/**
|
|
14409
14410
|
* Assigns an organization role to a user within the organization.
|
|
@@ -14480,7 +14481,7 @@ var Roles6 = class extends APIResource {
|
|
|
14480
14481
|
}
|
|
14481
14482
|
};
|
|
14482
14483
|
|
|
14483
|
-
// node_modules/openai/resources/admin/organization/users/users.mjs
|
|
14484
|
+
// ../../node_modules/openai/resources/admin/organization/users/users.mjs
|
|
14484
14485
|
var Users3 = class extends APIResource {
|
|
14485
14486
|
constructor() {
|
|
14486
14487
|
super(...arguments);
|
|
@@ -14554,7 +14555,7 @@ var Users3 = class extends APIResource {
|
|
|
14554
14555
|
};
|
|
14555
14556
|
Users3.Roles = Roles6;
|
|
14556
14557
|
|
|
14557
|
-
// node_modules/openai/resources/admin/organization/organization.mjs
|
|
14558
|
+
// ../../node_modules/openai/resources/admin/organization/organization.mjs
|
|
14558
14559
|
var Organization = class extends APIResource {
|
|
14559
14560
|
constructor() {
|
|
14560
14561
|
super(...arguments);
|
|
@@ -14585,7 +14586,7 @@ Organization.SpendAlerts = SpendAlerts;
|
|
|
14585
14586
|
Organization.Certificates = Certificates;
|
|
14586
14587
|
Organization.Projects = Projects;
|
|
14587
14588
|
|
|
14588
|
-
// node_modules/openai/resources/admin/admin.mjs
|
|
14589
|
+
// ../../node_modules/openai/resources/admin/admin.mjs
|
|
14589
14590
|
var Admin = class extends APIResource {
|
|
14590
14591
|
constructor() {
|
|
14591
14592
|
super(...arguments);
|
|
@@ -14594,7 +14595,7 @@ var Admin = class extends APIResource {
|
|
|
14594
14595
|
};
|
|
14595
14596
|
Admin.Organization = Organization;
|
|
14596
14597
|
|
|
14597
|
-
// node_modules/openai/resources/audio/speech.mjs
|
|
14598
|
+
// ../../node_modules/openai/resources/audio/speech.mjs
|
|
14598
14599
|
var Speech = class extends APIResource {
|
|
14599
14600
|
/**
|
|
14600
14601
|
* Generates audio from the input text.
|
|
@@ -14624,7 +14625,7 @@ var Speech = class extends APIResource {
|
|
|
14624
14625
|
}
|
|
14625
14626
|
};
|
|
14626
14627
|
|
|
14627
|
-
// node_modules/openai/resources/audio/transcriptions.mjs
|
|
14628
|
+
// ../../node_modules/openai/resources/audio/transcriptions.mjs
|
|
14628
14629
|
var Transcriptions = class extends APIResource {
|
|
14629
14630
|
create(body, options) {
|
|
14630
14631
|
return this._client.post("/audio/transcriptions", multipartFormRequestOptions({
|
|
@@ -14637,14 +14638,14 @@ var Transcriptions = class extends APIResource {
|
|
|
14637
14638
|
}
|
|
14638
14639
|
};
|
|
14639
14640
|
|
|
14640
|
-
// node_modules/openai/resources/audio/translations.mjs
|
|
14641
|
+
// ../../node_modules/openai/resources/audio/translations.mjs
|
|
14641
14642
|
var Translations = class extends APIResource {
|
|
14642
14643
|
create(body, options) {
|
|
14643
14644
|
return this._client.post("/audio/translations", multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model }, __security: { bearerAuth: true } }, this._client));
|
|
14644
14645
|
}
|
|
14645
14646
|
};
|
|
14646
14647
|
|
|
14647
|
-
// node_modules/openai/resources/audio/audio.mjs
|
|
14648
|
+
// ../../node_modules/openai/resources/audio/audio.mjs
|
|
14648
14649
|
var Audio = class extends APIResource {
|
|
14649
14650
|
constructor() {
|
|
14650
14651
|
super(...arguments);
|
|
@@ -14657,7 +14658,7 @@ Audio.Transcriptions = Transcriptions;
|
|
|
14657
14658
|
Audio.Translations = Translations;
|
|
14658
14659
|
Audio.Speech = Speech;
|
|
14659
14660
|
|
|
14660
|
-
// node_modules/openai/resources/batches.mjs
|
|
14661
|
+
// ../../node_modules/openai/resources/batches.mjs
|
|
14661
14662
|
var Batches = class extends APIResource {
|
|
14662
14663
|
/**
|
|
14663
14664
|
* Creates and executes a batch from an uploaded file of requests
|
|
@@ -14694,7 +14695,7 @@ var Batches = class extends APIResource {
|
|
|
14694
14695
|
}
|
|
14695
14696
|
};
|
|
14696
14697
|
|
|
14697
|
-
// node_modules/openai/resources/beta/assistants.mjs
|
|
14698
|
+
// ../../node_modules/openai/resources/beta/assistants.mjs
|
|
14698
14699
|
var Assistants = class extends APIResource {
|
|
14699
14700
|
/**
|
|
14700
14701
|
* Create an assistant with a model and instructions.
|
|
@@ -14761,7 +14762,7 @@ var Assistants = class extends APIResource {
|
|
|
14761
14762
|
}
|
|
14762
14763
|
};
|
|
14763
14764
|
|
|
14764
|
-
// node_modules/openai/resources/beta/realtime/sessions.mjs
|
|
14765
|
+
// ../../node_modules/openai/resources/beta/realtime/sessions.mjs
|
|
14765
14766
|
var Sessions = class extends APIResource {
|
|
14766
14767
|
/**
|
|
14767
14768
|
* Create an ephemeral API token for use in client-side applications with the
|
|
@@ -14788,7 +14789,7 @@ var Sessions = class extends APIResource {
|
|
|
14788
14789
|
}
|
|
14789
14790
|
};
|
|
14790
14791
|
|
|
14791
|
-
// node_modules/openai/resources/beta/realtime/transcription-sessions.mjs
|
|
14792
|
+
// ../../node_modules/openai/resources/beta/realtime/transcription-sessions.mjs
|
|
14792
14793
|
var TranscriptionSessions = class extends APIResource {
|
|
14793
14794
|
/**
|
|
14794
14795
|
* Create an ephemeral API token for use in client-side applications with the
|
|
@@ -14815,7 +14816,7 @@ var TranscriptionSessions = class extends APIResource {
|
|
|
14815
14816
|
}
|
|
14816
14817
|
};
|
|
14817
14818
|
|
|
14818
|
-
// node_modules/openai/resources/beta/realtime/realtime.mjs
|
|
14819
|
+
// ../../node_modules/openai/resources/beta/realtime/realtime.mjs
|
|
14819
14820
|
var Realtime = class extends APIResource {
|
|
14820
14821
|
constructor() {
|
|
14821
14822
|
super(...arguments);
|
|
@@ -14826,7 +14827,7 @@ var Realtime = class extends APIResource {
|
|
|
14826
14827
|
Realtime.Sessions = Sessions;
|
|
14827
14828
|
Realtime.TranscriptionSessions = TranscriptionSessions;
|
|
14828
14829
|
|
|
14829
|
-
// node_modules/openai/resources/beta/agents/environments/files.mjs
|
|
14830
|
+
// ../../node_modules/openai/resources/beta/agents/environments/files.mjs
|
|
14830
14831
|
var Files = class extends APIResource {
|
|
14831
14832
|
/**
|
|
14832
14833
|
* Copies inline bytes or a Files API file into a connected execution environment.
|
|
@@ -14879,7 +14880,7 @@ var Files = class extends APIResource {
|
|
|
14879
14880
|
}
|
|
14880
14881
|
};
|
|
14881
14882
|
|
|
14882
|
-
// node_modules/openai/resources/beta/agents/environments/templates.mjs
|
|
14883
|
+
// ../../node_modules/openai/resources/beta/agents/environments/templates.mjs
|
|
14883
14884
|
var Templates = class extends APIResource {
|
|
14884
14885
|
/**
|
|
14885
14886
|
* Creates reusable environment configuration without returning confidential setup
|
|
@@ -14983,7 +14984,7 @@ var Templates = class extends APIResource {
|
|
|
14983
14984
|
}
|
|
14984
14985
|
};
|
|
14985
14986
|
|
|
14986
|
-
// node_modules/openai/resources/beta/agents/environments/environments.mjs
|
|
14987
|
+
// ../../node_modules/openai/resources/beta/agents/environments/environments.mjs
|
|
14987
14988
|
var Environments = class extends APIResource {
|
|
14988
14989
|
constructor() {
|
|
14989
14990
|
super(...arguments);
|
|
@@ -15014,7 +15015,7 @@ var Environments = class extends APIResource {
|
|
|
15014
15015
|
Environments.Files = Files;
|
|
15015
15016
|
Environments.Templates = Templates;
|
|
15016
15017
|
|
|
15017
|
-
// node_modules/openai/lib/agents/turn-state.mjs
|
|
15018
|
+
// ../../node_modules/openai/lib/agents/turn-state.mjs
|
|
15018
15019
|
var _TurnState_turnID;
|
|
15019
15020
|
var _TurnState_turnEnded;
|
|
15020
15021
|
var _TurnState_eventIDs;
|
|
@@ -15066,7 +15067,7 @@ var TurnState = class {
|
|
|
15066
15067
|
};
|
|
15067
15068
|
_TurnState_turnID = /* @__PURE__ */ new WeakMap(), _TurnState_turnEnded = /* @__PURE__ */ new WeakMap(), _TurnState_eventIDs = /* @__PURE__ */ new WeakMap(), _TurnState_calls = /* @__PURE__ */ new WeakMap();
|
|
15068
15069
|
|
|
15069
|
-
// node_modules/openai/lib/agents/agent-session-stream.mjs
|
|
15070
|
+
// ../../node_modules/openai/lib/agents/agent-session-stream.mjs
|
|
15070
15071
|
var _AgentSessionStream_instances;
|
|
15071
15072
|
var _AgentSessionStream_consumed;
|
|
15072
15073
|
var _AgentSessionStream_stream;
|
|
@@ -15306,7 +15307,7 @@ _AgentSessionStream_iterate = async function* _AgentSessionStream_iterate2() {
|
|
|
15306
15307
|
}
|
|
15307
15308
|
};
|
|
15308
15309
|
|
|
15309
|
-
// node_modules/openai/resources/beta/agents/sessions/artifacts.mjs
|
|
15310
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/artifacts.mjs
|
|
15310
15311
|
var Artifacts = class extends APIResource {
|
|
15311
15312
|
/**
|
|
15312
15313
|
* Retrieves immutable metadata for one durable session artifact. See
|
|
@@ -15404,7 +15405,7 @@ var Artifacts = class extends APIResource {
|
|
|
15404
15405
|
}
|
|
15405
15406
|
};
|
|
15406
15407
|
|
|
15407
|
-
// node_modules/openai/resources/beta/agents/sessions/events.mjs
|
|
15408
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/events.mjs
|
|
15408
15409
|
var Events = class extends APIResource {
|
|
15409
15410
|
/**
|
|
15410
15411
|
* Submits message, cancellation, or tool-result events to a managed agent session.
|
|
@@ -15472,7 +15473,7 @@ var Events = class extends APIResource {
|
|
|
15472
15473
|
}
|
|
15473
15474
|
};
|
|
15474
15475
|
|
|
15475
|
-
// node_modules/openai/resources/beta/agents/sessions/items.mjs
|
|
15476
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/items.mjs
|
|
15476
15477
|
var Items = class extends APIResource {
|
|
15477
15478
|
/**
|
|
15478
15479
|
* Lists items produced by the session's root agent, including its interactions
|
|
@@ -15499,7 +15500,7 @@ var Items = class extends APIResource {
|
|
|
15499
15500
|
}
|
|
15500
15501
|
};
|
|
15501
15502
|
|
|
15502
|
-
// node_modules/openai/resources/beta/agents/sessions/turns.mjs
|
|
15503
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/turns.mjs
|
|
15503
15504
|
var Turns = class extends APIResource {
|
|
15504
15505
|
/**
|
|
15505
15506
|
* Retrieves a turn's current status, timestamps, usage, and error. Returns 404 if
|
|
@@ -15548,7 +15549,7 @@ var Turns = class extends APIResource {
|
|
|
15548
15549
|
}
|
|
15549
15550
|
};
|
|
15550
15551
|
|
|
15551
|
-
// node_modules/openai/resources/beta/agents/sessions/subagents/items.mjs
|
|
15552
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/subagents/items.mjs
|
|
15552
15553
|
var Items2 = class extends APIResource {
|
|
15553
15554
|
/**
|
|
15554
15555
|
* Lists this subagent's own items across all of its turns. See
|
|
@@ -15576,7 +15577,7 @@ var Items2 = class extends APIResource {
|
|
|
15576
15577
|
}
|
|
15577
15578
|
};
|
|
15578
15579
|
|
|
15579
|
-
// node_modules/openai/resources/beta/agents/sessions/subagents/turns/items.mjs
|
|
15580
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/subagents/turns/items.mjs
|
|
15580
15581
|
var Items3 = class extends APIResource {
|
|
15581
15582
|
/**
|
|
15582
15583
|
* Lists items belonging to one turn of this subagent. See
|
|
@@ -15604,7 +15605,7 @@ var Items3 = class extends APIResource {
|
|
|
15604
15605
|
}
|
|
15605
15606
|
};
|
|
15606
15607
|
|
|
15607
|
-
// node_modules/openai/resources/beta/agents/sessions/subagents/turns/turns.mjs
|
|
15608
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/subagents/turns/turns.mjs
|
|
15608
15609
|
var Turns2 = class extends APIResource {
|
|
15609
15610
|
constructor() {
|
|
15610
15611
|
super(...arguments);
|
|
@@ -15661,7 +15662,7 @@ var Turns2 = class extends APIResource {
|
|
|
15661
15662
|
};
|
|
15662
15663
|
Turns2.Items = Items3;
|
|
15663
15664
|
|
|
15664
|
-
// node_modules/openai/resources/beta/agents/sessions/subagents/subagents.mjs
|
|
15665
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/subagents/subagents.mjs
|
|
15665
15666
|
var Subagents = class extends APIResource {
|
|
15666
15667
|
constructor() {
|
|
15667
15668
|
super(...arguments);
|
|
@@ -15715,7 +15716,7 @@ var Subagents = class extends APIResource {
|
|
|
15715
15716
|
Subagents.Items = Items2;
|
|
15716
15717
|
Subagents.Turns = Turns2;
|
|
15717
15718
|
|
|
15718
|
-
// node_modules/openai/resources/beta/agents/sessions/sessions.mjs
|
|
15719
|
+
// ../../node_modules/openai/resources/beta/agents/sessions/sessions.mjs
|
|
15719
15720
|
var Sessions2 = class extends APIResource {
|
|
15720
15721
|
constructor() {
|
|
15721
15722
|
super(...arguments);
|
|
@@ -15822,7 +15823,7 @@ Sessions2.Items = Items;
|
|
|
15822
15823
|
Sessions2.Events = Events;
|
|
15823
15824
|
Sessions2.Turns = Turns;
|
|
15824
15825
|
|
|
15825
|
-
// node_modules/openai/resources/beta/agents/vaults/credentials.mjs
|
|
15826
|
+
// ../../node_modules/openai/resources/beta/agents/vaults/credentials.mjs
|
|
15826
15827
|
var Credentials = class extends APIResource {
|
|
15827
15828
|
/**
|
|
15828
15829
|
* Creates a vault credential. Secret values are write-only and are never returned.
|
|
@@ -15946,7 +15947,7 @@ var Credentials = class extends APIResource {
|
|
|
15946
15947
|
}
|
|
15947
15948
|
};
|
|
15948
15949
|
|
|
15949
|
-
// node_modules/openai/resources/beta/agents/vaults/vaults.mjs
|
|
15950
|
+
// ../../node_modules/openai/resources/beta/agents/vaults/vaults.mjs
|
|
15950
15951
|
var Vaults = class extends APIResource {
|
|
15951
15952
|
constructor() {
|
|
15952
15953
|
super(...arguments);
|
|
@@ -16028,7 +16029,7 @@ var Vaults = class extends APIResource {
|
|
|
16028
16029
|
};
|
|
16029
16030
|
Vaults.Credentials = Credentials;
|
|
16030
16031
|
|
|
16031
|
-
// node_modules/openai/resources/beta/agents/agents.mjs
|
|
16032
|
+
// ../../node_modules/openai/resources/beta/agents/agents.mjs
|
|
16032
16033
|
var Agents = class extends APIResource {
|
|
16033
16034
|
constructor() {
|
|
16034
16035
|
super(...arguments);
|
|
@@ -16131,7 +16132,7 @@ Agents.Environments = Environments;
|
|
|
16131
16132
|
Agents.Vaults = Vaults;
|
|
16132
16133
|
Agents.Sessions = Sessions2;
|
|
16133
16134
|
|
|
16134
|
-
// node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
16135
|
+
// ../../node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
16135
16136
|
var Sessions3 = class extends APIResource {
|
|
16136
16137
|
/**
|
|
16137
16138
|
* Create a ChatKit session.
|
|
@@ -16173,7 +16174,7 @@ var Sessions3 = class extends APIResource {
|
|
|
16173
16174
|
}
|
|
16174
16175
|
};
|
|
16175
16176
|
|
|
16176
|
-
// node_modules/openai/resources/beta/chatkit/threads.mjs
|
|
16177
|
+
// ../../node_modules/openai/resources/beta/chatkit/threads.mjs
|
|
16177
16178
|
var Threads = class extends APIResource {
|
|
16178
16179
|
/**
|
|
16179
16180
|
* Retrieve a ChatKit thread by its identifier.
|
|
@@ -16250,7 +16251,7 @@ var Threads = class extends APIResource {
|
|
|
16250
16251
|
}
|
|
16251
16252
|
};
|
|
16252
16253
|
|
|
16253
|
-
// node_modules/openai/resources/beta/chatkit/chatkit.mjs
|
|
16254
|
+
// ../../node_modules/openai/resources/beta/chatkit/chatkit.mjs
|
|
16254
16255
|
var ChatKit = class extends APIResource {
|
|
16255
16256
|
constructor() {
|
|
16256
16257
|
super(...arguments);
|
|
@@ -16261,7 +16262,7 @@ var ChatKit = class extends APIResource {
|
|
|
16261
16262
|
ChatKit.Sessions = Sessions3;
|
|
16262
16263
|
ChatKit.Threads = Threads;
|
|
16263
16264
|
|
|
16264
|
-
// node_modules/openai/resources/beta/responses/input-items.mjs
|
|
16265
|
+
// ../../node_modules/openai/resources/beta/responses/input-items.mjs
|
|
16265
16266
|
var InputItems = class extends APIResource {
|
|
16266
16267
|
/**
|
|
16267
16268
|
* Returns a list of input items for a given response.
|
|
@@ -16290,7 +16291,7 @@ var InputItems = class extends APIResource {
|
|
|
16290
16291
|
}
|
|
16291
16292
|
};
|
|
16292
16293
|
|
|
16293
|
-
// node_modules/openai/resources/beta/responses/input-tokens.mjs
|
|
16294
|
+
// ../../node_modules/openai/resources/beta/responses/input-tokens.mjs
|
|
16294
16295
|
var InputTokens = class extends APIResource {
|
|
16295
16296
|
/**
|
|
16296
16297
|
* Returns input token counts of the request.
|
|
@@ -16318,7 +16319,7 @@ var InputTokens = class extends APIResource {
|
|
|
16318
16319
|
}
|
|
16319
16320
|
};
|
|
16320
16321
|
|
|
16321
|
-
// node_modules/openai/resources/beta/responses/responses.mjs
|
|
16322
|
+
// ../../node_modules/openai/resources/beta/responses/responses.mjs
|
|
16322
16323
|
var Responses = class extends APIResource {
|
|
16323
16324
|
constructor() {
|
|
16324
16325
|
super(...arguments);
|
|
@@ -16427,7 +16428,7 @@ var Responses = class extends APIResource {
|
|
|
16427
16428
|
Responses.InputItems = InputItems;
|
|
16428
16429
|
Responses.InputTokens = InputTokens;
|
|
16429
16430
|
|
|
16430
|
-
// node_modules/openai/resources/beta/threads/messages.mjs
|
|
16431
|
+
// ../../node_modules/openai/resources/beta/threads/messages.mjs
|
|
16431
16432
|
var Messages2 = class extends APIResource {
|
|
16432
16433
|
/**
|
|
16433
16434
|
* Create a message.
|
|
@@ -16497,7 +16498,7 @@ var Messages2 = class extends APIResource {
|
|
|
16497
16498
|
}
|
|
16498
16499
|
};
|
|
16499
16500
|
|
|
16500
|
-
// node_modules/openai/resources/beta/threads/runs/steps.mjs
|
|
16501
|
+
// ../../node_modules/openai/resources/beta/threads/runs/steps.mjs
|
|
16501
16502
|
var Steps = class extends APIResource {
|
|
16502
16503
|
/**
|
|
16503
16504
|
* Retrieves a run step.
|
|
@@ -16529,7 +16530,7 @@ var Steps = class extends APIResource {
|
|
|
16529
16530
|
}
|
|
16530
16531
|
};
|
|
16531
16532
|
|
|
16532
|
-
// node_modules/openai/internal/utils/base64.mjs
|
|
16533
|
+
// ../../node_modules/openai/internal/utils/base64.mjs
|
|
16533
16534
|
var fromBase64 = (str) => {
|
|
16534
16535
|
if (typeof globalThis.Buffer !== "undefined") {
|
|
16535
16536
|
const buf = globalThis.Buffer.from(str, "base64");
|
|
@@ -16563,7 +16564,7 @@ var toFloat32Array = (base64Str) => {
|
|
|
16563
16564
|
}
|
|
16564
16565
|
};
|
|
16565
16566
|
|
|
16566
|
-
// node_modules/openai/internal/utils/env.mjs
|
|
16567
|
+
// ../../node_modules/openai/internal/utils/env.mjs
|
|
16567
16568
|
var readEnv = (env) => {
|
|
16568
16569
|
try {
|
|
16569
16570
|
if (typeof globalThis.process !== "undefined") {
|
|
@@ -16578,7 +16579,7 @@ var readEnv = (env) => {
|
|
|
16578
16579
|
return void 0;
|
|
16579
16580
|
};
|
|
16580
16581
|
|
|
16581
|
-
// node_modules/openai/internal/assistant-stream-delta.mjs
|
|
16582
|
+
// ../../node_modules/openai/internal/assistant-stream-delta.mjs
|
|
16582
16583
|
var MAX_ASSISTANT_STREAM_ARRAY_GROWTH = 1024;
|
|
16583
16584
|
var MAX_EXTERNALLY_MUTABLE_ASSISTANT_STREAM_ARRAY_LENGTH = 65536;
|
|
16584
16585
|
function getAssistantStreamDiagnosticProperty(property) {
|
|
@@ -16861,7 +16862,7 @@ function createAssistantStreamArrayDeltaCommit(accumulator, delta, kind, cacheAr
|
|
|
16861
16862
|
return () => commitAssistantStreamArrayProjection(projection);
|
|
16862
16863
|
}
|
|
16863
16864
|
|
|
16864
|
-
// node_modules/openai/lib/AssistantStream.mjs
|
|
16865
|
+
// ../../node_modules/openai/lib/AssistantStream.mjs
|
|
16865
16866
|
var _AssistantStream_instances;
|
|
16866
16867
|
var _AssistantStream_runStepSnapshots;
|
|
16867
16868
|
var _AssistantStream_runStepIDOwners;
|
|
@@ -17555,7 +17556,7 @@ function assertNever2(_x) {
|
|
|
17555
17556
|
return _x;
|
|
17556
17557
|
}
|
|
17557
17558
|
|
|
17558
|
-
// node_modules/openai/lib/polling.mjs
|
|
17559
|
+
// ../../node_modules/openai/lib/polling.mjs
|
|
17559
17560
|
function sleepUntilAborted(milliseconds, signal) {
|
|
17560
17561
|
return new Promise((resolve, reject) => {
|
|
17561
17562
|
let timer;
|
|
@@ -17660,7 +17661,7 @@ async function pollWithResponse(retrieve, intermediateStatuses, terminalStatuses
|
|
|
17660
17661
|
}
|
|
17661
17662
|
}
|
|
17662
17663
|
|
|
17663
|
-
// node_modules/openai/lib/assistant-run-polling.mjs
|
|
17664
|
+
// ../../node_modules/openai/lib/assistant-run-polling.mjs
|
|
17664
17665
|
function pollAssistantRun(resource, runID, params, options) {
|
|
17665
17666
|
return pollWithResponse((headers) => resource.retrieve(runID, params, {
|
|
17666
17667
|
...options,
|
|
@@ -17668,7 +17669,7 @@ function pollAssistantRun(resource, runID, params, options) {
|
|
|
17668
17669
|
}), ["queued", "in_progress", "cancelling"], ["requires_action", "incomplete", "cancelled", "completed", "failed", "expired"], options);
|
|
17669
17670
|
}
|
|
17670
17671
|
|
|
17671
|
-
// node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
17672
|
+
// ../../node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
17672
17673
|
var Runs = class extends APIResource {
|
|
17673
17674
|
constructor() {
|
|
17674
17675
|
super(...arguments);
|
|
@@ -17801,7 +17802,7 @@ var Runs = class extends APIResource {
|
|
|
17801
17802
|
};
|
|
17802
17803
|
Runs.Steps = Steps;
|
|
17803
17804
|
|
|
17804
|
-
// node_modules/openai/resources/beta/threads/threads.mjs
|
|
17805
|
+
// ../../node_modules/openai/resources/beta/threads/threads.mjs
|
|
17805
17806
|
var Threads2 = class extends APIResource {
|
|
17806
17807
|
constructor() {
|
|
17807
17808
|
super(...arguments);
|
|
@@ -17887,7 +17888,7 @@ var Threads2 = class extends APIResource {
|
|
|
17887
17888
|
Threads2.Runs = Runs;
|
|
17888
17889
|
Threads2.Messages = Messages2;
|
|
17889
17890
|
|
|
17890
|
-
// node_modules/openai/resources/beta/beta.mjs
|
|
17891
|
+
// ../../node_modules/openai/resources/beta/beta.mjs
|
|
17891
17892
|
var Beta = class extends APIResource {
|
|
17892
17893
|
constructor() {
|
|
17893
17894
|
super(...arguments);
|
|
@@ -17906,7 +17907,7 @@ Beta.ChatKit = ChatKit;
|
|
|
17906
17907
|
Beta.Assistants = Assistants;
|
|
17907
17908
|
Beta.Threads = Threads2;
|
|
17908
17909
|
|
|
17909
|
-
// node_modules/openai/resources/completions.mjs
|
|
17910
|
+
// ../../node_modules/openai/resources/completions.mjs
|
|
17910
17911
|
var Completions2 = class extends APIResource {
|
|
17911
17912
|
create(body, options) {
|
|
17912
17913
|
return this._client.post("/completions", {
|
|
@@ -17918,7 +17919,7 @@ var Completions2 = class extends APIResource {
|
|
|
17918
17919
|
}
|
|
17919
17920
|
};
|
|
17920
17921
|
|
|
17921
|
-
// node_modules/openai/resources/containers/files/content.mjs
|
|
17922
|
+
// ../../node_modules/openai/resources/containers/files/content.mjs
|
|
17922
17923
|
var Content = class extends APIResource {
|
|
17923
17924
|
/**
|
|
17924
17925
|
* Retrieve Container File Content
|
|
@@ -17934,7 +17935,7 @@ var Content = class extends APIResource {
|
|
|
17934
17935
|
}
|
|
17935
17936
|
};
|
|
17936
17937
|
|
|
17937
|
-
// node_modules/openai/resources/containers/files/files.mjs
|
|
17938
|
+
// ../../node_modules/openai/resources/containers/files/files.mjs
|
|
17938
17939
|
var Files2 = class extends APIResource {
|
|
17939
17940
|
constructor() {
|
|
17940
17941
|
super(...arguments);
|
|
@@ -17983,7 +17984,7 @@ var Files2 = class extends APIResource {
|
|
|
17983
17984
|
};
|
|
17984
17985
|
Files2.Content = Content;
|
|
17985
17986
|
|
|
17986
|
-
// node_modules/openai/resources/containers/containers.mjs
|
|
17987
|
+
// ../../node_modules/openai/resources/containers/containers.mjs
|
|
17987
17988
|
var Containers = class extends APIResource {
|
|
17988
17989
|
constructor() {
|
|
17989
17990
|
super(...arguments);
|
|
@@ -18027,7 +18028,7 @@ var Containers = class extends APIResource {
|
|
|
18027
18028
|
};
|
|
18028
18029
|
Containers.Files = Files2;
|
|
18029
18030
|
|
|
18030
|
-
// node_modules/openai/resources/content-provenance-checks.mjs
|
|
18031
|
+
// ../../node_modules/openai/resources/content-provenance-checks.mjs
|
|
18031
18032
|
var ContentProvenanceChecks = class extends APIResource {
|
|
18032
18033
|
/**
|
|
18033
18034
|
* Check whether an image or audio file contains known OpenAI provenance signals.
|
|
@@ -18045,7 +18046,7 @@ var ContentProvenanceChecks = class extends APIResource {
|
|
|
18045
18046
|
}
|
|
18046
18047
|
};
|
|
18047
18048
|
|
|
18048
|
-
// node_modules/openai/resources/conversations/items.mjs
|
|
18049
|
+
// ../../node_modules/openai/resources/conversations/items.mjs
|
|
18049
18050
|
var Items4 = class extends APIResource {
|
|
18050
18051
|
/**
|
|
18051
18052
|
* Create items in a conversation with the given ID.
|
|
@@ -18088,7 +18089,7 @@ var Items4 = class extends APIResource {
|
|
|
18088
18089
|
}
|
|
18089
18090
|
};
|
|
18090
18091
|
|
|
18091
|
-
// node_modules/openai/resources/conversations/conversations.mjs
|
|
18092
|
+
// ../../node_modules/openai/resources/conversations/conversations.mjs
|
|
18092
18093
|
var Conversations = class extends APIResource {
|
|
18093
18094
|
constructor() {
|
|
18094
18095
|
super(...arguments);
|
|
@@ -18131,7 +18132,7 @@ var Conversations = class extends APIResource {
|
|
|
18131
18132
|
};
|
|
18132
18133
|
Conversations.Items = Items4;
|
|
18133
18134
|
|
|
18134
|
-
// node_modules/openai/lib/embeddings.mjs
|
|
18135
|
+
// ../../node_modules/openai/lib/embeddings.mjs
|
|
18135
18136
|
function createEmbedding(client, body, options) {
|
|
18136
18137
|
const hasUserProvidedEncodingFormat = !!body.encoding_format;
|
|
18137
18138
|
const encodingFormat = hasUserProvidedEncodingFormat ? body.encoding_format : "base64";
|
|
@@ -18171,14 +18172,14 @@ function createEmbedding(client, body, options) {
|
|
|
18171
18172
|
});
|
|
18172
18173
|
}
|
|
18173
18174
|
|
|
18174
|
-
// node_modules/openai/resources/embeddings.mjs
|
|
18175
|
+
// ../../node_modules/openai/resources/embeddings.mjs
|
|
18175
18176
|
var Embeddings = class extends APIResource {
|
|
18176
18177
|
create(body, options) {
|
|
18177
18178
|
return createEmbedding(this._client, body, options);
|
|
18178
18179
|
}
|
|
18179
18180
|
};
|
|
18180
18181
|
|
|
18181
|
-
// node_modules/openai/resources/evals/runs/output-items.mjs
|
|
18182
|
+
// ../../node_modules/openai/resources/evals/runs/output-items.mjs
|
|
18182
18183
|
var OutputItems = class extends APIResource {
|
|
18183
18184
|
/**
|
|
18184
18185
|
* Get an evaluation run output item by ID.
|
|
@@ -18199,7 +18200,7 @@ var OutputItems = class extends APIResource {
|
|
|
18199
18200
|
}
|
|
18200
18201
|
};
|
|
18201
18202
|
|
|
18202
|
-
// node_modules/openai/resources/evals/runs/runs.mjs
|
|
18203
|
+
// ../../node_modules/openai/resources/evals/runs/runs.mjs
|
|
18203
18204
|
var Runs2 = class extends APIResource {
|
|
18204
18205
|
constructor() {
|
|
18205
18206
|
super(...arguments);
|
|
@@ -18260,7 +18261,7 @@ var Runs2 = class extends APIResource {
|
|
|
18260
18261
|
};
|
|
18261
18262
|
Runs2.OutputItems = OutputItems;
|
|
18262
18263
|
|
|
18263
|
-
// node_modules/openai/resources/evals/evals.mjs
|
|
18264
|
+
// ../../node_modules/openai/resources/evals/evals.mjs
|
|
18264
18265
|
var Evals = class extends APIResource {
|
|
18265
18266
|
constructor() {
|
|
18266
18267
|
super(...arguments);
|
|
@@ -18308,7 +18309,7 @@ var Evals = class extends APIResource {
|
|
|
18308
18309
|
};
|
|
18309
18310
|
Evals.Runs = Runs2;
|
|
18310
18311
|
|
|
18311
|
-
// node_modules/openai/lib/file-processing.mjs
|
|
18312
|
+
// ../../node_modules/openai/lib/file-processing.mjs
|
|
18312
18313
|
async function waitForFileProcessing(resource, id, pollInterval, maxWait) {
|
|
18313
18314
|
const terminalStates = /* @__PURE__ */ new Set(["processed", "error", "deleted"]);
|
|
18314
18315
|
const start = performance.now();
|
|
@@ -18325,7 +18326,7 @@ async function waitForFileProcessing(resource, id, pollInterval, maxWait) {
|
|
|
18325
18326
|
return file;
|
|
18326
18327
|
}
|
|
18327
18328
|
|
|
18328
|
-
// node_modules/openai/resources/files.mjs
|
|
18329
|
+
// ../../node_modules/openai/resources/files.mjs
|
|
18329
18330
|
var Files3 = class extends APIResource {
|
|
18330
18331
|
/**
|
|
18331
18332
|
* Upload a file that can be used across various endpoints. Individual files can be
|
|
@@ -18400,11 +18401,11 @@ var Files3 = class extends APIResource {
|
|
|
18400
18401
|
}
|
|
18401
18402
|
};
|
|
18402
18403
|
|
|
18403
|
-
// node_modules/openai/resources/fine-tuning/methods.mjs
|
|
18404
|
+
// ../../node_modules/openai/resources/fine-tuning/methods.mjs
|
|
18404
18405
|
var Methods = class extends APIResource {
|
|
18405
18406
|
};
|
|
18406
18407
|
|
|
18407
|
-
// node_modules/openai/resources/fine-tuning/alpha/graders.mjs
|
|
18408
|
+
// ../../node_modules/openai/resources/fine-tuning/alpha/graders.mjs
|
|
18408
18409
|
var Graders = class extends APIResource {
|
|
18409
18410
|
/**
|
|
18410
18411
|
* Run a grader.
|
|
@@ -18456,7 +18457,7 @@ var Graders = class extends APIResource {
|
|
|
18456
18457
|
}
|
|
18457
18458
|
};
|
|
18458
18459
|
|
|
18459
|
-
// node_modules/openai/resources/fine-tuning/alpha/alpha.mjs
|
|
18460
|
+
// ../../node_modules/openai/resources/fine-tuning/alpha/alpha.mjs
|
|
18460
18461
|
var Alpha = class extends APIResource {
|
|
18461
18462
|
constructor() {
|
|
18462
18463
|
super(...arguments);
|
|
@@ -18465,7 +18466,7 @@ var Alpha = class extends APIResource {
|
|
|
18465
18466
|
};
|
|
18466
18467
|
Alpha.Graders = Graders;
|
|
18467
18468
|
|
|
18468
|
-
// node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
18469
|
+
// ../../node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
18469
18470
|
var Permissions = class extends APIResource {
|
|
18470
18471
|
/**
|
|
18471
18472
|
* **NOTE:** Calling this endpoint requires an
|
|
@@ -18549,7 +18550,7 @@ var Permissions = class extends APIResource {
|
|
|
18549
18550
|
}
|
|
18550
18551
|
};
|
|
18551
18552
|
|
|
18552
|
-
// node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs
|
|
18553
|
+
// ../../node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs
|
|
18553
18554
|
var Checkpoints = class extends APIResource {
|
|
18554
18555
|
constructor() {
|
|
18555
18556
|
super(...arguments);
|
|
@@ -18558,7 +18559,7 @@ var Checkpoints = class extends APIResource {
|
|
|
18558
18559
|
};
|
|
18559
18560
|
Checkpoints.Permissions = Permissions;
|
|
18560
18561
|
|
|
18561
|
-
// node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
18562
|
+
// ../../node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
18562
18563
|
var Checkpoints2 = class extends APIResource {
|
|
18563
18564
|
/**
|
|
18564
18565
|
* List checkpoints for a fine-tuning job.
|
|
@@ -18578,7 +18579,7 @@ var Checkpoints2 = class extends APIResource {
|
|
|
18578
18579
|
}
|
|
18579
18580
|
};
|
|
18580
18581
|
|
|
18581
|
-
// node_modules/openai/resources/fine-tuning/jobs/jobs.mjs
|
|
18582
|
+
// ../../node_modules/openai/resources/fine-tuning/jobs/jobs.mjs
|
|
18582
18583
|
var Jobs = class extends APIResource {
|
|
18583
18584
|
constructor() {
|
|
18584
18585
|
super(...arguments);
|
|
@@ -18707,7 +18708,7 @@ var Jobs = class extends APIResource {
|
|
|
18707
18708
|
};
|
|
18708
18709
|
Jobs.Checkpoints = Checkpoints2;
|
|
18709
18710
|
|
|
18710
|
-
// node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
18711
|
+
// ../../node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
18711
18712
|
var FineTuning = class extends APIResource {
|
|
18712
18713
|
constructor() {
|
|
18713
18714
|
super(...arguments);
|
|
@@ -18722,11 +18723,11 @@ FineTuning.Jobs = Jobs;
|
|
|
18722
18723
|
FineTuning.Checkpoints = Checkpoints;
|
|
18723
18724
|
FineTuning.Alpha = Alpha;
|
|
18724
18725
|
|
|
18725
|
-
// node_modules/openai/resources/graders/grader-models.mjs
|
|
18726
|
+
// ../../node_modules/openai/resources/graders/grader-models.mjs
|
|
18726
18727
|
var GraderModels = class extends APIResource {
|
|
18727
18728
|
};
|
|
18728
18729
|
|
|
18729
|
-
// node_modules/openai/resources/graders/graders.mjs
|
|
18730
|
+
// ../../node_modules/openai/resources/graders/graders.mjs
|
|
18730
18731
|
var Graders2 = class extends APIResource {
|
|
18731
18732
|
constructor() {
|
|
18732
18733
|
super(...arguments);
|
|
@@ -18735,7 +18736,7 @@ var Graders2 = class extends APIResource {
|
|
|
18735
18736
|
};
|
|
18736
18737
|
Graders2.GraderModels = GraderModels;
|
|
18737
18738
|
|
|
18738
|
-
// node_modules/openai/resources/images.mjs
|
|
18739
|
+
// ../../node_modules/openai/resources/images.mjs
|
|
18739
18740
|
var Images = class extends APIResource {
|
|
18740
18741
|
/**
|
|
18741
18742
|
* Creates a variation of a given image. This endpoint only supports `dall-e-2`.
|
|
@@ -18769,7 +18770,7 @@ var Images = class extends APIResource {
|
|
|
18769
18770
|
}
|
|
18770
18771
|
};
|
|
18771
18772
|
|
|
18772
|
-
// node_modules/openai/resources/live/sessions.mjs
|
|
18773
|
+
// ../../node_modules/openai/resources/live/sessions.mjs
|
|
18773
18774
|
var Sessions4 = class extends APIResource {
|
|
18774
18775
|
/**
|
|
18775
18776
|
* Accept an incoming SIP call. Supply session with type live, the model, and
|
|
@@ -18886,15 +18887,15 @@ var Sessions4 = class extends APIResource {
|
|
|
18886
18887
|
}
|
|
18887
18888
|
};
|
|
18888
18889
|
|
|
18889
|
-
// node_modules/openai/resources/live/forks/forks.mjs
|
|
18890
|
+
// ../../node_modules/openai/resources/live/forks/forks.mjs
|
|
18890
18891
|
var Forks = class extends APIResource {
|
|
18891
18892
|
};
|
|
18892
18893
|
|
|
18893
|
-
// node_modules/openai/resources/live/sideband/sideband.mjs
|
|
18894
|
+
// ../../node_modules/openai/resources/live/sideband/sideband.mjs
|
|
18894
18895
|
var Sideband = class extends APIResource {
|
|
18895
18896
|
};
|
|
18896
18897
|
|
|
18897
|
-
// node_modules/openai/resources/live/live.mjs
|
|
18898
|
+
// ../../node_modules/openai/resources/live/live.mjs
|
|
18898
18899
|
var Live = class extends APIResource {
|
|
18899
18900
|
constructor() {
|
|
18900
18901
|
super(...arguments);
|
|
@@ -18922,7 +18923,7 @@ Live.Sideband = Sideband;
|
|
|
18922
18923
|
Live.Forks = Forks;
|
|
18923
18924
|
Live.Sessions = Sessions4;
|
|
18924
18925
|
|
|
18925
|
-
// node_modules/openai/resources/models.mjs
|
|
18926
|
+
// ../../node_modules/openai/resources/models.mjs
|
|
18926
18927
|
var Models = class extends APIResource {
|
|
18927
18928
|
/**
|
|
18928
18929
|
* Retrieves a model instance, providing basic information about the model such as
|
|
@@ -18947,7 +18948,7 @@ var Models = class extends APIResource {
|
|
|
18947
18948
|
}
|
|
18948
18949
|
};
|
|
18949
18950
|
|
|
18950
|
-
// node_modules/openai/resources/moderations.mjs
|
|
18951
|
+
// ../../node_modules/openai/resources/moderations.mjs
|
|
18951
18952
|
var Moderations = class extends APIResource {
|
|
18952
18953
|
/**
|
|
18953
18954
|
* Classifies if text and/or image inputs are potentially harmful. Learn more in
|
|
@@ -18959,7 +18960,7 @@ var Moderations = class extends APIResource {
|
|
|
18959
18960
|
}
|
|
18960
18961
|
};
|
|
18961
18962
|
|
|
18962
|
-
// node_modules/openai/internal/multipart-encoding.mjs
|
|
18963
|
+
// ../../node_modules/openai/internal/multipart-encoding.mjs
|
|
18963
18964
|
async function encodedMultipartFormRequestOptions(options, client, encodings, rawBodyField = null) {
|
|
18964
18965
|
if (options.body === null || typeof options.body !== "object" || Array.isArray(options.body)) {
|
|
18965
18966
|
throw new TypeError("Multipart request body must be an object");
|
|
@@ -19001,7 +19002,7 @@ async function encodedMultipartFormRequestOptions(options, client, encodings, ra
|
|
|
19001
19002
|
};
|
|
19002
19003
|
}
|
|
19003
19004
|
|
|
19004
|
-
// node_modules/openai/resources/realtime/calls.mjs
|
|
19005
|
+
// ../../node_modules/openai/resources/realtime/calls.mjs
|
|
19005
19006
|
var Calls = class extends APIResource {
|
|
19006
19007
|
/**
|
|
19007
19008
|
* Create a new Realtime API call over WebRTC and receive the SDP answer needed to
|
|
@@ -19096,7 +19097,7 @@ var Calls = class extends APIResource {
|
|
|
19096
19097
|
}
|
|
19097
19098
|
};
|
|
19098
19099
|
|
|
19099
|
-
// node_modules/openai/resources/realtime/client-secrets.mjs
|
|
19100
|
+
// ../../node_modules/openai/resources/realtime/client-secrets.mjs
|
|
19100
19101
|
var ClientSecrets = class extends APIResource {
|
|
19101
19102
|
/**
|
|
19102
19103
|
* Create a Realtime client secret with an associated session configuration.
|
|
@@ -19130,7 +19131,7 @@ var ClientSecrets = class extends APIResource {
|
|
|
19130
19131
|
}
|
|
19131
19132
|
};
|
|
19132
19133
|
|
|
19133
|
-
// node_modules/openai/resources/realtime/realtime.mjs
|
|
19134
|
+
// ../../node_modules/openai/resources/realtime/realtime.mjs
|
|
19134
19135
|
var Realtime2 = class extends APIResource {
|
|
19135
19136
|
constructor() {
|
|
19136
19137
|
super(...arguments);
|
|
@@ -19141,7 +19142,7 @@ var Realtime2 = class extends APIResource {
|
|
|
19141
19142
|
Realtime2.ClientSecrets = ClientSecrets;
|
|
19142
19143
|
Realtime2.Calls = Calls;
|
|
19143
19144
|
|
|
19144
|
-
// node_modules/openai/lib/ResponsesParser.mjs
|
|
19145
|
+
// ../../node_modules/openai/lib/ResponsesParser.mjs
|
|
19145
19146
|
function maybeParseResponse(response, params) {
|
|
19146
19147
|
if (!params || !hasAutoParseableInput2(params)) {
|
|
19147
19148
|
const parsed = {
|
|
@@ -19273,7 +19274,7 @@ function addOutputText(rsp) {
|
|
|
19273
19274
|
rsp.output_text = texts.join("");
|
|
19274
19275
|
}
|
|
19275
19276
|
|
|
19276
|
-
// node_modules/openai/internal/responses/output-text-index.mjs
|
|
19277
|
+
// ../../node_modules/openai/internal/responses/output-text-index.mjs
|
|
19277
19278
|
var OutputTextIndex = class {
|
|
19278
19279
|
constructor() {
|
|
19279
19280
|
this.capacity = 1;
|
|
@@ -19340,7 +19341,7 @@ var OutputTextIndex = class {
|
|
|
19340
19341
|
}
|
|
19341
19342
|
};
|
|
19342
19343
|
|
|
19343
|
-
// node_modules/openai/internal/responses/canonical-output-text.mjs
|
|
19344
|
+
// ../../node_modules/openai/internal/responses/canonical-output-text.mjs
|
|
19344
19345
|
function createCanonicalResponseContext() {
|
|
19345
19346
|
return {
|
|
19346
19347
|
canonicalSnapshot: void 0,
|
|
@@ -19445,7 +19446,7 @@ function updateOutputText(context, snapshot, outputIndex, previousText, nextText
|
|
|
19445
19446
|
snapshot.output_text = snapshot.output_text.slice(0, offset) + nextText + snapshot.output_text.slice(offset + previousText.length);
|
|
19446
19447
|
}
|
|
19447
19448
|
|
|
19448
|
-
// node_modules/openai/internal/responses/response-accumulator.mjs
|
|
19449
|
+
// ../../node_modules/openai/internal/responses/response-accumulator.mjs
|
|
19449
19450
|
var responseOutputIdentityIndexes = /* @__PURE__ */ new WeakMap();
|
|
19450
19451
|
function validateArrayIndex(collection, index, kind, allowAppend = false) {
|
|
19451
19452
|
if (!Array.isArray(collection) || !Number.isSafeInteger(index) || index < 0 || index > collection.length || (index === collection.length ? !allowAppend || index in collection : !hasOwn(collection, index))) {
|
|
@@ -20337,7 +20338,7 @@ function accumulateResponseWithContext(event, snapshot, context, rejectInvalidSh
|
|
|
20337
20338
|
return assertNever3(dispatchEvent);
|
|
20338
20339
|
}
|
|
20339
20340
|
|
|
20340
|
-
// node_modules/openai/lib/responses/ResponseStream.mjs
|
|
20341
|
+
// ../../node_modules/openai/lib/responses/ResponseStream.mjs
|
|
20341
20342
|
var _ResponseStream_instances;
|
|
20342
20343
|
var _ResponseStream_params;
|
|
20343
20344
|
var _ResponseStream_currentResponseSnapshot;
|
|
@@ -20519,7 +20520,7 @@ function finalizeResponse(snapshot, params) {
|
|
|
20519
20520
|
return maybeParseResponse(snapshot, params);
|
|
20520
20521
|
}
|
|
20521
20522
|
|
|
20522
|
-
// node_modules/openai/resources/responses/input-items.mjs
|
|
20523
|
+
// ../../node_modules/openai/resources/responses/input-items.mjs
|
|
20523
20524
|
var InputItems2 = class extends APIResource {
|
|
20524
20525
|
/**
|
|
20525
20526
|
* Returns a list of input items for a given response.
|
|
@@ -20539,7 +20540,7 @@ var InputItems2 = class extends APIResource {
|
|
|
20539
20540
|
}
|
|
20540
20541
|
};
|
|
20541
20542
|
|
|
20542
|
-
// node_modules/openai/resources/responses/input-tokens.mjs
|
|
20543
|
+
// ../../node_modules/openai/resources/responses/input-tokens.mjs
|
|
20543
20544
|
var InputTokens2 = class extends APIResource {
|
|
20544
20545
|
/**
|
|
20545
20546
|
* Returns input token counts of the request.
|
|
@@ -20561,7 +20562,7 @@ var InputTokens2 = class extends APIResource {
|
|
|
20561
20562
|
}
|
|
20562
20563
|
};
|
|
20563
20564
|
|
|
20564
|
-
// node_modules/openai/resources/responses/responses.mjs
|
|
20565
|
+
// ../../node_modules/openai/resources/responses/responses.mjs
|
|
20565
20566
|
var Responses2 = class extends APIResource {
|
|
20566
20567
|
constructor() {
|
|
20567
20568
|
super(...arguments);
|
|
@@ -20660,7 +20661,7 @@ var Responses2 = class extends APIResource {
|
|
|
20660
20661
|
Responses2.InputItems = InputItems2;
|
|
20661
20662
|
Responses2.InputTokens = InputTokens2;
|
|
20662
20663
|
|
|
20663
|
-
// node_modules/openai/resources/safety/alerts.mjs
|
|
20664
|
+
// ../../node_modules/openai/resources/safety/alerts.mjs
|
|
20664
20665
|
var Alerts = class extends APIResource {
|
|
20665
20666
|
/**
|
|
20666
20667
|
* Get a safety alert belonging to the authenticated API project.
|
|
@@ -20670,7 +20671,7 @@ var Alerts = class extends APIResource {
|
|
|
20670
20671
|
}
|
|
20671
20672
|
};
|
|
20672
20673
|
|
|
20673
|
-
// node_modules/openai/resources/safety/safety.mjs
|
|
20674
|
+
// ../../node_modules/openai/resources/safety/safety.mjs
|
|
20674
20675
|
var Safety = class extends APIResource {
|
|
20675
20676
|
constructor() {
|
|
20676
20677
|
super(...arguments);
|
|
@@ -20679,7 +20680,7 @@ var Safety = class extends APIResource {
|
|
|
20679
20680
|
};
|
|
20680
20681
|
Safety.Alerts = Alerts;
|
|
20681
20682
|
|
|
20682
|
-
// node_modules/openai/resources/skills/content.mjs
|
|
20683
|
+
// ../../node_modules/openai/resources/skills/content.mjs
|
|
20683
20684
|
var Content2 = class extends APIResource {
|
|
20684
20685
|
/**
|
|
20685
20686
|
* Download a skill zip bundle by its ID.
|
|
@@ -20694,7 +20695,7 @@ var Content2 = class extends APIResource {
|
|
|
20694
20695
|
}
|
|
20695
20696
|
};
|
|
20696
20697
|
|
|
20697
|
-
// node_modules/openai/resources/skills/versions/content.mjs
|
|
20698
|
+
// ../../node_modules/openai/resources/skills/versions/content.mjs
|
|
20698
20699
|
var Content3 = class extends APIResource {
|
|
20699
20700
|
/**
|
|
20700
20701
|
* Download a skill version zip bundle.
|
|
@@ -20710,7 +20711,7 @@ var Content3 = class extends APIResource {
|
|
|
20710
20711
|
}
|
|
20711
20712
|
};
|
|
20712
20713
|
|
|
20713
|
-
// node_modules/openai/resources/skills/versions/versions.mjs
|
|
20714
|
+
// ../../node_modules/openai/resources/skills/versions/versions.mjs
|
|
20714
20715
|
var Versions = class extends APIResource {
|
|
20715
20716
|
constructor() {
|
|
20716
20717
|
super(...arguments);
|
|
@@ -20757,7 +20758,7 @@ var Versions = class extends APIResource {
|
|
|
20757
20758
|
};
|
|
20758
20759
|
Versions.Content = Content3;
|
|
20759
20760
|
|
|
20760
|
-
// node_modules/openai/resources/skills/skills.mjs
|
|
20761
|
+
// ../../node_modules/openai/resources/skills/skills.mjs
|
|
20761
20762
|
var Skills = class extends APIResource {
|
|
20762
20763
|
constructor() {
|
|
20763
20764
|
super(...arguments);
|
|
@@ -20808,7 +20809,7 @@ var Skills = class extends APIResource {
|
|
|
20808
20809
|
Skills.Content = Content2;
|
|
20809
20810
|
Skills.Versions = Versions;
|
|
20810
20811
|
|
|
20811
|
-
// node_modules/openai/resources/uploads/parts.mjs
|
|
20812
|
+
// ../../node_modules/openai/resources/uploads/parts.mjs
|
|
20812
20813
|
var Parts = class extends APIResource {
|
|
20813
20814
|
/**
|
|
20814
20815
|
* Adds a
|
|
@@ -20829,7 +20830,7 @@ var Parts = class extends APIResource {
|
|
|
20829
20830
|
}
|
|
20830
20831
|
};
|
|
20831
20832
|
|
|
20832
|
-
// node_modules/openai/resources/uploads/uploads.mjs
|
|
20833
|
+
// ../../node_modules/openai/resources/uploads/uploads.mjs
|
|
20833
20834
|
var Uploads = class extends APIResource {
|
|
20834
20835
|
constructor() {
|
|
20835
20836
|
super(...arguments);
|
|
@@ -20899,7 +20900,7 @@ var Uploads = class extends APIResource {
|
|
|
20899
20900
|
};
|
|
20900
20901
|
Uploads.Parts = Parts;
|
|
20901
20902
|
|
|
20902
|
-
// node_modules/openai/lib/vector-store-polling.mjs
|
|
20903
|
+
// ../../node_modules/openai/lib/vector-store-polling.mjs
|
|
20903
20904
|
function pollVectorStoreFile(resource, vectorStoreID, fileID, options) {
|
|
20904
20905
|
return pollWithResponse((headers) => resource.retrieve(fileID, { vector_store_id: vectorStoreID }, { ...options, headers }), ["in_progress"], ["failed", "cancelled", "completed"], options);
|
|
20905
20906
|
}
|
|
@@ -20907,7 +20908,7 @@ function pollVectorStoreFileBatch(resource, vectorStoreID, batchID, options) {
|
|
|
20907
20908
|
return pollWithResponse((headers) => resource.retrieve(batchID, { vector_store_id: vectorStoreID }, { ...options, headers }), ["in_progress"], ["failed", "cancelled", "completed"], options);
|
|
20908
20909
|
}
|
|
20909
20910
|
|
|
20910
|
-
// node_modules/openai/lib/Util.mjs
|
|
20911
|
+
// ../../node_modules/openai/lib/Util.mjs
|
|
20911
20912
|
var allSettledWithThrow = async (promises) => {
|
|
20912
20913
|
const results = await Promise.allSettled(promises);
|
|
20913
20914
|
const rejected = results.filter((result) => result.status === "rejected");
|
|
@@ -20927,7 +20928,7 @@ var allSettledWithThrow = async (promises) => {
|
|
|
20927
20928
|
return values;
|
|
20928
20929
|
};
|
|
20929
20930
|
|
|
20930
|
-
// node_modules/openai/lib/vector-store-upload.mjs
|
|
20931
|
+
// ../../node_modules/openai/lib/vector-store-upload.mjs
|
|
20931
20932
|
async function uploadAndPollVectorStoreFileBatch(resource, client, vectorStoreId, files, fileIds, options) {
|
|
20932
20933
|
if (files === null || files === void 0 || files.length === 0) {
|
|
20933
20934
|
throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");
|
|
@@ -20954,7 +20955,7 @@ async function uploadAndPollVectorStoreFileBatch(resource, client, vectorStoreId
|
|
|
20954
20955
|
return await resource.createAndPoll(vectorStoreId, { file_ids: allFileIds }, options);
|
|
20955
20956
|
}
|
|
20956
20957
|
|
|
20957
|
-
// node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
20958
|
+
// ../../node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
20958
20959
|
var FileBatches = class extends APIResource {
|
|
20959
20960
|
/**
|
|
20960
20961
|
* Create a vector store file batch.
|
|
@@ -21028,7 +21029,7 @@ var FileBatches = class extends APIResource {
|
|
|
21028
21029
|
}
|
|
21029
21030
|
};
|
|
21030
21031
|
|
|
21031
|
-
// node_modules/openai/resources/vector-stores/files.mjs
|
|
21032
|
+
// ../../node_modules/openai/resources/vector-stores/files.mjs
|
|
21032
21033
|
var Files4 = class extends APIResource {
|
|
21033
21034
|
/**
|
|
21034
21035
|
* Create a vector store file by attaching a
|
|
@@ -21137,7 +21138,7 @@ var Files4 = class extends APIResource {
|
|
|
21137
21138
|
}
|
|
21138
21139
|
};
|
|
21139
21140
|
|
|
21140
|
-
// node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
21141
|
+
// ../../node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
21141
21142
|
var VectorStores = class extends APIResource {
|
|
21142
21143
|
constructor() {
|
|
21143
21144
|
super(...arguments);
|
|
@@ -21214,7 +21215,7 @@ var VectorStores = class extends APIResource {
|
|
|
21214
21215
|
VectorStores.Files = Files4;
|
|
21215
21216
|
VectorStores.FileBatches = FileBatches;
|
|
21216
21217
|
|
|
21217
|
-
// node_modules/openai/resources/videos.mjs
|
|
21218
|
+
// ../../node_modules/openai/resources/videos.mjs
|
|
21218
21219
|
var Videos = class extends APIResource {
|
|
21219
21220
|
/**
|
|
21220
21221
|
* Create a new video generation job from a prompt and optional reference assets.
|
|
@@ -21314,7 +21315,7 @@ var Videos = class extends APIResource {
|
|
|
21314
21315
|
}
|
|
21315
21316
|
};
|
|
21316
21317
|
|
|
21317
|
-
// node_modules/openai/lib/webhook-signature.mjs
|
|
21318
|
+
// ../../node_modules/openai/lib/webhook-signature.mjs
|
|
21318
21319
|
var MAX_DIRECT_WEBHOOK_VERIFICATIONS = 32;
|
|
21319
21320
|
var SHA256_SIGNATURE_LENGTH = 32;
|
|
21320
21321
|
function webhookSignatureRequiresSigning(signatureHeader) {
|
|
@@ -21411,7 +21412,7 @@ async function verifyWebhookSignature(payload, signatureHeader, timestamp, webho
|
|
|
21411
21412
|
throw new InvalidWebhookSignatureError("The given webhook signature does not match the expected signature");
|
|
21412
21413
|
}
|
|
21413
21414
|
|
|
21414
|
-
// node_modules/openai/resources/webhooks/event-types.mjs
|
|
21415
|
+
// ../../node_modules/openai/resources/webhooks/event-types.mjs
|
|
21415
21416
|
var EventTypes = class extends APIResource {
|
|
21416
21417
|
/**
|
|
21417
21418
|
* Returns webhook event types visible to the authenticated project.
|
|
@@ -21427,7 +21428,7 @@ var EventTypes = class extends APIResource {
|
|
|
21427
21428
|
}
|
|
21428
21429
|
};
|
|
21429
21430
|
|
|
21430
|
-
// node_modules/openai/resources/webhooks/webhooks.mjs
|
|
21431
|
+
// ../../node_modules/openai/resources/webhooks/webhooks.mjs
|
|
21431
21432
|
var _Webhooks_instances;
|
|
21432
21433
|
var _Webhooks_validateSecret;
|
|
21433
21434
|
var _Webhooks_getRequiredHeader;
|
|
@@ -21600,7 +21601,7 @@ _Webhooks_instances = /* @__PURE__ */ new WeakSet(), _Webhooks_validateSecret =
|
|
|
21600
21601
|
};
|
|
21601
21602
|
Webhooks.EventTypes = EventTypes;
|
|
21602
21603
|
|
|
21603
|
-
// node_modules/openai/internal/realtime-credentials.mjs
|
|
21604
|
+
// ../../node_modules/openai/internal/realtime-credentials.mjs
|
|
21604
21605
|
async function resolveRealtimeAPIKey(client) {
|
|
21605
21606
|
let apiKey;
|
|
21606
21607
|
const isProvider = await client._callApiKey((resolved) => {
|
|
@@ -21609,7 +21610,7 @@ async function resolveRealtimeAPIKey(client) {
|
|
|
21609
21610
|
return { apiKey: apiKey === void 0 ? client.apiKey : apiKey, isProvider };
|
|
21610
21611
|
}
|
|
21611
21612
|
|
|
21612
|
-
// node_modules/openai/internal/provider.mjs
|
|
21613
|
+
// ../../node_modules/openai/internal/provider.mjs
|
|
21613
21614
|
var providerDefinitionsKey = /* @__PURE__ */ Symbol.for("openai.node.providerDefinitions.v1");
|
|
21614
21615
|
var providerGlobal = globalThis;
|
|
21615
21616
|
var existingProviderDefinitions = providerGlobal[providerDefinitionsKey];
|
|
@@ -21625,7 +21626,7 @@ function configureProvider(provider) {
|
|
|
21625
21626
|
return definition.configure();
|
|
21626
21627
|
}
|
|
21627
21628
|
|
|
21628
|
-
// node_modules/openai/client.mjs
|
|
21629
|
+
// ../../node_modules/openai/client.mjs
|
|
21629
21630
|
var _OpenAI_instances;
|
|
21630
21631
|
var _a3;
|
|
21631
21632
|
var _OpenAI_encoder;
|
|
@@ -22746,14 +22747,14 @@ function isUndiciDispatcherVersionMismatchError(error) {
|
|
|
22746
22747
|
return false;
|
|
22747
22748
|
}
|
|
22748
22749
|
|
|
22749
|
-
// node_modules/openai/internal/bedrock.mjs
|
|
22750
|
+
// ../../node_modules/openai/internal/bedrock.mjs
|
|
22750
22751
|
var brand_privateBedrockClient = /* @__PURE__ */ Symbol.for("openai.privateBedrockClient");
|
|
22751
22752
|
|
|
22752
|
-
// node_modules/openai/bedrock.mjs
|
|
22753
|
+
// ../../node_modules/openai/bedrock.mjs
|
|
22753
22754
|
var _a4;
|
|
22754
22755
|
_a4 = brand_privateBedrockClient;
|
|
22755
22756
|
|
|
22756
|
-
//
|
|
22757
|
+
// ../ai/src/types.ts
|
|
22757
22758
|
var openAICompletionsCompatKeys = [
|
|
22758
22759
|
"thinkingFormat",
|
|
22759
22760
|
"structuredOutput",
|
|
@@ -22779,7 +22780,7 @@ var anthropicMessagesCompatKeys = [
|
|
|
22779
22780
|
"allowedFallbackModels"
|
|
22780
22781
|
];
|
|
22781
22782
|
|
|
22782
|
-
//
|
|
22783
|
+
// ../ai/src/api/openai-completions.ts
|
|
22783
22784
|
var commonOptions = [
|
|
22784
22785
|
"signal",
|
|
22785
22786
|
"sessionId",
|
|
@@ -22810,11 +22811,14 @@ function serialize(context, model) {
|
|
|
22810
22811
|
messages.push(...toolImages);
|
|
22811
22812
|
toolImages.length = 0;
|
|
22812
22813
|
};
|
|
22813
|
-
const prompt = getCurrentSystemPrompt(context.messages);
|
|
22814
|
-
if (prompt)
|
|
22815
|
-
messages.push({ role: model.compat?.supportsDeveloperRole ? "developer" : "system", content: prompt });
|
|
22816
22814
|
for (const m of transformMessages(context.messages, model)) {
|
|
22817
|
-
if (m.role === "system")
|
|
22815
|
+
if (m.role === "system") {
|
|
22816
|
+
flushToolImages();
|
|
22817
|
+
const text = renderSystemMessageUpdate(m);
|
|
22818
|
+
if (text)
|
|
22819
|
+
messages.push({ role: model.compat?.supportsDeveloperRole ? "developer" : "system", content: text });
|
|
22820
|
+
continue;
|
|
22821
|
+
}
|
|
22818
22822
|
if (m.role !== "toolResult") flushToolImages();
|
|
22819
22823
|
if (m.role === "user") {
|
|
22820
22824
|
messages.push({
|
|
@@ -23082,7 +23086,7 @@ ${metadata}`;
|
|
|
23082
23086
|
}
|
|
23083
23087
|
}
|
|
23084
23088
|
|
|
23085
|
-
//
|
|
23089
|
+
// ../ai/src/api/responses-cache.ts
|
|
23086
23090
|
function responsesCache(model, options, input) {
|
|
23087
23091
|
const key = options.sessionId && options.cacheRetention !== "none" ? { prompt_cache_key: options.sessionId.slice(0, 64) } : {};
|
|
23088
23092
|
if (model.auth === "chatgpt") return { ...key, input };
|
|
@@ -23144,7 +23148,7 @@ function markStablePrefix(input) {
|
|
|
23144
23148
|
return input;
|
|
23145
23149
|
}
|
|
23146
23150
|
|
|
23147
|
-
//
|
|
23151
|
+
// ../ai/src/api/responses-events.ts
|
|
23148
23152
|
async function* responsesEvents(stream3, response) {
|
|
23149
23153
|
const mediaType = response.headers.get("content-type")?.split(";")[0].trim().toLowerCase();
|
|
23150
23154
|
if (mediaType !== "application/json" && !mediaType?.endsWith("+json")) {
|
|
@@ -23168,11 +23172,17 @@ async function* responsesEvents(stream3, response) {
|
|
|
23168
23172
|
};
|
|
23169
23173
|
}
|
|
23170
23174
|
|
|
23171
|
-
//
|
|
23175
|
+
// ../ai/src/api/openai-responses.ts
|
|
23172
23176
|
function responsesInput(model, context) {
|
|
23173
23177
|
const input = [];
|
|
23174
|
-
for (const message of transformMessages(context.messages, model)) {
|
|
23175
|
-
if (message.role === "system")
|
|
23178
|
+
for (const [index, message] of transformMessages(context.messages, model).entries()) {
|
|
23179
|
+
if (message.role === "system") {
|
|
23180
|
+
if (index > 0) {
|
|
23181
|
+
const text = renderSystemMessageUpdate(message);
|
|
23182
|
+
if (text) input.push({ role: "developer", content: text });
|
|
23183
|
+
}
|
|
23184
|
+
continue;
|
|
23185
|
+
}
|
|
23176
23186
|
if (message.role === "user") {
|
|
23177
23187
|
input.push({
|
|
23178
23188
|
role: "user",
|
|
@@ -23312,10 +23322,11 @@ function streamSimple3(model, context, options = {}) {
|
|
|
23312
23322
|
const thinking = reasoningParameters(model, options.reasoning);
|
|
23313
23323
|
const effort = thinking?.reasoning_effort;
|
|
23314
23324
|
const reasoning = isJsonObject(thinking?.reasoning) ? { summary: "auto", ...thinking.reasoning } : typeof effort === "string" ? { effort, summary: "auto" } : void 0;
|
|
23325
|
+
const initialSystem = getInitialSystemMessage(context.messages);
|
|
23315
23326
|
let payload = {
|
|
23316
23327
|
model: model.id,
|
|
23317
23328
|
...responsesCache(model, options, responsesInput(model, context)),
|
|
23318
|
-
instructions:
|
|
23329
|
+
instructions: initialSystem ? renderSystemMessageUpdate(initialSystem) : "",
|
|
23319
23330
|
store: false,
|
|
23320
23331
|
stream: true,
|
|
23321
23332
|
include: ["reasoning.encrypted_content"],
|
|
@@ -23643,7 +23654,7 @@ function streamSimple3(model, context, options = {}) {
|
|
|
23643
23654
|
}
|
|
23644
23655
|
}
|
|
23645
23656
|
|
|
23646
|
-
//
|
|
23657
|
+
// ../ai/src/utils/abort.ts
|
|
23647
23658
|
async function abortable(promise, signal) {
|
|
23648
23659
|
if (!signal) return promise;
|
|
23649
23660
|
let abort;
|
|
@@ -23661,7 +23672,7 @@ async function abortable(promise, signal) {
|
|
|
23661
23672
|
}
|
|
23662
23673
|
}
|
|
23663
23674
|
|
|
23664
|
-
//
|
|
23675
|
+
// ../ai/src/utils/stream-idle-timeout.ts
|
|
23665
23676
|
var DEFAULT_MODEL_FIRST_RESPONSE_TIMEOUT_MS = 12e4;
|
|
23666
23677
|
var DEFAULT_MODEL_STREAM_IDLE_TIMEOUT_MS = 3e5;
|
|
23667
23678
|
function resolveModelStreamIdleTimeoutMs(options) {
|
|
@@ -23768,7 +23779,7 @@ async function closeStreamIterator(iterator) {
|
|
|
23768
23779
|
}
|
|
23769
23780
|
}
|
|
23770
23781
|
|
|
23771
|
-
//
|
|
23782
|
+
// ../ai/src/utils/guard-model-stream.ts
|
|
23772
23783
|
function hasModelProgress(event) {
|
|
23773
23784
|
switch (event.type) {
|
|
23774
23785
|
case "text_delta":
|
|
@@ -23898,7 +23909,7 @@ function guardModelStream(model, create, options = {}) {
|
|
|
23898
23909
|
return output;
|
|
23899
23910
|
}
|
|
23900
23911
|
|
|
23901
|
-
//
|
|
23912
|
+
// ../ai/src/stream.ts
|
|
23902
23913
|
function streamSimple4(model, context, options = {}) {
|
|
23903
23914
|
const { getApiKey, ...requestOptions } = options;
|
|
23904
23915
|
return guardModelStream(
|
|
@@ -23958,7 +23969,7 @@ function streamRequest(model, context, options) {
|
|
|
23958
23969
|
return events;
|
|
23959
23970
|
}
|
|
23960
23971
|
|
|
23961
|
-
//
|
|
23972
|
+
// ../ai/src/utils/overflow.ts
|
|
23962
23973
|
var OVERFLOW_PATTERNS = [
|
|
23963
23974
|
/prompt is too long/i,
|
|
23964
23975
|
// Anthropic token overflow
|
|
@@ -24097,7 +24108,7 @@ function isModelMediaTooLargeError(error) {
|
|
|
24097
24108
|
return matchesModelError(error, MEDIA_MARKERS, isModelMediaTooLargeMessage);
|
|
24098
24109
|
}
|
|
24099
24110
|
|
|
24100
|
-
//
|
|
24111
|
+
// ../ai/src/utils/retry.ts
|
|
24101
24112
|
function buildProviderErrorPattern(patterns) {
|
|
24102
24113
|
return new RegExp(patterns.join("|"), "i");
|
|
24103
24114
|
}
|
|
@@ -24282,6 +24293,10 @@ function isRetryableAssistantError(message) {
|
|
|
24282
24293
|
}
|
|
24283
24294
|
|
|
24284
24295
|
export {
|
|
24296
|
+
__require,
|
|
24297
|
+
__commonJS,
|
|
24298
|
+
__export,
|
|
24299
|
+
__toESM,
|
|
24285
24300
|
normalizeContext,
|
|
24286
24301
|
contentText,
|
|
24287
24302
|
getCurrentSystemPrompt,
|
|
@@ -24350,4 +24365,4 @@ export {
|
|
|
24350
24365
|
retryAssistantCall,
|
|
24351
24366
|
isRetryableAssistantError
|
|
24352
24367
|
};
|
|
24353
|
-
//# sourceMappingURL=chunk-
|
|
24368
|
+
//# sourceMappingURL=chunk-GPIEWH3K.js.map
|