safety checks for CUA (#2188)

This commit is contained in:
Shuchang Zheng
2025-04-19 06:41:01 +08:00
committed by GitHub
parent 51f0f8354c
commit 378d20ad03
2 changed files with 14 additions and 11 deletions

View File

@@ -234,7 +234,7 @@ function WorkflowNodeLibraryPanel({ onNodeClick, first }: Props) {
<div className="space-y-4">
<header className="space-y-2">
<div className="flex justify-between">
<h1 className="text-lg">Block Library</h1>
<h1 className="text-lg">Node Library</h1>
{!first && (
<Cross2Icon
className="size-6 cursor-pointer"

View File

@@ -1324,6 +1324,18 @@ class ForgeAgent:
temperature=0,
)
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(
model="computer-use-preview",
previous_response_id=previous_response.id,
@@ -1335,16 +1347,7 @@ class ForgeAgent:
"environment": "browser",
}
],
input=[
{
"call_id": last_call_id,
"type": "computer_call_output",
"output": {
"type": "input_image",
"image_url": f"data:image/png;base64,{screenshot_base64}",
},
}
],
input=[computer_call_input],
reasoning={
"generate_summary": "concise",
},