The parameters for the Computer Use Agent.
Optional
authStateId?: stringThe ID of the authentication state. If defined, it will be used to authenticate with Scrapybara. Only applies if 'environment' is set to 'web'.
Optional
environment?: "web" | "ubuntu" | "windows"The environment to use.
Optional
nodeAfterAction?: (state: any, config: LangGraphRunnableConfig<any>) => Promise<any>A custom node to run after the computer action.
Optional
nodeBeforeAction?: (state: any, config: LangGraphRunnableConfig<any>) => Promise<any>A custom node to run before the computer action.
Optional
prompt?: string | SystemMessage<MessageStructure>The prompt to use for the model. This will be used as the system prompt for the model.
Optional
recursionLimit?: numberThe maximum number of recursive calls the agent can make.
Optional
scrapybaraApiKey?: stringThe API key to use for Scrapybara. This can be provided in the configuration, or set as an environment variable (SCRAPYBARA_API_KEY).
Optional
stateModifier?: StateModifierOptional state modifier for customizing the agent's state.
Optional
timeoutHours?: numberThe number of hours to keep the virtual machine running before it times out. Must be between 0.01 and 24.
Optional
uploadScreenshot?: (screenshot: string) => Promise<string>A custom function to handle uploading screenshots to an external store, instead of saving them as base64 in state. Must accept a base64 string and return a URL.
Optional
zdrEnabled?: booleanWhether or not Zero Data Retention is enabled in the user's OpenAI account. If true, the agent will not pass the 'previous_response_id' to the model, and will always pass it the full message history for each request. If false, the agent will pass the 'previous_response_id' to the model, and only the latest message in the history will be passed.
The configured graph.
Creates and configures a Computer Use Agent.