Integrate OpenAI with your desktop client for higher-level agent logic.
action()
Check out the guide for using this function for more details
action
function lets you control the desktop environment via an agent, managing commands, user inputs, security checks, and tool calls in a streamlined way.
input_text
(str, optional):acknowledged_safety_checks
(bool, optional):True
after the user confirms pending security checks.
ignore_safety_and_input
(bool, optional):complete_handler(data)
: Final results.needs_input_handler(messages)
: Collects user input.needs_safety_check_handler(safety_checks, pending_call)
: Approves security checks.error_handler(error_message)
: Manages errors.tools
(list, optional):function_map
(dict, optional):action
function returns one of four statuses:
action()
again with this input.
acknowledged_safety_checks=True
.
ignore_safety_and_input=True
for automatic handling of inputs and security checks. Use carefully as this bypasses user prompts and approvals.
function_map
. The agent will invoke these callables based on the tool call identifiers:
action
Commandaction
function lets your agent execute tasks in the desktop environment. It handles:
ignore_safety_and_input=True
.action
manages state and either returns a (status, data)
tuple for you to process or calls the appropriate handler if provided.
input_text
(str, optional):
None
if you’re just confirming safety checks.acknowledged_safety_checks
(bool, optional):
ignore_safety_and_input
(bool, optional):
True
, the function automatically handles safety checks and input requests, requiring no user interaction.complete_handler(data)
: Handles COMPLETE.needs_input_handler(messages)
: Handles NEEDS_INPUT.needs_safety_check_handler(checks, pending_call)
: Handles NEEDS_SECURITY_CHECK.error_handler(error_message)
: Handles ERROR.(status, data)
, where:
action
may not return a status in the usual way—it delegates behavior to those handlers.
action
covers multiple scenarios:
input_text
(e.g., a command: “Open Chrome”).acknowledged_safety_checks=True
if the agent flagged a security concern.ignore_safety_and_input=True
, which bypasses user checks.action
, you get (status, data)
back (unless you use handlers). Use status
to decide your next move:
data
contains the final response.data
holds an error message explaining what went wrong.data
(often a list of prompts) to know what it wants.action
again, supplying that text in input_text
.action
again with acknowledged_safety_checks=True
to proceed.input_text
is required unless the agent specifically requests it.ignore_safety_and_input=True
to:
if/else
checks by supplying handlers for each status. action
will call them automatically:
complete_handler(data)
: Called when the agent finishes.needs_input_handler(messages)
: Called if the agent wants more input.needs_safety_check_handler(safety_checks, pending_call)
: Called if the agent flags a safety check.error_handler(error_message)
: Called if something goes wrong.action
manages each status internally and continues until it hits COMPLETE or ERROR (unless you stop it prematurely).
input_text
) or confirm checks (acknowledged_safety_checks=True
) to continue.ignore_safety_and_input=True
is convenient but risky.For any additional questions, contact founders@passage-team.com