Unify optional interaction capture and warnings

This commit is contained in:
2026-11-16 03:43:29 +00:00
parent ffe0e3491e
commit cea7e44232
22 changed files with 450 additions and 367 deletions

View File

@@ -0,0 +1,24 @@
package structuredoutput
// InteractionSink captures optional diagnostics. Calls can occur concurrently.
// It returns paths for the artifacts that were written even when others fail.
// A sink can collect write errors for presentation outside the processing result.
type InteractionSink interface {
WriteInteraction(Interaction) (InteractionArtifacts, error)
}
type Interaction struct {
Name string
Context DiagnosticContext
RequestMetadata map[string]any
RequestPayload any
ResponsePayload any
ErrorPayload any
}
type InteractionArtifacts struct {
RequestMetadataPath string `json:"request_metadata_path,omitempty"`
RequestPayloadPath string `json:"request_payload_path,omitempty"`
ResponsePayloadPath string `json:"response_payload_path,omitempty"`
ErrorPayloadPath string `json:"error_payload_path,omitempty"`
}