Unify optional interaction capture and warnings
This commit is contained in:
24
internal/framework/structuredoutput/diagnostics.go
Normal file
24
internal/framework/structuredoutput/diagnostics.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user