safety checks for CUA (#2188)
This commit is contained in:
@@ -234,7 +234,7 @@ function WorkflowNodeLibraryPanel({ onNodeClick, first }: Props) {
|
|||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<header className="space-y-2">
|
<header className="space-y-2">
|
||||||
<div className="flex justify-between">
|
<div className="flex justify-between">
|
||||||
<h1 className="text-lg">Block Library</h1>
|
<h1 className="text-lg">Node Library</h1>
|
||||||
{!first && (
|
{!first && (
|
||||||
<Cross2Icon
|
<Cross2Icon
|
||||||
className="size-6 cursor-pointer"
|
className="size-6 cursor-pointer"
|
||||||
|
|||||||
@@ -1324,6 +1324,18 @@ class ForgeAgent:
|
|||||||
temperature=0,
|
temperature=0,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
last_computer_call = computer_calls[-1]
|
||||||
|
computer_call_input = {
|
||||||
|
"call_id": last_call_id,
|
||||||
|
"type": "computer_call_output",
|
||||||
|
"output": {
|
||||||
|
"type": "input_image",
|
||||||
|
"image_url": f"data:image/png;base64,{screenshot_base64}",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
if last_computer_call.pending_safety_checks:
|
||||||
|
computer_call_input["acknowledge_safety_checks"] = last_computer_call.pending_safety_checks
|
||||||
|
|
||||||
current_response = await app.OPENAI_CLIENT.responses.create(
|
current_response = await app.OPENAI_CLIENT.responses.create(
|
||||||
model="computer-use-preview",
|
model="computer-use-preview",
|
||||||
previous_response_id=previous_response.id,
|
previous_response_id=previous_response.id,
|
||||||
@@ -1335,16 +1347,7 @@ class ForgeAgent:
|
|||||||
"environment": "browser",
|
"environment": "browser",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
input=[
|
input=[computer_call_input],
|
||||||
{
|
|
||||||
"call_id": last_call_id,
|
|
||||||
"type": "computer_call_output",
|
|
||||||
"output": {
|
|
||||||
"type": "input_image",
|
|
||||||
"image_url": f"data:image/png;base64,{screenshot_base64}",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
],
|
|
||||||
reasoning={
|
reasoning={
|
||||||
"generate_summary": "concise",
|
"generate_summary": "concise",
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user