Skip to content

Testing

Run a code tool (by id or name) in isolation with the given args and return its result, logs, and any error — without wiring it into an agent. Runs the tool’s current saved source in a Docker sandbox. args are passed straight to the tool as keyword arguments.

File arguments: For parameters typed as bytes in the tool source, pass a file_id UUID string as the value. The platform downloads the file content from S3 and delivers raw bytes to the tool function. Example: {"data": "<file_id>"} for a tool with def run(data: bytes). You may also pass an upload_id from create_upload_url (after PUTting the bytes) to test against a freshly-uploaded local file without first sending it through a chat.

args are checked against the tool’s parameters_schema before anything runs — a missing required argument or an unknown one fails immediately instead of starting a container.

ParameterTypeRequiredDescription
argsobjectno
orgstringno
toolstringyes

Test a prompt template (by id or slug). Behavior depends on whether the tested revision has an extraction schema (fields, see create_prompt):

  • Plain prompt (no fields): renders text with variables and runs it against the configured LLM, returning the rendered text and the model’s free-text output.
  • Schema-bearing prompt (fields set): runs structured extraction and returns typed data instead. Provide the material to extract from via input_text (raw text) or input_url (fetched and used as the input) — one of the two is required. variables still interpolates any {{name}} placeholders in the prompt’s instructions.

Every variable the tested revision declares must be supplied in variables — a missing one fails before the model is called, rather than sending the raw {{placeholder}} to it.

Pass revision_version to test a specific (e.g. unpublished) revision; omit it to use the latest.

file_ids is an optional list of ids to attach to the prompt as multimodal content — text documents become text blocks, images and scanned PDFs become image blocks. Each id may be a durable file_id (a chat upload or artifact) OR an upload_id from create_upload_url (after you’ve PUT the bytes), so you can test against a freshly-uploaded local file without first sending it through a chat. Uploads are resolved only within the caller’s organization.

file_mode optionally overrides how attached files render into the LLM message: auto (default — text if extractable else image), image, text, or both. Omit to use the prompt template’s configured mode.

ParameterTypeRequiredDescription
file_idsstring[]no
file_modestringno
input_textstringno
input_urlstringno
orgstringno
promptstringyes
revision_versionintegerno
variablesobjectno