Automatically construct and inject system prompts, formatting instructions, and context based on detected task type.
Not yet available.
Body Builder is a request preprocessing layer that enhances your prompts before they reach the model. Based on the detected task — coding, writing, structured extraction, multilingual chat — it injects a system prompt, formatting constraints, and output instructions tuned for that task. You send a minimal request; Body Builder fills in the scaffolding.
When Body Builder is enabled for a request, OpenDunes:
system message (or prepends to an existing one)json_schema, response length guidance, etc.)The model receives a fully constructed prompt. Your code only sends the raw user message.
Pass "body_builder": true (or a configuration object) in the request body:
With true, Body Builder detects the task automatically. OpenDunes detects this as a coding/debugging task and injects an appropriate system prompt focused on code review and corrections.
For finer control, pass a configuration object instead of true:
| Field | Type | Description |
|---|---|---|
task | string | Override auto-detection. Values: coding, writing, extraction, translation, reasoning, chat. |
language | string | Programming language hint for coding tasks (e.g., python, typescript). |
output_format | string | Request a specific output format: markdown, json, diff, plain. |
inject_system | boolean | Whether to inject the system prompt (default true). |
append_to_existing_system | boolean | If a system message already exists, append rather than replace (default false = replace). |
The constructed system prompt is visible in the response under body_builder.injected_system when debug mode is on:
This field is only present when "debug": true is included in the request.
| Task | Triggered by | Injects |
|---|---|---|
coding | Code snippets, function names, debugging keywords | Language-specific code review system prompt |
writing | Essay/article/email keywords | Clear prose, no markdown filler instructions |
extraction | "Extract", "list all", table-like data | JSON output schema + strict instruction-following |
translation | Language pairs or "translate" | Source/target language detection, register preservation |
reasoning | Math, proofs, logic questions | Step-by-step reasoning, show-your-work instruction |
chat | Default for conversational messages | Minimal system prompt, conversational tone |
Body Builder's injected tokens (system prompt) count as prompt tokens and are billed at the model's input DA rate. Injected system prompts are typically 50–200 tokens. This adds a small incremental cost per request.
Note. Body Builder is a convenience layer, not a jailbreak or safety mechanism. It injects helpful scaffolding — it does not enforce content policies beyond what the model already applies.