This guide uses the Dashboard. To create the same connection in code, see the SDK streaming example or the request body in the REST API reference, which the CLI sends too. Every field is listed in Streamed Replies.
Prerequisites
- A Product in the Galtea Dashboard.
- The URL of your agent, and a way to call it with
curl. - The basics of an Endpoint Connection. If you have never made one, read Direct Inferences and Evaluations from the Platform first.
Does Your Agent Stream?
Call your agent once withcurl. The -N flag prints each piece as it arrives, and -i shows the response headers:
Content-Type header of the response:
The header only helps you choose. Galtea reads the stream with the Format you set, whatever the header says. Some servers send NDJSON as
text/plain: pick NDJSON when each line is one JSON value.
If your agent’s URL starts with wss://, it answers over a WebSocket. Pick format WebSocket and see Example 3.
Most agent stacks stream when you ask them to: the OpenAI and Anthropic APIs with "stream": true, a Google ADK server at /run_sse, and a Vercel AI SDK route that returns a UI message stream. If your agent can answer both ways, a JSON reply is the simpler choice. Pick streaming when the stream is the only way your agent answers, or when you want to test the exact endpoint your users call.
How Galtea Reads a Stream
Galtea reads the whole stream and turns it into one object. Your Output Mapping then reads that object with JSONPath, the same way it reads a JSON reply. Take this invented stream. An in-house agent opens a conversation, sends its answer in two pieces, lists the passages it used, and ends:Stream
Assembled object
textis the answer: the text of the chunks that give text, joined. In Last mode it is the text of the last such chunk. When the text path of a chunk finds a list of strings, such as$.content.parts[*].text, Galtea joins them in order.byEventkeeps every chunk, grouped by its event name, in the order they came. It is a list for each event, so[0]is the first chunk of that event.finalis the last chunk whose data is a JSON object or list. Agents often put the conversation id or a summary there.jsonistextparsed, when the answer is one JSON object or list. It isnullhere, because this answer is plain text. See Structured Replies.
Example 1: A Preset
A preset fills every stream setting for a known agent stack. This example uses an agent built on the OpenAI Responses API, for example with the OpenAI Agents SDK, that forwards its stream events. The agent also adds one event of its own,retrieval.results, with the passages it found.
Stream
1
Choose the reply type and the preset
In the connection form, set Reply type to Streamed reply. In Preset, choose OpenAI Responses API. Open What this preset sets to see its settings: it names each event from the
type field and takes text only from response.output_text.delta events.On a Conversation connection, the form also sets the Output Mapping to output: $.text when it still holds the default.2
Map the answer, the retrieved context and the conversation id
Galtea builds this object from the stream:Add two keys next to The event name
Assembled object
output:Output Mapping
retrieval.results has a dot, so the path uses the bracket form. See The Conversation Id.3
Send the id back on the next turn
On the first turn there is no id yet, so send it only when it exists:
Input Template

Example 2: Custom Settings
Use Custom when no preset matches your agent. This example reads the in-house stream from How Galtea Reads a Stream.1
Set the stream settings
Set Reply type to Streamed reply and Preset to Custom. Then fill in:
Open More options:
When you switch to Custom from a preset, the form keeps that preset’s settings as a start. Clear the ones your agent does not need. This includes Error event: clear it if your agent never sends that event.
2
Map the fields
Output Mapping
3
Send the id back on the next turn
Input Template

