@kevisual/ai 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-provider-browser.js +494 -198
- package/dist/ai-provider.js +494 -198
- package/package.json +17 -17
- package/src/provider/knowledge.ts +4 -3
- package/src/test/aliyun/test.ts +26 -0
- package/src/test/func-call/demo.ts +2 -2
- package/src/test/model-scope/index.ts +4 -4
|
@@ -18675,7 +18675,7 @@ var require_enc_utf8 = __commonJS((exports, module) => {
|
|
|
18675
18675
|
});
|
|
18676
18676
|
});
|
|
18677
18677
|
|
|
18678
|
-
// node_modules/.pnpm/openai@
|
|
18678
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/tslib.mjs
|
|
18679
18679
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
18680
18680
|
if (kind === "m")
|
|
18681
18681
|
throw new TypeError("Private method is not writable");
|
|
@@ -18693,7 +18693,7 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
18693
18693
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
18694
18694
|
}
|
|
18695
18695
|
|
|
18696
|
-
// node_modules/.pnpm/openai@
|
|
18696
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/uuid.mjs
|
|
18697
18697
|
var uuid4 = function() {
|
|
18698
18698
|
const { crypto: crypto2 } = globalThis;
|
|
18699
18699
|
if (crypto2?.randomUUID) {
|
|
@@ -18705,7 +18705,7 @@ var uuid4 = function() {
|
|
|
18705
18705
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
18706
18706
|
};
|
|
18707
18707
|
|
|
18708
|
-
// node_modules/.pnpm/openai@
|
|
18708
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/errors.mjs
|
|
18709
18709
|
function isAbortError(err) {
|
|
18710
18710
|
return typeof err === "object" && err !== null && (("name" in err) && err.name === "AbortError" || ("message" in err) && String(err.message).includes("FetchRequestCanceledException"));
|
|
18711
18711
|
}
|
|
@@ -18732,7 +18732,7 @@ var castToError = (err) => {
|
|
|
18732
18732
|
return new Error(err);
|
|
18733
18733
|
};
|
|
18734
18734
|
|
|
18735
|
-
// node_modules/.pnpm/openai@
|
|
18735
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/error.mjs
|
|
18736
18736
|
class OpenAIError extends Error {
|
|
18737
18737
|
}
|
|
18738
18738
|
|
|
@@ -18856,7 +18856,7 @@ class InvalidWebhookSignatureError extends Error {
|
|
|
18856
18856
|
}
|
|
18857
18857
|
}
|
|
18858
18858
|
|
|
18859
|
-
// node_modules/.pnpm/openai@
|
|
18859
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/values.mjs
|
|
18860
18860
|
var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
18861
18861
|
var isAbsoluteURL = (url) => {
|
|
18862
18862
|
return startsWithSchemeRegexp.test(url);
|
|
@@ -18899,13 +18899,13 @@ var safeJSON = (text) => {
|
|
|
18899
18899
|
}
|
|
18900
18900
|
};
|
|
18901
18901
|
|
|
18902
|
-
// node_modules/.pnpm/openai@
|
|
18902
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/sleep.mjs
|
|
18903
18903
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
18904
18904
|
|
|
18905
|
-
// node_modules/.pnpm/openai@
|
|
18906
|
-
var VERSION = "
|
|
18905
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/version.mjs
|
|
18906
|
+
var VERSION = "6.6.0";
|
|
18907
18907
|
|
|
18908
|
-
// node_modules/.pnpm/openai@
|
|
18908
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/detect-platform.mjs
|
|
18909
18909
|
var isRunningInBrowser = () => {
|
|
18910
18910
|
return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof navigator !== "undefined";
|
|
18911
18911
|
};
|
|
@@ -19034,7 +19034,7 @@ var getPlatformHeaders = () => {
|
|
|
19034
19034
|
return _platformHeaders ?? (_platformHeaders = getPlatformProperties());
|
|
19035
19035
|
};
|
|
19036
19036
|
|
|
19037
|
-
// node_modules/.pnpm/openai@
|
|
19037
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/shims.mjs
|
|
19038
19038
|
function getDefaultFetch() {
|
|
19039
19039
|
if (typeof fetch !== "undefined") {
|
|
19040
19040
|
return fetch;
|
|
@@ -19105,7 +19105,7 @@ async function CancelReadableStream(stream) {
|
|
|
19105
19105
|
await cancelPromise;
|
|
19106
19106
|
}
|
|
19107
19107
|
|
|
19108
|
-
// node_modules/.pnpm/openai@
|
|
19108
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/request-options.mjs
|
|
19109
19109
|
var FallbackEncoder = ({ headers, body }) => {
|
|
19110
19110
|
return {
|
|
19111
19111
|
bodyHeaders: {
|
|
@@ -19115,7 +19115,7 @@ var FallbackEncoder = ({ headers, body }) => {
|
|
|
19115
19115
|
};
|
|
19116
19116
|
};
|
|
19117
19117
|
|
|
19118
|
-
// node_modules/.pnpm/openai@
|
|
19118
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/qs/formats.mjs
|
|
19119
19119
|
var default_format = "RFC3986";
|
|
19120
19120
|
var default_formatter = (v) => String(v);
|
|
19121
19121
|
var formatters = {
|
|
@@ -19124,7 +19124,7 @@ var formatters = {
|
|
|
19124
19124
|
};
|
|
19125
19125
|
var RFC1738 = "RFC1738";
|
|
19126
19126
|
|
|
19127
|
-
// node_modules/.pnpm/openai@
|
|
19127
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/qs/utils.mjs
|
|
19128
19128
|
var has = (obj, key) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj, key));
|
|
19129
19129
|
var hex_table = /* @__PURE__ */ (() => {
|
|
19130
19130
|
const array = [];
|
|
@@ -19196,7 +19196,7 @@ function maybe_map(val, fn) {
|
|
|
19196
19196
|
return fn(val);
|
|
19197
19197
|
}
|
|
19198
19198
|
|
|
19199
|
-
// node_modules/.pnpm/openai@
|
|
19199
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/qs/stringify.mjs
|
|
19200
19200
|
var array_prefix_generators = {
|
|
19201
19201
|
brackets(prefix) {
|
|
19202
19202
|
return String(prefix) + "[]";
|
|
@@ -19423,7 +19423,7 @@ function stringify(object, opts = {}) {
|
|
|
19423
19423
|
}
|
|
19424
19424
|
return joined.length > 0 ? prefix + joined : "";
|
|
19425
19425
|
}
|
|
19426
|
-
// node_modules/.pnpm/openai@
|
|
19426
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/bytes.mjs
|
|
19427
19427
|
function concatBytes(buffers) {
|
|
19428
19428
|
let length = 0;
|
|
19429
19429
|
for (const buffer of buffers) {
|
|
@@ -19448,7 +19448,7 @@ function decodeUTF8(bytes) {
|
|
|
19448
19448
|
return (decodeUTF8_ ?? (decoder = new globalThis.TextDecoder, decodeUTF8_ = decoder.decode.bind(decoder)))(bytes);
|
|
19449
19449
|
}
|
|
19450
19450
|
|
|
19451
|
-
// node_modules/.pnpm/openai@
|
|
19451
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/decoders/line.mjs
|
|
19452
19452
|
var _LineDecoder_buffer;
|
|
19453
19453
|
var _LineDecoder_carriageReturnIndex;
|
|
19454
19454
|
|
|
@@ -19528,7 +19528,7 @@ function findDoubleNewlineIndex(buffer) {
|
|
|
19528
19528
|
return -1;
|
|
19529
19529
|
}
|
|
19530
19530
|
|
|
19531
|
-
// node_modules/.pnpm/openai@
|
|
19531
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/log.mjs
|
|
19532
19532
|
var levelNumbers = {
|
|
19533
19533
|
off: 0,
|
|
19534
19534
|
error: 200,
|
|
@@ -19600,7 +19600,7 @@ var formatRequestDetails = (details) => {
|
|
|
19600
19600
|
return details;
|
|
19601
19601
|
};
|
|
19602
19602
|
|
|
19603
|
-
// node_modules/.pnpm/openai@
|
|
19603
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/streaming.mjs
|
|
19604
19604
|
var _Stream_client;
|
|
19605
19605
|
|
|
19606
19606
|
class Stream {
|
|
@@ -19849,7 +19849,7 @@ function partition(str, delimiter) {
|
|
|
19849
19849
|
return [str, "", ""];
|
|
19850
19850
|
}
|
|
19851
19851
|
|
|
19852
|
-
// node_modules/.pnpm/openai@
|
|
19852
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/parse.mjs
|
|
19853
19853
|
async function defaultParseResponse(client, props) {
|
|
19854
19854
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
19855
19855
|
const body = await (async () => {
|
|
@@ -19895,7 +19895,7 @@ function addRequestID(value, response) {
|
|
|
19895
19895
|
});
|
|
19896
19896
|
}
|
|
19897
19897
|
|
|
19898
|
-
// node_modules/.pnpm/openai@
|
|
19898
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/api-promise.mjs
|
|
19899
19899
|
var _APIPromise_client;
|
|
19900
19900
|
|
|
19901
19901
|
class APIPromise extends Promise {
|
|
@@ -19936,7 +19936,7 @@ class APIPromise extends Promise {
|
|
|
19936
19936
|
}
|
|
19937
19937
|
_APIPromise_client = new WeakMap;
|
|
19938
19938
|
|
|
19939
|
-
// node_modules/.pnpm/openai@
|
|
19939
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/pagination.mjs
|
|
19940
19940
|
var _AbstractPage_client;
|
|
19941
19941
|
|
|
19942
19942
|
class AbstractPage {
|
|
@@ -20034,7 +20034,38 @@ class CursorPage extends AbstractPage {
|
|
|
20034
20034
|
}
|
|
20035
20035
|
}
|
|
20036
20036
|
|
|
20037
|
-
|
|
20037
|
+
class ConversationCursorPage extends AbstractPage {
|
|
20038
|
+
constructor(client, response, body, options) {
|
|
20039
|
+
super(client, response, body, options);
|
|
20040
|
+
this.data = body.data || [];
|
|
20041
|
+
this.has_more = body.has_more || false;
|
|
20042
|
+
this.last_id = body.last_id || "";
|
|
20043
|
+
}
|
|
20044
|
+
getPaginatedItems() {
|
|
20045
|
+
return this.data ?? [];
|
|
20046
|
+
}
|
|
20047
|
+
hasNextPage() {
|
|
20048
|
+
if (this.has_more === false) {
|
|
20049
|
+
return false;
|
|
20050
|
+
}
|
|
20051
|
+
return super.hasNextPage();
|
|
20052
|
+
}
|
|
20053
|
+
nextPageRequestOptions() {
|
|
20054
|
+
const cursor = this.last_id;
|
|
20055
|
+
if (!cursor) {
|
|
20056
|
+
return null;
|
|
20057
|
+
}
|
|
20058
|
+
return {
|
|
20059
|
+
...this.options,
|
|
20060
|
+
query: {
|
|
20061
|
+
...maybeObj(this.options.query),
|
|
20062
|
+
after: cursor
|
|
20063
|
+
}
|
|
20064
|
+
};
|
|
20065
|
+
}
|
|
20066
|
+
}
|
|
20067
|
+
|
|
20068
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/uploads.mjs
|
|
20038
20069
|
var checkFileSupport = () => {
|
|
20039
20070
|
if (typeof File === "undefined") {
|
|
20040
20071
|
const { process: process2 } = globalThis;
|
|
@@ -20050,6 +20081,11 @@ function getName(value) {
|
|
|
20050
20081
|
return (typeof value === "object" && value !== null && (("name" in value) && value.name && String(value.name) || ("url" in value) && value.url && String(value.url) || ("filename" in value) && value.filename && String(value.filename) || ("path" in value) && value.path && String(value.path)) || "").split(/[\\/]/).pop() || undefined;
|
|
20051
20082
|
}
|
|
20052
20083
|
var isAsyncIterable = (value) => value != null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function";
|
|
20084
|
+
var maybeMultipartFormRequestOptions = async (opts, fetch2) => {
|
|
20085
|
+
if (!hasUploadableValue(opts.body))
|
|
20086
|
+
return opts;
|
|
20087
|
+
return { ...opts, body: await createForm(opts.body, fetch2) };
|
|
20088
|
+
};
|
|
20053
20089
|
var multipartFormRequestOptions = async (opts, fetch2) => {
|
|
20054
20090
|
return { ...opts, body: await createForm(opts.body, fetch2) };
|
|
20055
20091
|
};
|
|
@@ -20083,6 +20119,20 @@ var createForm = async (body, fetch2) => {
|
|
|
20083
20119
|
return form;
|
|
20084
20120
|
};
|
|
20085
20121
|
var isNamedBlob = (value) => value instanceof Blob && ("name" in value);
|
|
20122
|
+
var isUploadable = (value) => typeof value === "object" && value !== null && (value instanceof Response || isAsyncIterable(value) || isNamedBlob(value));
|
|
20123
|
+
var hasUploadableValue = (value) => {
|
|
20124
|
+
if (isUploadable(value))
|
|
20125
|
+
return true;
|
|
20126
|
+
if (Array.isArray(value))
|
|
20127
|
+
return value.some(hasUploadableValue);
|
|
20128
|
+
if (value && typeof value === "object") {
|
|
20129
|
+
for (const k in value) {
|
|
20130
|
+
if (hasUploadableValue(value[k]))
|
|
20131
|
+
return true;
|
|
20132
|
+
}
|
|
20133
|
+
}
|
|
20134
|
+
return false;
|
|
20135
|
+
};
|
|
20086
20136
|
var addFormValue = async (form, key, value) => {
|
|
20087
20137
|
if (value === undefined)
|
|
20088
20138
|
return;
|
|
@@ -20106,7 +20156,7 @@ var addFormValue = async (form, key, value) => {
|
|
|
20106
20156
|
}
|
|
20107
20157
|
};
|
|
20108
20158
|
|
|
20109
|
-
// node_modules/.pnpm/openai@
|
|
20159
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/to-file.mjs
|
|
20110
20160
|
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";
|
|
20111
20161
|
var isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value);
|
|
20112
20162
|
var isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function";
|
|
@@ -20156,14 +20206,14 @@ function propsForError(value) {
|
|
|
20156
20206
|
const props = Object.getOwnPropertyNames(value);
|
|
20157
20207
|
return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`;
|
|
20158
20208
|
}
|
|
20159
|
-
// node_modules/.pnpm/openai@
|
|
20209
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/core/resource.mjs
|
|
20160
20210
|
class APIResource {
|
|
20161
20211
|
constructor(client) {
|
|
20162
20212
|
this._client = client;
|
|
20163
20213
|
}
|
|
20164
20214
|
}
|
|
20165
20215
|
|
|
20166
|
-
// node_modules/.pnpm/openai@
|
|
20216
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/path.mjs
|
|
20167
20217
|
function encodeURIPath(str) {
|
|
20168
20218
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
20169
20219
|
}
|
|
@@ -20218,18 +20268,120 @@ ${underline}`);
|
|
|
20218
20268
|
};
|
|
20219
20269
|
var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
20220
20270
|
|
|
20221
|
-
// node_modules/.pnpm/openai@
|
|
20271
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/chat/completions/messages.mjs
|
|
20222
20272
|
class Messages extends APIResource {
|
|
20223
20273
|
list(completionID, query = {}, options) {
|
|
20224
20274
|
return this._client.getAPIList(path`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options });
|
|
20225
20275
|
}
|
|
20226
20276
|
}
|
|
20227
|
-
// node_modules/.pnpm/openai@
|
|
20228
|
-
function
|
|
20229
|
-
return
|
|
20277
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/parser.mjs
|
|
20278
|
+
function isChatCompletionFunctionTool(tool) {
|
|
20279
|
+
return tool !== undefined && "function" in tool && tool.function !== undefined;
|
|
20280
|
+
}
|
|
20281
|
+
function isAutoParsableResponseFormat(response_format) {
|
|
20282
|
+
return response_format?.["$brand"] === "auto-parseable-response-format";
|
|
20283
|
+
}
|
|
20284
|
+
function isAutoParsableTool(tool) {
|
|
20285
|
+
return tool?.["$brand"] === "auto-parseable-tool";
|
|
20286
|
+
}
|
|
20287
|
+
function maybeParseChatCompletion(completion, params) {
|
|
20288
|
+
if (!params || !hasAutoParseableInput(params)) {
|
|
20289
|
+
return {
|
|
20290
|
+
...completion,
|
|
20291
|
+
choices: completion.choices.map((choice) => {
|
|
20292
|
+
assertToolCallsAreChatCompletionFunctionToolCalls(choice.message.tool_calls);
|
|
20293
|
+
return {
|
|
20294
|
+
...choice,
|
|
20295
|
+
message: {
|
|
20296
|
+
...choice.message,
|
|
20297
|
+
parsed: null,
|
|
20298
|
+
...choice.message.tool_calls ? {
|
|
20299
|
+
tool_calls: choice.message.tool_calls
|
|
20300
|
+
} : undefined
|
|
20301
|
+
}
|
|
20302
|
+
};
|
|
20303
|
+
})
|
|
20304
|
+
};
|
|
20305
|
+
}
|
|
20306
|
+
return parseChatCompletion(completion, params);
|
|
20307
|
+
}
|
|
20308
|
+
function parseChatCompletion(completion, params) {
|
|
20309
|
+
const choices = completion.choices.map((choice) => {
|
|
20310
|
+
if (choice.finish_reason === "length") {
|
|
20311
|
+
throw new LengthFinishReasonError;
|
|
20312
|
+
}
|
|
20313
|
+
if (choice.finish_reason === "content_filter") {
|
|
20314
|
+
throw new ContentFilterFinishReasonError;
|
|
20315
|
+
}
|
|
20316
|
+
assertToolCallsAreChatCompletionFunctionToolCalls(choice.message.tool_calls);
|
|
20317
|
+
return {
|
|
20318
|
+
...choice,
|
|
20319
|
+
message: {
|
|
20320
|
+
...choice.message,
|
|
20321
|
+
...choice.message.tool_calls ? {
|
|
20322
|
+
tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? undefined
|
|
20323
|
+
} : undefined,
|
|
20324
|
+
parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null
|
|
20325
|
+
}
|
|
20326
|
+
};
|
|
20327
|
+
});
|
|
20328
|
+
return { ...completion, choices };
|
|
20329
|
+
}
|
|
20330
|
+
function parseResponseFormat(params, content) {
|
|
20331
|
+
if (params.response_format?.type !== "json_schema") {
|
|
20332
|
+
return null;
|
|
20333
|
+
}
|
|
20334
|
+
if (params.response_format?.type === "json_schema") {
|
|
20335
|
+
if ("$parseRaw" in params.response_format) {
|
|
20336
|
+
const response_format = params.response_format;
|
|
20337
|
+
return response_format.$parseRaw(content);
|
|
20338
|
+
}
|
|
20339
|
+
return JSON.parse(content);
|
|
20340
|
+
}
|
|
20341
|
+
return null;
|
|
20342
|
+
}
|
|
20343
|
+
function parseToolCall(params, toolCall) {
|
|
20344
|
+
const inputTool = params.tools?.find((inputTool2) => isChatCompletionFunctionTool(inputTool2) && inputTool2.function?.name === toolCall.function.name);
|
|
20345
|
+
return {
|
|
20346
|
+
...toolCall,
|
|
20347
|
+
function: {
|
|
20348
|
+
...toolCall.function,
|
|
20349
|
+
parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCall.function.arguments) : null
|
|
20350
|
+
}
|
|
20351
|
+
};
|
|
20352
|
+
}
|
|
20353
|
+
function shouldParseToolCall(params, toolCall) {
|
|
20354
|
+
if (!params || !("tools" in params) || !params.tools) {
|
|
20355
|
+
return false;
|
|
20356
|
+
}
|
|
20357
|
+
const inputTool = params.tools?.find((inputTool2) => isChatCompletionFunctionTool(inputTool2) && inputTool2.function?.name === toolCall.function.name);
|
|
20358
|
+
return isChatCompletionFunctionTool(inputTool) && (isAutoParsableTool(inputTool) || inputTool?.function.strict || false);
|
|
20359
|
+
}
|
|
20360
|
+
function hasAutoParseableInput(params) {
|
|
20361
|
+
if (isAutoParsableResponseFormat(params.response_format)) {
|
|
20362
|
+
return true;
|
|
20363
|
+
}
|
|
20364
|
+
return params.tools?.some((t) => isAutoParsableTool(t) || t.type === "function" && t.function.strict === true) ?? false;
|
|
20365
|
+
}
|
|
20366
|
+
function assertToolCallsAreChatCompletionFunctionToolCalls(toolCalls) {
|
|
20367
|
+
for (const toolCall of toolCalls || []) {
|
|
20368
|
+
if (toolCall.type !== "function") {
|
|
20369
|
+
throw new OpenAIError(`Currently only \`function\` tool calls are supported; Received \`${toolCall.type}\``);
|
|
20370
|
+
}
|
|
20371
|
+
}
|
|
20372
|
+
}
|
|
20373
|
+
function validateInputTools(tools) {
|
|
20374
|
+
for (const tool of tools ?? []) {
|
|
20375
|
+
if (tool.type !== "function") {
|
|
20376
|
+
throw new OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``);
|
|
20377
|
+
}
|
|
20378
|
+
if (tool.function.strict !== true) {
|
|
20379
|
+
throw new OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
|
|
20380
|
+
}
|
|
20381
|
+
}
|
|
20230
20382
|
}
|
|
20231
20383
|
|
|
20232
|
-
// node_modules/.pnpm/openai@
|
|
20384
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/chatCompletionUtils.mjs
|
|
20233
20385
|
var isAssistantMessage = (message) => {
|
|
20234
20386
|
return message?.role === "assistant";
|
|
20235
20387
|
};
|
|
@@ -20237,7 +20389,7 @@ var isToolMessage = (message) => {
|
|
|
20237
20389
|
return message?.role === "tool";
|
|
20238
20390
|
};
|
|
20239
20391
|
|
|
20240
|
-
// node_modules/.pnpm/openai@
|
|
20392
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/EventStream.mjs
|
|
20241
20393
|
var _EventStream_instances;
|
|
20242
20394
|
var _EventStream_connectedPromise;
|
|
20243
20395
|
var _EventStream_resolveConnectedPromise;
|
|
@@ -20390,100 +20542,12 @@ _EventStream_connectedPromise = new WeakMap, _EventStream_resolveConnectedPromis
|
|
|
20390
20542
|
return this._emit("error", new OpenAIError(String(error2)));
|
|
20391
20543
|
};
|
|
20392
20544
|
|
|
20393
|
-
// node_modules/.pnpm/openai@
|
|
20394
|
-
function
|
|
20395
|
-
return
|
|
20396
|
-
}
|
|
20397
|
-
function isAutoParsableTool(tool) {
|
|
20398
|
-
return tool?.["$brand"] === "auto-parseable-tool";
|
|
20399
|
-
}
|
|
20400
|
-
function maybeParseChatCompletion(completion, params) {
|
|
20401
|
-
if (!params || !hasAutoParseableInput(params)) {
|
|
20402
|
-
return {
|
|
20403
|
-
...completion,
|
|
20404
|
-
choices: completion.choices.map((choice) => ({
|
|
20405
|
-
...choice,
|
|
20406
|
-
message: {
|
|
20407
|
-
...choice.message,
|
|
20408
|
-
parsed: null,
|
|
20409
|
-
...choice.message.tool_calls ? {
|
|
20410
|
-
tool_calls: choice.message.tool_calls
|
|
20411
|
-
} : undefined
|
|
20412
|
-
}
|
|
20413
|
-
}))
|
|
20414
|
-
};
|
|
20415
|
-
}
|
|
20416
|
-
return parseChatCompletion(completion, params);
|
|
20417
|
-
}
|
|
20418
|
-
function parseChatCompletion(completion, params) {
|
|
20419
|
-
const choices = completion.choices.map((choice) => {
|
|
20420
|
-
if (choice.finish_reason === "length") {
|
|
20421
|
-
throw new LengthFinishReasonError;
|
|
20422
|
-
}
|
|
20423
|
-
if (choice.finish_reason === "content_filter") {
|
|
20424
|
-
throw new ContentFilterFinishReasonError;
|
|
20425
|
-
}
|
|
20426
|
-
return {
|
|
20427
|
-
...choice,
|
|
20428
|
-
message: {
|
|
20429
|
-
...choice.message,
|
|
20430
|
-
...choice.message.tool_calls ? {
|
|
20431
|
-
tool_calls: choice.message.tool_calls?.map((toolCall) => parseToolCall(params, toolCall)) ?? undefined
|
|
20432
|
-
} : undefined,
|
|
20433
|
-
parsed: choice.message.content && !choice.message.refusal ? parseResponseFormat(params, choice.message.content) : null
|
|
20434
|
-
}
|
|
20435
|
-
};
|
|
20436
|
-
});
|
|
20437
|
-
return { ...completion, choices };
|
|
20438
|
-
}
|
|
20439
|
-
function parseResponseFormat(params, content) {
|
|
20440
|
-
if (params.response_format?.type !== "json_schema") {
|
|
20441
|
-
return null;
|
|
20442
|
-
}
|
|
20443
|
-
if (params.response_format?.type === "json_schema") {
|
|
20444
|
-
if ("$parseRaw" in params.response_format) {
|
|
20445
|
-
const response_format = params.response_format;
|
|
20446
|
-
return response_format.$parseRaw(content);
|
|
20447
|
-
}
|
|
20448
|
-
return JSON.parse(content);
|
|
20449
|
-
}
|
|
20450
|
-
return null;
|
|
20451
|
-
}
|
|
20452
|
-
function parseToolCall(params, toolCall) {
|
|
20453
|
-
const inputTool = params.tools?.find((inputTool2) => inputTool2.function?.name === toolCall.function.name);
|
|
20454
|
-
return {
|
|
20455
|
-
...toolCall,
|
|
20456
|
-
function: {
|
|
20457
|
-
...toolCall.function,
|
|
20458
|
-
parsed_arguments: isAutoParsableTool(inputTool) ? inputTool.$parseRaw(toolCall.function.arguments) : inputTool?.function.strict ? JSON.parse(toolCall.function.arguments) : null
|
|
20459
|
-
}
|
|
20460
|
-
};
|
|
20461
|
-
}
|
|
20462
|
-
function shouldParseToolCall(params, toolCall) {
|
|
20463
|
-
if (!params) {
|
|
20464
|
-
return false;
|
|
20465
|
-
}
|
|
20466
|
-
const inputTool = params.tools?.find((inputTool2) => inputTool2.function?.name === toolCall.function.name);
|
|
20467
|
-
return isAutoParsableTool(inputTool) || inputTool?.function.strict || false;
|
|
20468
|
-
}
|
|
20469
|
-
function hasAutoParseableInput(params) {
|
|
20470
|
-
if (isAutoParsableResponseFormat(params.response_format)) {
|
|
20471
|
-
return true;
|
|
20472
|
-
}
|
|
20473
|
-
return params.tools?.some((t) => isAutoParsableTool(t) || t.type === "function" && t.function.strict === true) ?? false;
|
|
20474
|
-
}
|
|
20475
|
-
function validateInputTools(tools) {
|
|
20476
|
-
for (const tool of tools ?? []) {
|
|
20477
|
-
if (tool.type !== "function") {
|
|
20478
|
-
throw new OpenAIError(`Currently only \`function\` tool types support auto-parsing; Received \`${tool.type}\``);
|
|
20479
|
-
}
|
|
20480
|
-
if (tool.function.strict !== true) {
|
|
20481
|
-
throw new OpenAIError(`The \`${tool.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`);
|
|
20482
|
-
}
|
|
20483
|
-
}
|
|
20545
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/RunnableFunction.mjs
|
|
20546
|
+
function isRunnableFunctionWithParse(fn) {
|
|
20547
|
+
return typeof fn.parse === "function";
|
|
20484
20548
|
}
|
|
20485
20549
|
|
|
20486
|
-
// node_modules/.pnpm/openai@
|
|
20550
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
20487
20551
|
var _AbstractChatCompletionRunner_instances;
|
|
20488
20552
|
var _AbstractChatCompletionRunner_getFinalContent;
|
|
20489
20553
|
var _AbstractChatCompletionRunner_getFinalMessage;
|
|
@@ -20597,7 +20661,7 @@ class AbstractChatCompletionRunner extends EventStream {
|
|
|
20597
20661
|
async _runTools(client, params, options) {
|
|
20598
20662
|
const role = "tool";
|
|
20599
20663
|
const { tool_choice = "auto", stream, ...restParams } = params;
|
|
20600
|
-
const singleFunctionToCall = typeof tool_choice !== "string" && tool_choice?.function?.name;
|
|
20664
|
+
const singleFunctionToCall = typeof tool_choice !== "string" && tool_choice.type === "function" && tool_choice?.function?.name;
|
|
20601
20665
|
const { maxChatCompletions = DEFAULT_MAX_CHAT_COMPLETIONS } = options || {};
|
|
20602
20666
|
const inputTools = params.tools.map((tool) => {
|
|
20603
20667
|
if (isAutoParsableTool(tool)) {
|
|
@@ -20704,7 +20768,7 @@ _AbstractChatCompletionRunner_instances = new WeakSet, _AbstractChatCompletionRu
|
|
|
20704
20768
|
for (let i = this.messages.length - 1;i >= 0; i--) {
|
|
20705
20769
|
const message = this.messages[i];
|
|
20706
20770
|
if (isAssistantMessage(message) && message?.tool_calls?.length) {
|
|
20707
|
-
return message.tool_calls.at(-1)?.function;
|
|
20771
|
+
return message.tool_calls.filter((x) => x.type === "function").at(-1)?.function;
|
|
20708
20772
|
}
|
|
20709
20773
|
}
|
|
20710
20774
|
return;
|
|
@@ -20738,7 +20802,7 @@ _AbstractChatCompletionRunner_instances = new WeakSet, _AbstractChatCompletionRu
|
|
|
20738
20802
|
return typeof rawContent === "string" ? rawContent : rawContent === undefined ? "undefined" : JSON.stringify(rawContent);
|
|
20739
20803
|
};
|
|
20740
20804
|
|
|
20741
|
-
// node_modules/.pnpm/openai@
|
|
20805
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
20742
20806
|
class ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
20743
20807
|
static runTools(client, params, options) {
|
|
20744
20808
|
const runner = new ChatCompletionRunner;
|
|
@@ -20756,7 +20820,8 @@ class ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
|
20756
20820
|
}
|
|
20757
20821
|
}
|
|
20758
20822
|
}
|
|
20759
|
-
|
|
20823
|
+
|
|
20824
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/_vendor/partial-json-parser/parser.mjs
|
|
20760
20825
|
var STR = 1;
|
|
20761
20826
|
var NUM = 2;
|
|
20762
20827
|
var ARR = 4;
|
|
@@ -20969,8 +21034,7 @@ var _parseJSON = (jsonString, allow) => {
|
|
|
20969
21034
|
return parseAny();
|
|
20970
21035
|
};
|
|
20971
21036
|
var partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM);
|
|
20972
|
-
|
|
20973
|
-
// node_modules/.pnpm/openai@5.12.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.mjs
|
|
21037
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.mjs
|
|
20974
21038
|
var _ChatCompletionStream_instances;
|
|
20975
21039
|
var _ChatCompletionStream_params;
|
|
20976
21040
|
var _ChatCompletionStream_choiceEventStates;
|
|
@@ -21148,7 +21212,7 @@ class ChatCompletionStream extends AbstractChatCompletionRunner {
|
|
|
21148
21212
|
throw new Error("tool call snapshot missing `type`");
|
|
21149
21213
|
}
|
|
21150
21214
|
if (toolCallSnapshot.type === "function") {
|
|
21151
|
-
const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => tool
|
|
21215
|
+
const inputTool = __classPrivateFieldGet(this, _ChatCompletionStream_params, "f")?.tools?.find((tool) => isChatCompletionFunctionTool(tool) && tool.function.name === toolCallSnapshot.function.name);
|
|
21152
21216
|
this._emit("tool_calls.function.arguments.done", {
|
|
21153
21217
|
name: toolCallSnapshot.function.name,
|
|
21154
21218
|
index: toolCallIndex,
|
|
@@ -21443,7 +21507,7 @@ function assertIsEmpty(obj) {
|
|
|
21443
21507
|
}
|
|
21444
21508
|
function assertNever(_x) {}
|
|
21445
21509
|
|
|
21446
|
-
// node_modules/.pnpm/openai@
|
|
21510
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
21447
21511
|
class ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
21448
21512
|
static fromReadableStream(stream) {
|
|
21449
21513
|
const runner = new ChatCompletionStreamingRunner(null);
|
|
@@ -21461,7 +21525,7 @@ class ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
|
21461
21525
|
}
|
|
21462
21526
|
}
|
|
21463
21527
|
|
|
21464
|
-
// node_modules/.pnpm/openai@
|
|
21528
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/chat/completions/completions.mjs
|
|
21465
21529
|
class Completions extends APIResource {
|
|
21466
21530
|
constructor() {
|
|
21467
21531
|
super(...arguments);
|
|
@@ -21504,7 +21568,7 @@ class Completions extends APIResource {
|
|
|
21504
21568
|
}
|
|
21505
21569
|
Completions.Messages = Messages;
|
|
21506
21570
|
|
|
21507
|
-
// node_modules/.pnpm/openai@
|
|
21571
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/chat/chat.mjs
|
|
21508
21572
|
class Chat extends APIResource {
|
|
21509
21573
|
constructor() {
|
|
21510
21574
|
super(...arguments);
|
|
@@ -21512,7 +21576,7 @@ class Chat extends APIResource {
|
|
|
21512
21576
|
}
|
|
21513
21577
|
}
|
|
21514
21578
|
Chat.Completions = Completions;
|
|
21515
|
-
// node_modules/.pnpm/openai@
|
|
21579
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/headers.mjs
|
|
21516
21580
|
var brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders");
|
|
21517
21581
|
function* iterateHeaders(headers) {
|
|
21518
21582
|
if (!headers)
|
|
@@ -21575,7 +21639,7 @@ var buildHeaders = (newHeaders) => {
|
|
|
21575
21639
|
return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
|
|
21576
21640
|
};
|
|
21577
21641
|
|
|
21578
|
-
// node_modules/.pnpm/openai@
|
|
21642
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/speech.mjs
|
|
21579
21643
|
class Speech extends APIResource {
|
|
21580
21644
|
create(body, options) {
|
|
21581
21645
|
return this._client.post("/audio/speech", {
|
|
@@ -21587,7 +21651,7 @@ class Speech extends APIResource {
|
|
|
21587
21651
|
}
|
|
21588
21652
|
}
|
|
21589
21653
|
|
|
21590
|
-
// node_modules/.pnpm/openai@
|
|
21654
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/transcriptions.mjs
|
|
21591
21655
|
class Transcriptions extends APIResource {
|
|
21592
21656
|
create(body, options) {
|
|
21593
21657
|
return this._client.post("/audio/transcriptions", multipartFormRequestOptions({
|
|
@@ -21599,14 +21663,14 @@ class Transcriptions extends APIResource {
|
|
|
21599
21663
|
}
|
|
21600
21664
|
}
|
|
21601
21665
|
|
|
21602
|
-
// node_modules/.pnpm/openai@
|
|
21666
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/translations.mjs
|
|
21603
21667
|
class Translations extends APIResource {
|
|
21604
21668
|
create(body, options) {
|
|
21605
21669
|
return this._client.post("/audio/translations", multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model } }, this._client));
|
|
21606
21670
|
}
|
|
21607
21671
|
}
|
|
21608
21672
|
|
|
21609
|
-
// node_modules/.pnpm/openai@
|
|
21673
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/audio/audio.mjs
|
|
21610
21674
|
class Audio extends APIResource {
|
|
21611
21675
|
constructor() {
|
|
21612
21676
|
super(...arguments);
|
|
@@ -21618,7 +21682,7 @@ class Audio extends APIResource {
|
|
|
21618
21682
|
Audio.Transcriptions = Transcriptions;
|
|
21619
21683
|
Audio.Translations = Translations;
|
|
21620
21684
|
Audio.Speech = Speech;
|
|
21621
|
-
// node_modules/.pnpm/openai@
|
|
21685
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/batches.mjs
|
|
21622
21686
|
class Batches extends APIResource {
|
|
21623
21687
|
create(body, options) {
|
|
21624
21688
|
return this._client.post("/batches", { body, ...options });
|
|
@@ -21633,7 +21697,7 @@ class Batches extends APIResource {
|
|
|
21633
21697
|
return this._client.post(path`/batches/${batchID}/cancel`, options);
|
|
21634
21698
|
}
|
|
21635
21699
|
}
|
|
21636
|
-
// node_modules/.pnpm/openai@
|
|
21700
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/assistants.mjs
|
|
21637
21701
|
class Assistants extends APIResource {
|
|
21638
21702
|
create(body, options) {
|
|
21639
21703
|
return this._client.post("/assistants", {
|
|
@@ -21670,7 +21734,7 @@ class Assistants extends APIResource {
|
|
|
21670
21734
|
}
|
|
21671
21735
|
}
|
|
21672
21736
|
|
|
21673
|
-
// node_modules/.pnpm/openai@
|
|
21737
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/realtime/sessions.mjs
|
|
21674
21738
|
class Sessions extends APIResource {
|
|
21675
21739
|
create(body, options) {
|
|
21676
21740
|
return this._client.post("/realtime/sessions", {
|
|
@@ -21681,7 +21745,7 @@ class Sessions extends APIResource {
|
|
|
21681
21745
|
}
|
|
21682
21746
|
}
|
|
21683
21747
|
|
|
21684
|
-
// node_modules/.pnpm/openai@
|
|
21748
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/realtime/transcription-sessions.mjs
|
|
21685
21749
|
class TranscriptionSessions extends APIResource {
|
|
21686
21750
|
create(body, options) {
|
|
21687
21751
|
return this._client.post("/realtime/transcription_sessions", {
|
|
@@ -21692,7 +21756,7 @@ class TranscriptionSessions extends APIResource {
|
|
|
21692
21756
|
}
|
|
21693
21757
|
}
|
|
21694
21758
|
|
|
21695
|
-
// node_modules/.pnpm/openai@
|
|
21759
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/realtime/realtime.mjs
|
|
21696
21760
|
class Realtime extends APIResource {
|
|
21697
21761
|
constructor() {
|
|
21698
21762
|
super(...arguments);
|
|
@@ -21703,7 +21767,61 @@ class Realtime extends APIResource {
|
|
|
21703
21767
|
Realtime.Sessions = Sessions;
|
|
21704
21768
|
Realtime.TranscriptionSessions = TranscriptionSessions;
|
|
21705
21769
|
|
|
21706
|
-
// node_modules/.pnpm/openai@
|
|
21770
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
21771
|
+
class Sessions2 extends APIResource {
|
|
21772
|
+
create(body, options) {
|
|
21773
|
+
return this._client.post("/chatkit/sessions", {
|
|
21774
|
+
body,
|
|
21775
|
+
...options,
|
|
21776
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21777
|
+
});
|
|
21778
|
+
}
|
|
21779
|
+
cancel(sessionID, options) {
|
|
21780
|
+
return this._client.post(path`/chatkit/sessions/${sessionID}/cancel`, {
|
|
21781
|
+
...options,
|
|
21782
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21783
|
+
});
|
|
21784
|
+
}
|
|
21785
|
+
}
|
|
21786
|
+
|
|
21787
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/chatkit/threads.mjs
|
|
21788
|
+
class Threads extends APIResource {
|
|
21789
|
+
retrieve(threadID, options) {
|
|
21790
|
+
return this._client.get(path`/chatkit/threads/${threadID}`, {
|
|
21791
|
+
...options,
|
|
21792
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21793
|
+
});
|
|
21794
|
+
}
|
|
21795
|
+
list(query = {}, options) {
|
|
21796
|
+
return this._client.getAPIList("/chatkit/threads", ConversationCursorPage, {
|
|
21797
|
+
query,
|
|
21798
|
+
...options,
|
|
21799
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21800
|
+
});
|
|
21801
|
+
}
|
|
21802
|
+
delete(threadID, options) {
|
|
21803
|
+
return this._client.delete(path`/chatkit/threads/${threadID}`, {
|
|
21804
|
+
...options,
|
|
21805
|
+
headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
|
|
21806
|
+
});
|
|
21807
|
+
}
|
|
21808
|
+
listItems(threadID, query = {}, options) {
|
|
21809
|
+
return this._client.getAPIList(path`/chatkit/threads/${threadID}/items`, ConversationCursorPage, { query, ...options, headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers]) });
|
|
21810
|
+
}
|
|
21811
|
+
}
|
|
21812
|
+
|
|
21813
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/chatkit/chatkit.mjs
|
|
21814
|
+
class ChatKit extends APIResource {
|
|
21815
|
+
constructor() {
|
|
21816
|
+
super(...arguments);
|
|
21817
|
+
this.sessions = new Sessions2(this._client);
|
|
21818
|
+
this.threads = new Threads(this._client);
|
|
21819
|
+
}
|
|
21820
|
+
}
|
|
21821
|
+
ChatKit.Sessions = Sessions2;
|
|
21822
|
+
ChatKit.Threads = Threads;
|
|
21823
|
+
|
|
21824
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/messages.mjs
|
|
21707
21825
|
class Messages2 extends APIResource {
|
|
21708
21826
|
create(threadID, body, options) {
|
|
21709
21827
|
return this._client.post(path`/threads/${threadID}/messages`, {
|
|
@@ -21743,7 +21861,7 @@ class Messages2 extends APIResource {
|
|
|
21743
21861
|
}
|
|
21744
21862
|
}
|
|
21745
21863
|
|
|
21746
|
-
// node_modules/.pnpm/openai@
|
|
21864
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/steps.mjs
|
|
21747
21865
|
class Steps extends APIResource {
|
|
21748
21866
|
retrieve(stepID, params, options) {
|
|
21749
21867
|
const { thread_id, run_id, ...query } = params;
|
|
@@ -21762,7 +21880,7 @@ class Steps extends APIResource {
|
|
|
21762
21880
|
});
|
|
21763
21881
|
}
|
|
21764
21882
|
}
|
|
21765
|
-
// node_modules/.pnpm/openai@
|
|
21883
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/base64.mjs
|
|
21766
21884
|
var toFloat32Array = (base64Str) => {
|
|
21767
21885
|
if (typeof Buffer !== "undefined") {
|
|
21768
21886
|
const buf = Buffer.from(base64Str, "base64");
|
|
@@ -21777,7 +21895,7 @@ var toFloat32Array = (base64Str) => {
|
|
|
21777
21895
|
return Array.from(new Float32Array(bytes.buffer));
|
|
21778
21896
|
}
|
|
21779
21897
|
};
|
|
21780
|
-
// node_modules/.pnpm/openai@
|
|
21898
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/internal/utils/env.mjs
|
|
21781
21899
|
var readEnv = (env) => {
|
|
21782
21900
|
if (typeof globalThis.process !== "undefined") {
|
|
21783
21901
|
return globalThis.process.env?.[env]?.trim() ?? undefined;
|
|
@@ -21787,7 +21905,7 @@ var readEnv = (env) => {
|
|
|
21787
21905
|
}
|
|
21788
21906
|
return;
|
|
21789
21907
|
};
|
|
21790
|
-
// node_modules/.pnpm/openai@
|
|
21908
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/AssistantStream.mjs
|
|
21791
21909
|
var _AssistantStream_instances;
|
|
21792
21910
|
var _a;
|
|
21793
21911
|
var _AssistantStream_events;
|
|
@@ -22326,7 +22444,7 @@ _a = AssistantStream, _AssistantStream_addEvent = function _AssistantStream_addE
|
|
|
22326
22444
|
};
|
|
22327
22445
|
function assertNever2(_x) {}
|
|
22328
22446
|
|
|
22329
|
-
// node_modules/.pnpm/openai@
|
|
22447
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
22330
22448
|
class Runs extends APIResource {
|
|
22331
22449
|
constructor() {
|
|
22332
22450
|
super(...arguments);
|
|
@@ -22441,8 +22559,8 @@ class Runs extends APIResource {
|
|
|
22441
22559
|
}
|
|
22442
22560
|
Runs.Steps = Steps;
|
|
22443
22561
|
|
|
22444
|
-
// node_modules/.pnpm/openai@
|
|
22445
|
-
class
|
|
22562
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/threads/threads.mjs
|
|
22563
|
+
class Threads2 extends APIResource {
|
|
22446
22564
|
constructor() {
|
|
22447
22565
|
super(...arguments);
|
|
22448
22566
|
this.runs = new Runs(this._client);
|
|
@@ -22490,28 +22608,30 @@ class Threads extends APIResource {
|
|
|
22490
22608
|
return AssistantStream.createThreadAssistantStream(body, this._client.beta.threads, options);
|
|
22491
22609
|
}
|
|
22492
22610
|
}
|
|
22493
|
-
|
|
22494
|
-
|
|
22611
|
+
Threads2.Runs = Runs;
|
|
22612
|
+
Threads2.Messages = Messages2;
|
|
22495
22613
|
|
|
22496
|
-
// node_modules/.pnpm/openai@
|
|
22614
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/beta/beta.mjs
|
|
22497
22615
|
class Beta extends APIResource {
|
|
22498
22616
|
constructor() {
|
|
22499
22617
|
super(...arguments);
|
|
22500
22618
|
this.realtime = new Realtime(this._client);
|
|
22619
|
+
this.chatkit = new ChatKit(this._client);
|
|
22501
22620
|
this.assistants = new Assistants(this._client);
|
|
22502
|
-
this.threads = new
|
|
22621
|
+
this.threads = new Threads2(this._client);
|
|
22503
22622
|
}
|
|
22504
22623
|
}
|
|
22505
22624
|
Beta.Realtime = Realtime;
|
|
22625
|
+
Beta.ChatKit = ChatKit;
|
|
22506
22626
|
Beta.Assistants = Assistants;
|
|
22507
|
-
Beta.Threads =
|
|
22508
|
-
// node_modules/.pnpm/openai@
|
|
22627
|
+
Beta.Threads = Threads2;
|
|
22628
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/completions.mjs
|
|
22509
22629
|
class Completions2 extends APIResource {
|
|
22510
22630
|
create(body, options) {
|
|
22511
22631
|
return this._client.post("/completions", { body, ...options, stream: body.stream ?? false });
|
|
22512
22632
|
}
|
|
22513
22633
|
}
|
|
22514
|
-
// node_modules/.pnpm/openai@
|
|
22634
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/containers/files/content.mjs
|
|
22515
22635
|
class Content extends APIResource {
|
|
22516
22636
|
retrieve(fileID, params, options) {
|
|
22517
22637
|
const { container_id } = params;
|
|
@@ -22523,7 +22643,7 @@ class Content extends APIResource {
|
|
|
22523
22643
|
}
|
|
22524
22644
|
}
|
|
22525
22645
|
|
|
22526
|
-
// node_modules/.pnpm/openai@
|
|
22646
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/containers/files/files.mjs
|
|
22527
22647
|
class Files extends APIResource {
|
|
22528
22648
|
constructor() {
|
|
22529
22649
|
super(...arguments);
|
|
@@ -22552,7 +22672,7 @@ class Files extends APIResource {
|
|
|
22552
22672
|
}
|
|
22553
22673
|
Files.Content = Content;
|
|
22554
22674
|
|
|
22555
|
-
// node_modules/.pnpm/openai@
|
|
22675
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/containers/containers.mjs
|
|
22556
22676
|
class Containers extends APIResource {
|
|
22557
22677
|
constructor() {
|
|
22558
22678
|
super(...arguments);
|
|
@@ -22575,7 +22695,50 @@ class Containers extends APIResource {
|
|
|
22575
22695
|
}
|
|
22576
22696
|
}
|
|
22577
22697
|
Containers.Files = Files;
|
|
22578
|
-
// node_modules/.pnpm/openai@
|
|
22698
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/conversations/items.mjs
|
|
22699
|
+
class Items extends APIResource {
|
|
22700
|
+
create(conversationID, params, options) {
|
|
22701
|
+
const { include, ...body } = params;
|
|
22702
|
+
return this._client.post(path`/conversations/${conversationID}/items`, {
|
|
22703
|
+
query: { include },
|
|
22704
|
+
body,
|
|
22705
|
+
...options
|
|
22706
|
+
});
|
|
22707
|
+
}
|
|
22708
|
+
retrieve(itemID, params, options) {
|
|
22709
|
+
const { conversation_id, ...query } = params;
|
|
22710
|
+
return this._client.get(path`/conversations/${conversation_id}/items/${itemID}`, { query, ...options });
|
|
22711
|
+
}
|
|
22712
|
+
list(conversationID, query = {}, options) {
|
|
22713
|
+
return this._client.getAPIList(path`/conversations/${conversationID}/items`, ConversationCursorPage, { query, ...options });
|
|
22714
|
+
}
|
|
22715
|
+
delete(itemID, params, options) {
|
|
22716
|
+
const { conversation_id } = params;
|
|
22717
|
+
return this._client.delete(path`/conversations/${conversation_id}/items/${itemID}`, options);
|
|
22718
|
+
}
|
|
22719
|
+
}
|
|
22720
|
+
|
|
22721
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/conversations/conversations.mjs
|
|
22722
|
+
class Conversations extends APIResource {
|
|
22723
|
+
constructor() {
|
|
22724
|
+
super(...arguments);
|
|
22725
|
+
this.items = new Items(this._client);
|
|
22726
|
+
}
|
|
22727
|
+
create(body = {}, options) {
|
|
22728
|
+
return this._client.post("/conversations", { body, ...options });
|
|
22729
|
+
}
|
|
22730
|
+
retrieve(conversationID, options) {
|
|
22731
|
+
return this._client.get(path`/conversations/${conversationID}`, options);
|
|
22732
|
+
}
|
|
22733
|
+
update(conversationID, body, options) {
|
|
22734
|
+
return this._client.post(path`/conversations/${conversationID}`, { body, ...options });
|
|
22735
|
+
}
|
|
22736
|
+
delete(conversationID, options) {
|
|
22737
|
+
return this._client.delete(path`/conversations/${conversationID}`, options);
|
|
22738
|
+
}
|
|
22739
|
+
}
|
|
22740
|
+
Conversations.Items = Items;
|
|
22741
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/embeddings.mjs
|
|
22579
22742
|
class Embeddings extends APIResource {
|
|
22580
22743
|
create(body, options) {
|
|
22581
22744
|
const hasUserProvidedEncodingFormat = !!body.encoding_format;
|
|
@@ -22605,7 +22768,7 @@ class Embeddings extends APIResource {
|
|
|
22605
22768
|
});
|
|
22606
22769
|
}
|
|
22607
22770
|
}
|
|
22608
|
-
// node_modules/.pnpm/openai@
|
|
22771
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/evals/runs/output-items.mjs
|
|
22609
22772
|
class OutputItems extends APIResource {
|
|
22610
22773
|
retrieve(outputItemID, params, options) {
|
|
22611
22774
|
const { eval_id, run_id } = params;
|
|
@@ -22617,7 +22780,7 @@ class OutputItems extends APIResource {
|
|
|
22617
22780
|
}
|
|
22618
22781
|
}
|
|
22619
22782
|
|
|
22620
|
-
// node_modules/.pnpm/openai@
|
|
22783
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/evals/runs/runs.mjs
|
|
22621
22784
|
class Runs2 extends APIResource {
|
|
22622
22785
|
constructor() {
|
|
22623
22786
|
super(...arguments);
|
|
@@ -22647,7 +22810,7 @@ class Runs2 extends APIResource {
|
|
|
22647
22810
|
}
|
|
22648
22811
|
Runs2.OutputItems = OutputItems;
|
|
22649
22812
|
|
|
22650
|
-
// node_modules/.pnpm/openai@
|
|
22813
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/evals/evals.mjs
|
|
22651
22814
|
class Evals extends APIResource {
|
|
22652
22815
|
constructor() {
|
|
22653
22816
|
super(...arguments);
|
|
@@ -22670,7 +22833,7 @@ class Evals extends APIResource {
|
|
|
22670
22833
|
}
|
|
22671
22834
|
}
|
|
22672
22835
|
Evals.Runs = Runs2;
|
|
22673
|
-
// node_modules/.pnpm/openai@
|
|
22836
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/files.mjs
|
|
22674
22837
|
class Files2 extends APIResource {
|
|
22675
22838
|
create(body, options) {
|
|
22676
22839
|
return this._client.post("/files", multipartFormRequestOptions({ body, ...options }, this._client));
|
|
@@ -22707,11 +22870,11 @@ class Files2 extends APIResource {
|
|
|
22707
22870
|
return file;
|
|
22708
22871
|
}
|
|
22709
22872
|
}
|
|
22710
|
-
// node_modules/.pnpm/openai@
|
|
22873
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/methods.mjs
|
|
22711
22874
|
class Methods extends APIResource {
|
|
22712
22875
|
}
|
|
22713
22876
|
|
|
22714
|
-
// node_modules/.pnpm/openai@
|
|
22877
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/graders.mjs
|
|
22715
22878
|
class Graders extends APIResource {
|
|
22716
22879
|
run(body, options) {
|
|
22717
22880
|
return this._client.post("/fine_tuning/alpha/graders/run", { body, ...options });
|
|
@@ -22721,7 +22884,7 @@ class Graders extends APIResource {
|
|
|
22721
22884
|
}
|
|
22722
22885
|
}
|
|
22723
22886
|
|
|
22724
|
-
// node_modules/.pnpm/openai@
|
|
22887
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/alpha.mjs
|
|
22725
22888
|
class Alpha extends APIResource {
|
|
22726
22889
|
constructor() {
|
|
22727
22890
|
super(...arguments);
|
|
@@ -22730,7 +22893,7 @@ class Alpha extends APIResource {
|
|
|
22730
22893
|
}
|
|
22731
22894
|
Alpha.Graders = Graders;
|
|
22732
22895
|
|
|
22733
|
-
// node_modules/.pnpm/openai@
|
|
22896
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
22734
22897
|
class Permissions extends APIResource {
|
|
22735
22898
|
create(fineTunedModelCheckpoint, body, options) {
|
|
22736
22899
|
return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options });
|
|
@@ -22747,7 +22910,7 @@ class Permissions extends APIResource {
|
|
|
22747
22910
|
}
|
|
22748
22911
|
}
|
|
22749
22912
|
|
|
22750
|
-
// node_modules/.pnpm/openai@
|
|
22913
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs
|
|
22751
22914
|
class Checkpoints extends APIResource {
|
|
22752
22915
|
constructor() {
|
|
22753
22916
|
super(...arguments);
|
|
@@ -22756,14 +22919,14 @@ class Checkpoints extends APIResource {
|
|
|
22756
22919
|
}
|
|
22757
22920
|
Checkpoints.Permissions = Permissions;
|
|
22758
22921
|
|
|
22759
|
-
// node_modules/.pnpm/openai@
|
|
22922
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
22760
22923
|
class Checkpoints2 extends APIResource {
|
|
22761
22924
|
list(fineTuningJobID, query = {}, options) {
|
|
22762
22925
|
return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query, ...options });
|
|
22763
22926
|
}
|
|
22764
22927
|
}
|
|
22765
22928
|
|
|
22766
|
-
// node_modules/.pnpm/openai@
|
|
22929
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs
|
|
22767
22930
|
class Jobs extends APIResource {
|
|
22768
22931
|
constructor() {
|
|
22769
22932
|
super(...arguments);
|
|
@@ -22793,7 +22956,7 @@ class Jobs extends APIResource {
|
|
|
22793
22956
|
}
|
|
22794
22957
|
Jobs.Checkpoints = Checkpoints2;
|
|
22795
22958
|
|
|
22796
|
-
// node_modules/.pnpm/openai@
|
|
22959
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
22797
22960
|
class FineTuning extends APIResource {
|
|
22798
22961
|
constructor() {
|
|
22799
22962
|
super(...arguments);
|
|
@@ -22807,11 +22970,11 @@ FineTuning.Methods = Methods;
|
|
|
22807
22970
|
FineTuning.Jobs = Jobs;
|
|
22808
22971
|
FineTuning.Checkpoints = Checkpoints;
|
|
22809
22972
|
FineTuning.Alpha = Alpha;
|
|
22810
|
-
// node_modules/.pnpm/openai@
|
|
22973
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/graders/grader-models.mjs
|
|
22811
22974
|
class GraderModels extends APIResource {
|
|
22812
22975
|
}
|
|
22813
22976
|
|
|
22814
|
-
// node_modules/.pnpm/openai@
|
|
22977
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/graders/graders.mjs
|
|
22815
22978
|
class Graders2 extends APIResource {
|
|
22816
22979
|
constructor() {
|
|
22817
22980
|
super(...arguments);
|
|
@@ -22819,7 +22982,7 @@ class Graders2 extends APIResource {
|
|
|
22819
22982
|
}
|
|
22820
22983
|
}
|
|
22821
22984
|
Graders2.GraderModels = GraderModels;
|
|
22822
|
-
// node_modules/.pnpm/openai@
|
|
22985
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/images.mjs
|
|
22823
22986
|
class Images extends APIResource {
|
|
22824
22987
|
createVariation(body, options) {
|
|
22825
22988
|
return this._client.post("/images/variations", multipartFormRequestOptions({ body, ...options }, this._client));
|
|
@@ -22831,7 +22994,7 @@ class Images extends APIResource {
|
|
|
22831
22994
|
return this._client.post("/images/generations", { body, ...options, stream: body.stream ?? false });
|
|
22832
22995
|
}
|
|
22833
22996
|
}
|
|
22834
|
-
// node_modules/.pnpm/openai@
|
|
22997
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/models.mjs
|
|
22835
22998
|
class Models extends APIResource {
|
|
22836
22999
|
retrieve(model, options) {
|
|
22837
23000
|
return this._client.get(path`/models/${model}`, options);
|
|
@@ -22843,13 +23006,61 @@ class Models extends APIResource {
|
|
|
22843
23006
|
return this._client.delete(path`/models/${model}`, options);
|
|
22844
23007
|
}
|
|
22845
23008
|
}
|
|
22846
|
-
// node_modules/.pnpm/openai@
|
|
23009
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/moderations.mjs
|
|
22847
23010
|
class Moderations extends APIResource {
|
|
22848
23011
|
create(body, options) {
|
|
22849
23012
|
return this._client.post("/moderations", { body, ...options });
|
|
22850
23013
|
}
|
|
22851
23014
|
}
|
|
22852
|
-
// node_modules/.pnpm/openai@
|
|
23015
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/realtime/calls.mjs
|
|
23016
|
+
class Calls extends APIResource {
|
|
23017
|
+
accept(callID, body, options) {
|
|
23018
|
+
return this._client.post(path`/realtime/calls/${callID}/accept`, {
|
|
23019
|
+
body,
|
|
23020
|
+
...options,
|
|
23021
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23022
|
+
});
|
|
23023
|
+
}
|
|
23024
|
+
hangup(callID, options) {
|
|
23025
|
+
return this._client.post(path`/realtime/calls/${callID}/hangup`, {
|
|
23026
|
+
...options,
|
|
23027
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23028
|
+
});
|
|
23029
|
+
}
|
|
23030
|
+
refer(callID, body, options) {
|
|
23031
|
+
return this._client.post(path`/realtime/calls/${callID}/refer`, {
|
|
23032
|
+
body,
|
|
23033
|
+
...options,
|
|
23034
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23035
|
+
});
|
|
23036
|
+
}
|
|
23037
|
+
reject(callID, body = {}, options) {
|
|
23038
|
+
return this._client.post(path`/realtime/calls/${callID}/reject`, {
|
|
23039
|
+
body,
|
|
23040
|
+
...options,
|
|
23041
|
+
headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
|
|
23042
|
+
});
|
|
23043
|
+
}
|
|
23044
|
+
}
|
|
23045
|
+
|
|
23046
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/realtime/client-secrets.mjs
|
|
23047
|
+
class ClientSecrets extends APIResource {
|
|
23048
|
+
create(body, options) {
|
|
23049
|
+
return this._client.post("/realtime/client_secrets", { body, ...options });
|
|
23050
|
+
}
|
|
23051
|
+
}
|
|
23052
|
+
|
|
23053
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/realtime/realtime.mjs
|
|
23054
|
+
class Realtime2 extends APIResource {
|
|
23055
|
+
constructor() {
|
|
23056
|
+
super(...arguments);
|
|
23057
|
+
this.clientSecrets = new ClientSecrets(this._client);
|
|
23058
|
+
this.calls = new Calls(this._client);
|
|
23059
|
+
}
|
|
23060
|
+
}
|
|
23061
|
+
Realtime2.ClientSecrets = ClientSecrets;
|
|
23062
|
+
Realtime2.Calls = Calls;
|
|
23063
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/ResponsesParser.mjs
|
|
22853
23064
|
function maybeParseResponse(response, params) {
|
|
22854
23065
|
if (!params || !hasAutoParseableInput2(params)) {
|
|
22855
23066
|
return {
|
|
@@ -22970,7 +23181,7 @@ function addOutputText(rsp) {
|
|
|
22970
23181
|
rsp.output_text = texts.join("");
|
|
22971
23182
|
}
|
|
22972
23183
|
|
|
22973
|
-
// node_modules/.pnpm/openai@
|
|
23184
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.mjs
|
|
22974
23185
|
var _ResponseStream_instances;
|
|
22975
23186
|
var _ResponseStream_params;
|
|
22976
23187
|
var _ResponseStream_currentResponseSnapshot;
|
|
@@ -23105,8 +23316,15 @@ class ResponseStream extends EventStream {
|
|
|
23105
23316
|
if (!output) {
|
|
23106
23317
|
throw new OpenAIError(`missing output at index ${event.output_index}`);
|
|
23107
23318
|
}
|
|
23108
|
-
|
|
23109
|
-
|
|
23319
|
+
const type = output.type;
|
|
23320
|
+
const part = event.part;
|
|
23321
|
+
if (type === "message" && part.type !== "reasoning_text") {
|
|
23322
|
+
output.content.push(part);
|
|
23323
|
+
} else if (type === "reasoning" && part.type === "reasoning_text") {
|
|
23324
|
+
if (!output.content) {
|
|
23325
|
+
output.content = [];
|
|
23326
|
+
}
|
|
23327
|
+
output.content.push(part);
|
|
23110
23328
|
}
|
|
23111
23329
|
break;
|
|
23112
23330
|
}
|
|
@@ -23137,6 +23355,23 @@ class ResponseStream extends EventStream {
|
|
|
23137
23355
|
}
|
|
23138
23356
|
break;
|
|
23139
23357
|
}
|
|
23358
|
+
case "response.reasoning_text.delta": {
|
|
23359
|
+
const output = snapshot.output[event.output_index];
|
|
23360
|
+
if (!output) {
|
|
23361
|
+
throw new OpenAIError(`missing output at index ${event.output_index}`);
|
|
23362
|
+
}
|
|
23363
|
+
if (output.type === "reasoning") {
|
|
23364
|
+
const content = output.content?.[event.content_index];
|
|
23365
|
+
if (!content) {
|
|
23366
|
+
throw new OpenAIError(`missing content at index ${event.content_index}`);
|
|
23367
|
+
}
|
|
23368
|
+
if (content.type !== "reasoning_text") {
|
|
23369
|
+
throw new OpenAIError(`expected content to be 'reasoning_text', got ${content.type}`);
|
|
23370
|
+
}
|
|
23371
|
+
content.text += event.delta;
|
|
23372
|
+
}
|
|
23373
|
+
break;
|
|
23374
|
+
}
|
|
23140
23375
|
case "response.completed": {
|
|
23141
23376
|
__classPrivateFieldSet(this, _ResponseStream_currentResponseSnapshot, event.response, "f");
|
|
23142
23377
|
break;
|
|
@@ -23205,18 +23440,26 @@ function finalizeResponse(snapshot, params) {
|
|
|
23205
23440
|
return maybeParseResponse(snapshot, params);
|
|
23206
23441
|
}
|
|
23207
23442
|
|
|
23208
|
-
// node_modules/.pnpm/openai@
|
|
23443
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/responses/input-items.mjs
|
|
23209
23444
|
class InputItems extends APIResource {
|
|
23210
23445
|
list(responseID, query = {}, options) {
|
|
23211
23446
|
return this._client.getAPIList(path`/responses/${responseID}/input_items`, CursorPage, { query, ...options });
|
|
23212
23447
|
}
|
|
23213
23448
|
}
|
|
23214
23449
|
|
|
23215
|
-
// node_modules/.pnpm/openai@
|
|
23450
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/responses/input-tokens.mjs
|
|
23451
|
+
class InputTokens extends APIResource {
|
|
23452
|
+
count(body = {}, options) {
|
|
23453
|
+
return this._client.post("/responses/input_tokens", { body, ...options });
|
|
23454
|
+
}
|
|
23455
|
+
}
|
|
23456
|
+
|
|
23457
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/responses/responses.mjs
|
|
23216
23458
|
class Responses extends APIResource {
|
|
23217
23459
|
constructor() {
|
|
23218
23460
|
super(...arguments);
|
|
23219
23461
|
this.inputItems = new InputItems(this._client);
|
|
23462
|
+
this.inputTokens = new InputTokens(this._client);
|
|
23220
23463
|
}
|
|
23221
23464
|
create(body, options) {
|
|
23222
23465
|
return this._client.post("/responses", { body, ...options, stream: body.stream ?? false })._thenUnwrap((rsp) => {
|
|
@@ -23255,14 +23498,15 @@ class Responses extends APIResource {
|
|
|
23255
23498
|
}
|
|
23256
23499
|
}
|
|
23257
23500
|
Responses.InputItems = InputItems;
|
|
23258
|
-
|
|
23501
|
+
Responses.InputTokens = InputTokens;
|
|
23502
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/uploads/parts.mjs
|
|
23259
23503
|
class Parts extends APIResource {
|
|
23260
23504
|
create(uploadID, body, options) {
|
|
23261
23505
|
return this._client.post(path`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options }, this._client));
|
|
23262
23506
|
}
|
|
23263
23507
|
}
|
|
23264
23508
|
|
|
23265
|
-
// node_modules/.pnpm/openai@
|
|
23509
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/uploads/uploads.mjs
|
|
23266
23510
|
class Uploads extends APIResource {
|
|
23267
23511
|
constructor() {
|
|
23268
23512
|
super(...arguments);
|
|
@@ -23279,7 +23523,7 @@ class Uploads extends APIResource {
|
|
|
23279
23523
|
}
|
|
23280
23524
|
}
|
|
23281
23525
|
Uploads.Parts = Parts;
|
|
23282
|
-
// node_modules/.pnpm/openai@
|
|
23526
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/lib/Util.mjs
|
|
23283
23527
|
var allSettledWithThrow = async (promises) => {
|
|
23284
23528
|
const results = await Promise.allSettled(promises);
|
|
23285
23529
|
const rejected = results.filter((result) => result.status === "rejected");
|
|
@@ -23298,7 +23542,7 @@ var allSettledWithThrow = async (promises) => {
|
|
|
23298
23542
|
return values2;
|
|
23299
23543
|
};
|
|
23300
23544
|
|
|
23301
|
-
// node_modules/.pnpm/openai@
|
|
23545
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
23302
23546
|
class FileBatches extends APIResource {
|
|
23303
23547
|
create(vectorStoreID, body, options) {
|
|
23304
23548
|
return this._client.post(path`/vector_stores/${vectorStoreID}/file_batches`, {
|
|
@@ -23388,7 +23632,7 @@ class FileBatches extends APIResource {
|
|
|
23388
23632
|
}
|
|
23389
23633
|
}
|
|
23390
23634
|
|
|
23391
|
-
// node_modules/.pnpm/openai@
|
|
23635
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/vector-stores/files.mjs
|
|
23392
23636
|
class Files3 extends APIResource {
|
|
23393
23637
|
create(vectorStoreID, body, options) {
|
|
23394
23638
|
return this._client.post(path`/vector_stores/${vectorStoreID}/files`, {
|
|
@@ -23479,7 +23723,7 @@ class Files3 extends APIResource {
|
|
|
23479
23723
|
}
|
|
23480
23724
|
}
|
|
23481
23725
|
|
|
23482
|
-
// node_modules/.pnpm/openai@
|
|
23726
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
23483
23727
|
class VectorStores extends APIResource {
|
|
23484
23728
|
constructor() {
|
|
23485
23729
|
super(...arguments);
|
|
@@ -23530,7 +23774,33 @@ class VectorStores extends APIResource {
|
|
|
23530
23774
|
}
|
|
23531
23775
|
VectorStores.Files = Files3;
|
|
23532
23776
|
VectorStores.FileBatches = FileBatches;
|
|
23533
|
-
// node_modules/.pnpm/openai@
|
|
23777
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/videos.mjs
|
|
23778
|
+
class Videos extends APIResource {
|
|
23779
|
+
create(body, options) {
|
|
23780
|
+
return this._client.post("/videos", maybeMultipartFormRequestOptions({ body, ...options }, this._client));
|
|
23781
|
+
}
|
|
23782
|
+
retrieve(videoID, options) {
|
|
23783
|
+
return this._client.get(path`/videos/${videoID}`, options);
|
|
23784
|
+
}
|
|
23785
|
+
list(query = {}, options) {
|
|
23786
|
+
return this._client.getAPIList("/videos", ConversationCursorPage, { query, ...options });
|
|
23787
|
+
}
|
|
23788
|
+
delete(videoID, options) {
|
|
23789
|
+
return this._client.delete(path`/videos/${videoID}`, options);
|
|
23790
|
+
}
|
|
23791
|
+
downloadContent(videoID, query = {}, options) {
|
|
23792
|
+
return this._client.get(path`/videos/${videoID}/content`, {
|
|
23793
|
+
query,
|
|
23794
|
+
...options,
|
|
23795
|
+
headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
|
|
23796
|
+
__binaryResponse: true
|
|
23797
|
+
});
|
|
23798
|
+
}
|
|
23799
|
+
remix(videoID, body, options) {
|
|
23800
|
+
return this._client.post(path`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options }, this._client));
|
|
23801
|
+
}
|
|
23802
|
+
}
|
|
23803
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/resources/webhooks.mjs
|
|
23534
23804
|
var _Webhooks_instances;
|
|
23535
23805
|
var _Webhooks_validateSecret;
|
|
23536
23806
|
var _Webhooks_getRequiredHeader;
|
|
@@ -23596,7 +23866,7 @@ _Webhooks_instances = new WeakSet, _Webhooks_validateSecret = function _Webhooks
|
|
|
23596
23866
|
}
|
|
23597
23867
|
return value;
|
|
23598
23868
|
};
|
|
23599
|
-
// node_modules/.pnpm/openai@
|
|
23869
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/client.mjs
|
|
23600
23870
|
var _OpenAI_instances;
|
|
23601
23871
|
var _a2;
|
|
23602
23872
|
var _OpenAI_encoder;
|
|
@@ -23622,10 +23892,13 @@ class OpenAI {
|
|
|
23622
23892
|
this.batches = new Batches(this);
|
|
23623
23893
|
this.uploads = new Uploads(this);
|
|
23624
23894
|
this.responses = new Responses(this);
|
|
23895
|
+
this.realtime = new Realtime2(this);
|
|
23896
|
+
this.conversations = new Conversations(this);
|
|
23625
23897
|
this.evals = new Evals(this);
|
|
23626
23898
|
this.containers = new Containers(this);
|
|
23899
|
+
this.videos = new Videos(this);
|
|
23627
23900
|
if (apiKey === undefined) {
|
|
23628
|
-
throw new OpenAIError("
|
|
23901
|
+
throw new OpenAIError("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");
|
|
23629
23902
|
}
|
|
23630
23903
|
const options = {
|
|
23631
23904
|
apiKey,
|
|
@@ -23658,7 +23931,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23658
23931
|
this.fetch = options.fetch ?? getDefaultFetch();
|
|
23659
23932
|
__classPrivateFieldSet(this, _OpenAI_encoder, FallbackEncoder, "f");
|
|
23660
23933
|
this._options = options;
|
|
23661
|
-
this.apiKey = apiKey;
|
|
23934
|
+
this.apiKey = typeof apiKey === "string" ? apiKey : "Missing Key";
|
|
23662
23935
|
this.organization = organization;
|
|
23663
23936
|
this.project = project;
|
|
23664
23937
|
this.webhookSecret = webhookSecret;
|
|
@@ -23702,6 +23975,24 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23702
23975
|
makeStatusError(status, error2, message, headers) {
|
|
23703
23976
|
return APIError.generate(status, error2, message, headers);
|
|
23704
23977
|
}
|
|
23978
|
+
async _callApiKey() {
|
|
23979
|
+
const apiKey = this._options.apiKey;
|
|
23980
|
+
if (typeof apiKey !== "function")
|
|
23981
|
+
return false;
|
|
23982
|
+
let token;
|
|
23983
|
+
try {
|
|
23984
|
+
token = await apiKey();
|
|
23985
|
+
} catch (err) {
|
|
23986
|
+
if (err instanceof OpenAIError)
|
|
23987
|
+
throw err;
|
|
23988
|
+
throw new OpenAIError(`Failed to get token from 'apiKey' function: ${err.message}`, { cause: err });
|
|
23989
|
+
}
|
|
23990
|
+
if (typeof token !== "string" || !token) {
|
|
23991
|
+
throw new OpenAIError(`Expected 'apiKey' function argument to return a string but it returned ${token}`);
|
|
23992
|
+
}
|
|
23993
|
+
this.apiKey = token;
|
|
23994
|
+
return true;
|
|
23995
|
+
}
|
|
23705
23996
|
buildURL(path2, query, defaultBaseURL) {
|
|
23706
23997
|
const baseURL = !__classPrivateFieldGet(this, _OpenAI_instances, "m", _OpenAI_baseURLOverridden).call(this) && defaultBaseURL || this.baseURL;
|
|
23707
23998
|
const url = isAbsoluteURL(path2) ? new URL(path2) : new URL(baseURL + (baseURL.endsWith("/") && path2.startsWith("/") ? path2.slice(1) : path2));
|
|
@@ -23714,7 +24005,9 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23714
24005
|
}
|
|
23715
24006
|
return url.toString();
|
|
23716
24007
|
}
|
|
23717
|
-
async prepareOptions(options) {
|
|
24008
|
+
async prepareOptions(options) {
|
|
24009
|
+
await this._callApiKey();
|
|
24010
|
+
}
|
|
23718
24011
|
async prepareRequest(request, { url, options }) {}
|
|
23719
24012
|
get(path2, opts) {
|
|
23720
24013
|
return this.methodRequest("get", path2, opts);
|
|
@@ -23766,7 +24059,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23766
24059
|
const controller = new AbortController;
|
|
23767
24060
|
const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
|
|
23768
24061
|
const headersTime = Date.now();
|
|
23769
|
-
if (response instanceof Error) {
|
|
24062
|
+
if (response instanceof globalThis.Error) {
|
|
23770
24063
|
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
|
|
23771
24064
|
if (options.signal?.aborted) {
|
|
23772
24065
|
throw new APIUserAbortError;
|
|
@@ -23965,7 +24258,7 @@ https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|
|
23965
24258
|
return { bodyHeaders: undefined, body: undefined };
|
|
23966
24259
|
}
|
|
23967
24260
|
const headers = buildHeaders([rawHeaders]);
|
|
23968
|
-
if (ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && headers.values.has("content-type") || body instanceof Blob || body instanceof FormData || body instanceof URLSearchParams || globalThis.ReadableStream && body instanceof globalThis.ReadableStream) {
|
|
24261
|
+
if (ArrayBuffer.isView(body) || body instanceof ArrayBuffer || body instanceof DataView || typeof body === "string" && headers.values.has("content-type") || globalThis.Blob && body instanceof globalThis.Blob || body instanceof FormData || body instanceof URLSearchParams || globalThis.ReadableStream && body instanceof globalThis.ReadableStream) {
|
|
23969
24262
|
return { bodyHeaders: undefined, body };
|
|
23970
24263
|
} else if (typeof body === "object" && ((Symbol.asyncIterator in body) || (Symbol.iterator in body) && ("next" in body) && typeof body.next === "function")) {
|
|
23971
24264
|
return { bodyHeaders: undefined, body: ReadableStreamFrom(body) };
|
|
@@ -24010,9 +24303,12 @@ OpenAI.Beta = Beta;
|
|
|
24010
24303
|
OpenAI.Batches = Batches;
|
|
24011
24304
|
OpenAI.Uploads = Uploads;
|
|
24012
24305
|
OpenAI.Responses = Responses;
|
|
24306
|
+
OpenAI.Realtime = Realtime2;
|
|
24307
|
+
OpenAI.Conversations = Conversations;
|
|
24013
24308
|
OpenAI.Evals = Evals;
|
|
24014
24309
|
OpenAI.Containers = Containers;
|
|
24015
|
-
|
|
24310
|
+
OpenAI.Videos = Videos;
|
|
24311
|
+
// node_modules/.pnpm/openai@6.6.0_ws@8.18.3_zod@3.25.76/node_modules/openai/azure.mjs
|
|
24016
24312
|
var _deployments_endpoints = new Set([
|
|
24017
24313
|
"/completions",
|
|
24018
24314
|
"/chat/completions",
|