@codeproxy/core 0.1.13 → 0.1.14
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/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
type ResponsesInputItem = string | ResponsesMessageItem | ResponsesReasoningItem | ResponsesFunctionCallItem | ResponsesFunctionCallOutputItem | ResponsesLocalShellCallItem | ResponsesCommandExecutionItem | ResponsesCommandExecutionOutputItem | ResponsesCustomToolCallItem | ResponsesCustomToolCallOutputItem | ResponsesFileChangeItem | ResponsesFileChangeOutputItem | ResponsesWebSearchCallItem | Record<string, unknown>;
|
|
7
7
|
interface ResponsesContentPart {
|
|
8
|
-
type: 'input_text' | 'text' | 'output_text' | 'reasoning_text' | 'input_image' | 'image' | 'image_url' | 'input_file' | 'file' | 'tool_result' | string;
|
|
8
|
+
type: 'input_text' | 'text' | 'output_text' | 'reasoning_text' | 'input_image' | 'image' | 'image_url' | 'input_file' | 'file' | 'input_audio' | 'tool_result' | string;
|
|
9
9
|
text?: string;
|
|
10
10
|
image_url?: string | {
|
|
11
11
|
url: string;
|
|
@@ -19,6 +19,11 @@ interface ResponsesContentPart {
|
|
|
19
19
|
file_url?: string | {
|
|
20
20
|
url: string;
|
|
21
21
|
};
|
|
22
|
+
input_audio?: {
|
|
23
|
+
data?: string;
|
|
24
|
+
format?: string;
|
|
25
|
+
};
|
|
26
|
+
format?: string;
|
|
22
27
|
tool_use_id?: string;
|
|
23
28
|
call_id?: string;
|
|
24
29
|
content?: unknown;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
type ResponsesInputItem = string | ResponsesMessageItem | ResponsesReasoningItem | ResponsesFunctionCallItem | ResponsesFunctionCallOutputItem | ResponsesLocalShellCallItem | ResponsesCommandExecutionItem | ResponsesCommandExecutionOutputItem | ResponsesCustomToolCallItem | ResponsesCustomToolCallOutputItem | ResponsesFileChangeItem | ResponsesFileChangeOutputItem | ResponsesWebSearchCallItem | Record<string, unknown>;
|
|
7
7
|
interface ResponsesContentPart {
|
|
8
|
-
type: 'input_text' | 'text' | 'output_text' | 'reasoning_text' | 'input_image' | 'image' | 'image_url' | 'input_file' | 'file' | 'tool_result' | string;
|
|
8
|
+
type: 'input_text' | 'text' | 'output_text' | 'reasoning_text' | 'input_image' | 'image' | 'image_url' | 'input_file' | 'file' | 'input_audio' | 'tool_result' | string;
|
|
9
9
|
text?: string;
|
|
10
10
|
image_url?: string | {
|
|
11
11
|
url: string;
|
|
@@ -19,6 +19,11 @@ interface ResponsesContentPart {
|
|
|
19
19
|
file_url?: string | {
|
|
20
20
|
url: string;
|
|
21
21
|
};
|
|
22
|
+
input_audio?: {
|
|
23
|
+
data?: string;
|
|
24
|
+
format?: string;
|
|
25
|
+
};
|
|
26
|
+
format?: string;
|
|
22
27
|
tool_use_id?: string;
|
|
23
28
|
call_id?: string;
|
|
24
29
|
content?: unknown;
|
package/dist/index.js
CHANGED
|
@@ -1218,15 +1218,21 @@ function processInputItem(item, messages, options) {
|
|
|
1218
1218
|
contentBlocks.push({ type: "image_url", image_url: { url } });
|
|
1219
1219
|
}
|
|
1220
1220
|
} else if (part.type === "input_file" || part.type === "file") {
|
|
1221
|
-
const
|
|
1222
|
-
const fileData = String(partFile.file_data ?? partFile.data ?? "");
|
|
1221
|
+
const fileData = String(contentPart.file_data ?? contentPart.data ?? "");
|
|
1223
1222
|
const mimeType = String(
|
|
1224
|
-
|
|
1223
|
+
contentPart.mime_type ?? contentPart.media_type ?? "application/pdf"
|
|
1225
1224
|
);
|
|
1226
1225
|
if (fileData) {
|
|
1227
1226
|
const url = fileData.startsWith("data:") ? fileData : `data:${mimeType};base64,${fileData}`;
|
|
1228
1227
|
contentBlocks.push({ type: "image_url", image_url: { url } });
|
|
1229
1228
|
}
|
|
1229
|
+
} else if (contentPart.type === "input_audio") {
|
|
1230
|
+
const ia = contentPart.input_audio;
|
|
1231
|
+
const data = String(ia?.data ?? contentPart.data ?? "");
|
|
1232
|
+
const format = String(ia?.format ?? contentPart.format ?? "mp3");
|
|
1233
|
+
if (data) {
|
|
1234
|
+
contentBlocks.push({ type: "input_audio", input_audio: { data, format } });
|
|
1235
|
+
}
|
|
1230
1236
|
}
|
|
1231
1237
|
}
|
|
1232
1238
|
}
|