Example 3: A WebSocket Agent
A WebSocket agent gets the question as one message and answers in several messages on the same socket. It keeps the socket open for the next question, so Galtea needs a rule that tells it when the answer is complete.1
Set the URL and the format
Enter the
wss:// URL of your agent. Set Reply type to Streamed reply, Format to WebSocket and Preset to Custom. Galtea sends the rendered Input Template as one text message, and the headers on the opening request.2
Read the messages
Each message is one chunk. A JSON message is read as JSON, and any other message as plain text. For an agent that sends
{"delta": "..."} pieces:3
Tell Galtea when the answer ends
Set one or both of these fields. They sit next to each other, outside More options:
The quiet period starts at the first message that gives text, so a slow first token is never cut, even after an acknowledgement message. Before the first text, only the idle timeout and the connection timeout apply. Pick a quiet period longer than the longest pause inside one answer, such as a tool call. A pause inside the reply that is longer than the quiet period ends the reply there with no warning, so set an end marker when your agent sends one. If your agent sends heartbeat messages during a reply, or can answer with no text, set an End marker: each message restarts the quiet period.
The Conversation Id
Most agents keep a conversation by an id: a thread id, a session id, a response id. Galtea stores the id your agent returns and sends it back on the next turn as{{ session_id }}. The form fills only output: $.text, and only on a Conversation connection, so add the session_id key yourself.
Find the chunk that carries the id in your stream, then pick where to read it:
$.byEvent['<event>'][0].<path>when one event names the id, often the first one. Example 2 reads$.byEvent['conversation.started'][0].conversation_id.$.final.<path>when the last event carries it. Example 1 reads$.final.response.id.
{% if session_id %} branch in the Input Template covers the first turn, when Galtea has no id yet.
Structured Replies
Some agents answer with one JSON object, sent as text in small pieces. Agents built on structured output do this, and so do agents that answer through a tool call. Galtea joins the pieces intotext, then parses that text once, at the end of the stream, into json. The output mapping then reads each field of the answer.
Take an agent whose joined text is this invented answer:
Joined text
json:
Output Mapping
$.delta or the argument pieces of a tool call. json is null when the text is not one JSON object or list, when the stream is cut before its End marker, when the value is nested deeper than 32 levels, and when its parse does not fit the stream size limit. A path into a null json matches nothing, like any path that finds no value.
Files in a Stream
output_files reads the assembled object too. Map it to a file in one event, as a URL or as base64, for example $.byEvent.file[0] or $.final.files. A file that comes in several text pieces is read from the joined text or from json, for example $.json.files. In text, send the file as a data: URI: a bare base64 string there is refused. Raw Response then shows the bytes once, as a short <base64, size> mark. If your agent’s JSON encoder escapes / or + in the base64, the bytes also stay visible in text.
Test the Connection
Click Test Connection at the bottom of the form. Galtea calls your agent with sample values, reads the stream as a real turn would, and shows two tabs:- Raw Response shows the assembled object.
byEventstarts closed: open it to see each event and to copy the paths you need. - Extracted Fields shows the value of each Output Mapping key. A required key that matched nothing says “Required — no value extracted. Check your JSONPath expression.”
Test Connection sends a random
session_id, so the {% if session_id %} branch of your Input Template is taken, and your agent receives an id it does not know. In a run, the first turn has no id, and the health check before a run sends no id either, until a step returns one. If your agent rejects an unknown id, test with a template that leaves the id out, then put it back.Troubleshooting
Not Supported
Galtea reads streams as SSE, NDJSON or WebSocket messages. gRPC agents are not supported today. If your agent speaks gRPC:- Put a small adapter in front of it. It takes Galtea’s HTTP request, calls your agent, and answers with one JSON body or an SSE stream. Galtea then connects to the adapter like to any agent.
- Check for a gateway you already run. gRPC services are often exposed through gRPC-Web, Connect or a JSON transcoding gateway (for example Envoy), which already speak HTTP and JSON.
- Run the conversation yourself. Call your agent from your own code and send each turn to Galtea with the SDK. See Run Dataset-Based Evaluations.
json, so put the pieces in a structured reply and map the file from json, or join them into one data: URI in the text. A bare base64 string in the text is refused. Otherwise send the whole file in one event, or a URL to it.
Learn More
Streamed Replies reference
Every stream field, the presets and their sources, and the limits.
Direct Inferences Tutorial
Attach the connection to a version and run an evaluation.
SDK: create a streaming connection
The same connection in Python.
REST API: create a streaming connection
The request body for a preset,
CUSTOM settings, a structured reply and a WebSocket agent. The CLI sends the same body.