Data Upload
upload
Upload traced events and evaluation data
The upload
function sends traced events and optional evaluation data to Synth’s backend for analysis. It works in conjunction with the logging mode set via environment variables.
Logging Modes
Deferred Mode
Set as an environment variable:
This mode stores traces in memory until explicitly uploaded:
- Traces are held in memory until
upload()
is called - Supports batching multiple agent runs
- Required for uploading questions and reward signals
- Ideal for evaluation runs with scoring data
Instant Mode
Set as an environment variable:
This mode provides immediate trace uploads:
- Traces are sent as soon as each decorated method completes
- No need to call
upload()
- Lower memory usage
- Faster for single runs
- Cannot include questions or reward signals
- Default mode if not specified
Usage
Parameters
dataset
(Dataset, required): Contains questions and reward signals- Can be initialized with empty lists:
Dataset(questions=[], reward_signals=[])
- Can be initialized with empty lists:
verbose
(bool, optional): Enable detailed logging
Common Usage Patterns
Most customers use:
- Instant mode in production for real-time tracking
- Deferred mode for evaluation runs where they have:
- Specific test questions
- Automated scoring systems
- Multiple agent runs to batch
Note: All Synth products support data uploaded without questions or reward signals. These are optional enrichments that can improve agent optimization results.