Overview
Blocks write their results to the DataBus using theoutput
field. SemanticTest supports three different output formats to give you flexibility in how data is stored.
1. String Format (Simple)
Store the entire block output in a single named slot:- Block’s entire output object is stored in the
response
slot - Access it later with
${response.status}
,${response.body}
, etc.
- Most common format
- Simple and clear
- Keep all related data together
2. Object Format (Mapping)
Map specific output fields to different slots:- Block’s
parsed
field goes touserData
slot - Block’s
error
field goes toparseError
slot
- Split block output into separate slots
- Different parts need different names
- Avoid deeply nested data access
3. Default Format (No Output Field)
If you don’t specifyoutput
, the block ID is used:
- Output is stored in a slot named after the block ID
- Access it with
${fetchUser.status}
,${fetchUser.body}
, etc.
- Quick prototyping
- Block ID is already descriptive
- Less typing
Comparison
- String Format
- Object Format
- Default Format
Full Pipeline Example
Best Practices
Use Descriptive Slot Names
Use Descriptive Slot Names
Use Object Format to Simplify Access
Use Object Format to Simplify Access
Match Block ID to Purpose
Match Block ID to Purpose
Separate Concerns with Object Format
Separate Concerns with Object Format
Common Patterns
HTTP Request and Parse
Stream Parsing with Split Output
Validation Results
Output Field Reference
Different blocks produce different output fields. Check each block’s documentation:Block | Common Output Fields |
---|---|
HttpRequest | status , body , headers |
JsonParser | parsed , error |
StreamParser | text , toolCalls , chunks , metadata |
ValidateContent | passed , failures , score , checks |
ValidateTools | passed , failures , score , actualTools , expectedTools |
LLMJudge | score , reasoning , shouldContinue , nextPrompt , details |
Loop | _loopTo , _maxLoops , _terminate |
MockData | Whatever you configure |