oira666_pi-browser-agent 0.0.7 → 0.0.8
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/package.json
CHANGED
|
@@ -12,7 +12,7 @@ import { truncateAndSpill } from '../../util/truncate.ts';
|
|
|
12
12
|
|
|
13
13
|
export type ToolResultContentBlock =
|
|
14
14
|
| { type: 'text'; text: string }
|
|
15
|
-
| { type: 'image'; source: {
|
|
15
|
+
| { type: 'image'; source: { base64: { media_type: string; data: string } } };
|
|
16
16
|
|
|
17
17
|
export interface ToolResult {
|
|
18
18
|
content: ToolResultContentBlock[];
|
|
@@ -54,9 +54,10 @@ export function imageResult(text: string, image: { mime: string; dataBase64: str
|
|
|
54
54
|
{
|
|
55
55
|
type: 'image',
|
|
56
56
|
source: {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
base64: {
|
|
58
|
+
media_type: image.mime,
|
|
59
|
+
data: image.dataBase64,
|
|
60
|
+
},
|
|
60
61
|
},
|
|
61
62
|
},
|
|
62
63
|
],
|
|
@@ -87,8 +87,8 @@ test('browser_get_screenshot returns screenshots as image content and never expo
|
|
|
87
87
|
assert.equal(result.details.imageAttached, true);
|
|
88
88
|
assert.equal(result.details.spilledToFile, true);
|
|
89
89
|
assert.equal((result.content?.[1] as any)?.type, 'image');
|
|
90
|
-
assert.equal((result.content?.[1] as any)?.source?.media_type, 'image/jpeg');
|
|
91
|
-
assert.equal((result.content?.[1] as any)?.source?.data, largeBase64);
|
|
90
|
+
assert.equal((result.content?.[1] as any)?.source?.base64?.media_type, 'image/jpeg');
|
|
91
|
+
assert.equal((result.content?.[1] as any)?.source?.base64?.data, largeBase64);
|
|
92
92
|
assert.equal((result.details.result as any).data_base64, undefined);
|
|
93
93
|
assert.equal((result.details.response as any).data.data_base64, undefined);
|
|
94
94
|
|