Start before the provider call
Callgeneration() immediately before the existing provider invocation.
modelis the provider’s model identifier.provideris optional.inputis the exact JSON-compatible request sent to the provider.propertiesare facts your application already knows, such as feature, surface, campaign, or template.userId/user_id,sessionId/session_id, and source assets are optional exact join fields.
input into properties.
Complete with every output
Callcomplete() once after the provider succeeds. Include every output, even
when the user initially sees only one of them.
Each output requires:
- one stable external ID from your application;
- its media type: image, video, or audio.
Product-relevant failures
Usefail() when a terminal state is meaningful product context, such as a
safety or policy block. Generic provider failures do not have to be captured.
The SDK assigns event timestamps automatically. keeps.timestamp() is a
separate helper for marking an annotation value as a timestamp.