Input Template
The Input Template is a Jinja2 template string that defines how Galtea formats the request body before sending it to your endpoint.Available Placeholders
| Placeholder | Description |
|---|---|
{{ input }} | The test case input (required) |
{{ context }} | The test case context |
{{ session_id }} | The external session ID (if available) |
{{ test_case_id }} | The test case ID |
{{ test_id }} | The test ID |
{{ galtea_session_id }} | The Galtea session ID |
{{ inference_result_id }} | The inference result ID for this turn (useful for trace collection) |
| Any metadata key | Any field stored in session metadata (e.g., {{ sessionId }}, {{ tenant }}, {{ conversation_token }}) |
Conversation History
Use{% for turn in past_turns %}...{% endfor %} to loop through previous conversation turns. Each turn exposes:
{{ turn.input }}— Previous user input{{ turn.output }}— Previous assistant response
Examples
OpenAI-compatible format:When a loop is the last item in a JSON array, use
{% if not loop.last %},{% endif %} after each iteration to prevent a trailing comma. When there’s content after the loop (like in the OpenAI example above), trailing commas are valid and this pattern is not required.Output Mapping
A JSON object defining how to extract values from the API response using JSONPath expressions.Special Keys
| Key | Behavior |
|---|---|
output | Required. The AI’s response content. |
session_id | Stored as the external session identifier, accessible via custom_id. |
retrieval_context | Stored as retrieval context for RAG evaluations. |
traces | Extracts an array of trace objects and stores them linked to the inference result. Each object should contain at least a name field and can include any of the Trace properties: type, description, inputData, outputData, error, latencyMs, metadata, startTime, endTime. |
| Any other key | Stored in session metadata and available as {{ key }} in templates. |
JSONPath Syntax Reference
| Expression | Description |
|---|---|
$ | Root object |
. | Child operator |
[] | Array index or child operator |
[*] | Wildcard (all elements) |
[0] | First array element |
[-1] | Last array element |
Example
State Management
If your API returns values that need to be sent in subsequent requests (e.g.,session_id, tenant_id), Galtea can automatically manage this state:
- Extract — Use Output Mapping to pull values from the API response using JSONPath expressions
- Store — Extracted values are saved in the session and become available as template variables
- Reuse — Reference any stored value in the Input Template or URL using
{{ variable_name }}syntax
session_id and tenant_id from responses:
Retry Configuration
Configure automatic retry behavior for failed requests. When enabled, Galtea will automatically retry requests that fail with specific HTTP status codes.Whether automatic retry is enabled. Default:
falseMaximum number of retry attempts. Default:
3Initial delay in milliseconds before the first retry. Default:
1000 (1 second)Strategy for increasing delay between retry attempts:
exponential- Delay doubles with each attempt (recommended)linear- Delay increases linearlyfixed- Constant delay between attempts
exponentialMaximum delay cap in milliseconds. Default:
30000 (30 seconds)HTTP status codes that should trigger a retry. Default:
[429, 500, 502, 503, 504]Related
Endpoint Connection Overview
What endpoint connections are and how to create one.
Direct Inferences Tutorial
Run evaluations from the dashboard using your endpoint connection.