Testing
test_code_tool
Section titled “test_code_tool”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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| args | object | no | |
| org | string | no | |
| tool | string | yes |
test_prompt
Section titled “test_prompt”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): renderstextwithvariablesand runs it against the configured LLM, returning the rendered text and the model’s free-text output. - Schema-bearing prompt (
fieldsset): runs structured extraction and returns typed data instead. Provide the material to extract from viainput_text(raw text) orinput_url(fetched and used as the input) — one of the two is required.variablesstill 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.
| Parameter | Type | Required | Description |
|---|---|---|---|
| file_ids | string[] | no | |
| file_mode | string | no | |
| input_text | string | no | |
| input_url | string | no | |
| org | string | no | |
| prompt | string | yes | |
| revision_version | integer | no | |
| variables | object | no |