supercompat 4.0.0 → 4.0.1
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/openai/index.cjs +44 -41
- package/dist/openai/index.cjs.map +1 -1
- package/dist/openai/index.js +44 -41
- package/dist/openai/index.js.map +1 -1
- package/package.json +1 -1
package/dist/openai/index.cjs
CHANGED
|
@@ -80501,7 +80501,9 @@ var import_radash22 = require("radash");
|
|
|
80501
80501
|
// src/lib/sse/enqueueSSE.ts
|
|
80502
80502
|
var encoder11 = new TextEncoder();
|
|
80503
80503
|
var enqueueSSE = function(controller, event, data) {
|
|
80504
|
-
|
|
80504
|
+
try {
|
|
80505
|
+
controller.enqueue(encoder11.encode("event: ".concat(event, "\ndata: ").concat(JSON.stringify(data), "\n\n")));
|
|
80506
|
+
} catch (unused) {}
|
|
80505
80507
|
};
|
|
80506
80508
|
// src/handlers/assistants/prismaStorageAdapter/threads/runs/onEvent/handlers/threadRunInProgress.ts
|
|
80507
80509
|
var threadRunInProgress = function(param) {
|
|
@@ -89166,50 +89168,51 @@ var import_radash32 = require("radash");
|
|
|
89166
89168
|
var serializeTools5 = function(param) {
|
|
89167
89169
|
var tools = param.tools, useOpenaiComputerTool = param.useOpenaiComputerTool, toolResources = param.toolResources;
|
|
89168
89170
|
if (!(tools === null || tools === void 0 ? void 0 : tools.length)) return {};
|
|
89169
|
-
|
|
89170
|
-
|
|
89171
|
-
|
|
89172
|
-
|
|
89173
|
-
|
|
89174
|
-
|
|
89175
|
-
|
|
89176
|
-
|
|
89177
|
-
|
|
89178
|
-
if (serialized.type === "computer") {
|
|
89179
|
-
return {
|
|
89180
|
-
type: "computer"
|
|
89181
|
-
};
|
|
89182
|
-
}
|
|
89183
|
-
var config = (_serialized_computer_use_preview = serialized.computer_use_preview) !== null && _serialized_computer_use_preview !== void 0 ? _serialized_computer_use_preview : {};
|
|
89184
|
-
return _object_spread({
|
|
89185
|
-
type: "computer_use_preview"
|
|
89186
|
-
}, config);
|
|
89187
|
-
}
|
|
89188
|
-
if (toolType === "code_interpreter") {
|
|
89189
|
-
var _ref;
|
|
89190
|
-
var _tool_code_interpreter;
|
|
89171
|
+
var mapped = tools.map(function(tool) {
|
|
89172
|
+
var toolType = tool.type;
|
|
89173
|
+
if (toolType === "computer" || toolType === "computer_use_preview") {
|
|
89174
|
+
var _serialized_computer_use_preview;
|
|
89175
|
+
var serialized = serializeComputerUseTool({
|
|
89176
|
+
useOpenaiComputerTool: useOpenaiComputerTool,
|
|
89177
|
+
tool: tool
|
|
89178
|
+
});
|
|
89179
|
+
if (serialized.type === "computer") {
|
|
89191
89180
|
return {
|
|
89192
|
-
type: "
|
|
89193
|
-
container: (_ref = (_tool_code_interpreter = tool.code_interpreter) === null || _tool_code_interpreter === void 0 ? void 0 : _tool_code_interpreter.container) !== null && _ref !== void 0 ? _ref : {
|
|
89194
|
-
type: "auto"
|
|
89195
|
-
}
|
|
89181
|
+
type: "computer"
|
|
89196
89182
|
};
|
|
89197
89183
|
}
|
|
89198
|
-
|
|
89199
|
-
var _ref1;
|
|
89200
|
-
var _toolResources_file_search;
|
|
89201
|
-
var vectorStoreIds = (_ref1 = toolResources === null || toolResources === void 0 ? void 0 : (_toolResources_file_search = toolResources.file_search) === null || _toolResources_file_search === void 0 ? void 0 : _toolResources_file_search.vector_store_ids) !== null && _ref1 !== void 0 ? _ref1 : [];
|
|
89202
|
-
return _object_spread({
|
|
89203
|
-
type: "file_search"
|
|
89204
|
-
}, vectorStoreIds.length > 0 ? {
|
|
89205
|
-
vector_store_ids: vectorStoreIds
|
|
89206
|
-
} : {});
|
|
89207
|
-
}
|
|
89184
|
+
var config = (_serialized_computer_use_preview = serialized.computer_use_preview) !== null && _serialized_computer_use_preview !== void 0 ? _serialized_computer_use_preview : {};
|
|
89208
89185
|
return _object_spread({
|
|
89209
|
-
type:
|
|
89210
|
-
},
|
|
89211
|
-
}
|
|
89212
|
-
|
|
89186
|
+
type: "computer_use_preview"
|
|
89187
|
+
}, config);
|
|
89188
|
+
}
|
|
89189
|
+
if (toolType === "code_interpreter") {
|
|
89190
|
+
var _ref;
|
|
89191
|
+
var _tool_code_interpreter;
|
|
89192
|
+
return {
|
|
89193
|
+
type: "code_interpreter",
|
|
89194
|
+
container: (_ref = (_tool_code_interpreter = tool.code_interpreter) === null || _tool_code_interpreter === void 0 ? void 0 : _tool_code_interpreter.container) !== null && _ref !== void 0 ? _ref : {
|
|
89195
|
+
type: "auto"
|
|
89196
|
+
}
|
|
89197
|
+
};
|
|
89198
|
+
}
|
|
89199
|
+
if (toolType === "file_search") {
|
|
89200
|
+
var _ref1;
|
|
89201
|
+
var _toolResources_file_search;
|
|
89202
|
+
var vectorStoreIds = (_ref1 = toolResources === null || toolResources === void 0 ? void 0 : (_toolResources_file_search = toolResources.file_search) === null || _toolResources_file_search === void 0 ? void 0 : _toolResources_file_search.vector_store_ids) !== null && _ref1 !== void 0 ? _ref1 : [];
|
|
89203
|
+
if (vectorStoreIds.length === 0) return null;
|
|
89204
|
+
return {
|
|
89205
|
+
type: "file_search",
|
|
89206
|
+
vector_store_ids: vectorStoreIds
|
|
89207
|
+
};
|
|
89208
|
+
}
|
|
89209
|
+
return _object_spread({
|
|
89210
|
+
type: tool.type
|
|
89211
|
+
}, tool[tool.type] || {});
|
|
89212
|
+
}).filter(Boolean);
|
|
89213
|
+
return mapped.length > 0 ? {
|
|
89214
|
+
tools: mapped
|
|
89215
|
+
} : {};
|
|
89213
89216
|
};
|
|
89214
89217
|
var truncation = function(param) {
|
|
89215
89218
|
var truncation_strategy = param.truncation_strategy;
|