orgo 0.0.15__py3-none-any.whl → 0.0.17__py3-none-any.whl
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.
orgo/prompt.py
CHANGED
|
@@ -297,8 +297,9 @@ class AnthropicProvider:
|
|
|
297
297
|
for img_block in images_to_remove:
|
|
298
298
|
content_item = img_block["content_item"]
|
|
299
299
|
if "source" in content_item and "data" in content_item["source"]:
|
|
300
|
-
# Replace
|
|
301
|
-
content_item["source"]["data"] = "
|
|
300
|
+
# Replace with a minimal valid base64 image (1x1 transparent PNG)
|
|
301
|
+
content_item["source"]["data"] = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
|
|
302
|
+
content_item["source"]["media_type"] = "image/png"
|
|
302
303
|
|
|
303
304
|
def _execute_tool(self,
|
|
304
305
|
computer_id: str,
|
|
@@ -323,12 +324,28 @@ class AnthropicProvider:
|
|
|
323
324
|
response = api_client.get_screenshot(computer_id)
|
|
324
325
|
if callback:
|
|
325
326
|
callback("tool_result", {"type": "image", "action": "screenshot"})
|
|
327
|
+
|
|
328
|
+
# The API now returns a URL instead of base64 data
|
|
329
|
+
# We need to fetch the image from the URL and convert it to base64
|
|
330
|
+
image_url = response.get("image", "")
|
|
331
|
+
|
|
332
|
+
if not image_url:
|
|
333
|
+
raise ValueError("No image URL received from API")
|
|
334
|
+
|
|
335
|
+
# Fetch the image from the URL
|
|
336
|
+
import requests
|
|
337
|
+
img_response = requests.get(image_url)
|
|
338
|
+
img_response.raise_for_status()
|
|
339
|
+
|
|
340
|
+
# Convert to base64
|
|
341
|
+
image_base64 = base64.b64encode(img_response.content).decode('utf-8')
|
|
342
|
+
|
|
326
343
|
return {
|
|
327
344
|
"type": "image",
|
|
328
345
|
"source": {
|
|
329
346
|
"type": "base64",
|
|
330
347
|
"media_type": "image/jpeg",
|
|
331
|
-
"data":
|
|
348
|
+
"data": image_base64
|
|
332
349
|
}
|
|
333
350
|
}
|
|
334
351
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
orgo/__init__.py,sha256=TlOzDJqRKotAam631MdZcz8ypAqyWrLo-Px8HWLkrD0,131
|
|
2
2
|
orgo/computer.py,sha256=Kk3SXn1dPuDlJWJfyoxRKhjCcw21OFBg7Bn-iOZ8vK4,9013
|
|
3
3
|
orgo/project.py,sha256=0rcii4AKLWP4GSbUzfnP4G7TMgmzjm6bj2n-22NIjmk,1779
|
|
4
|
-
orgo/prompt.py,sha256=
|
|
4
|
+
orgo/prompt.py,sha256=ynblwXPTDp_aF1MbGBsY0PIEr9naklDaKFcfSE_EZ6E,19781
|
|
5
5
|
orgo/api/__init__.py,sha256=9Tzb_OPJ5DH7Cg7OrHzpZZUT4ip05alpa9RLDYmnId8,113
|
|
6
6
|
orgo/api/client.py,sha256=PrO_xPU6njxvw9L6ukfHc2el0dswsSamEnOD5ts__Tc,4553
|
|
7
7
|
orgo/utils/__init__.py,sha256=W4G_nwGBf_7jy0w_mfcrkllurYHSRU4B5cMTVYH_uCc,123
|
|
8
8
|
orgo/utils/auth.py,sha256=tPLBJY-6gdBQWLUjUbwIwxHphC3KoRT_XgP3Iykw3Mw,509
|
|
9
|
-
orgo-0.0.
|
|
10
|
-
orgo-0.0.
|
|
11
|
-
orgo-0.0.
|
|
12
|
-
orgo-0.0.
|
|
9
|
+
orgo-0.0.17.dist-info/METADATA,sha256=GVJ3Aq0yo57VMNgLXHoX6jBsXGeRc5z56cjJfYJqNHk,822
|
|
10
|
+
orgo-0.0.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
11
|
+
orgo-0.0.17.dist-info/top_level.txt,sha256=q0rYtFji8GbYuhFW8A5Ab9e0j27761IKPhnL0E9xow4,5
|
|
12
|
+
orgo-0.0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|