Carry proposal exchanges into repair replay
This commit is contained in:
@@ -24,10 +24,12 @@ type DiagnosticContext struct {
|
||||
// Request names an embedded prompt and response schema. Profile selection and
|
||||
// credentials are supplied by the role-bound runtime client.
|
||||
type Request struct {
|
||||
PromptID string `json:"prompt_id"`
|
||||
Variables map[string]string `json:"variables"`
|
||||
Schema responseschema.Key `json:"schema"`
|
||||
Context DiagnosticContext `json:"context"`
|
||||
PromptID string `json:"prompt_id"`
|
||||
Variables map[string]string `json:"variables"`
|
||||
Schema responseschema.Key `json:"schema"`
|
||||
Context DiagnosticContext `json:"context"`
|
||||
CaptureExchange bool `json:"-"`
|
||||
Replay *Replay `json:"-"`
|
||||
}
|
||||
|
||||
// PromptMetadata is the execution snapshot returned by the runtime when available.
|
||||
@@ -40,17 +42,33 @@ type PromptMetadata struct {
|
||||
Model string `json:"model,omitempty"`
|
||||
}
|
||||
|
||||
// Exchange holds a section's original prepared conversation for read-only replay.
|
||||
type Exchange struct {
|
||||
PromptID string
|
||||
Variables map[string]string
|
||||
Messages []Message
|
||||
FinalContent string
|
||||
}
|
||||
|
||||
// Replay carries a section exchange and the prior turns of one repair branch.
|
||||
type Replay struct {
|
||||
Exchange *Exchange
|
||||
Turns []Message
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Execution outcomes.ExecutionCounts `json:"execution"`
|
||||
Content json.RawMessage `json:"content,omitempty"`
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Model string `json:"model,omitempty"`
|
||||
PromptTokens int `json:"prompt_tokens,omitempty"`
|
||||
CompletionTokens int `json:"completion_tokens,omitempty"`
|
||||
TotalTokens int `json:"total_tokens,omitempty"`
|
||||
Prompt PromptMetadata `json:"prompt"`
|
||||
Prepared *PreparedSnapshot `json:"prepared,omitempty"`
|
||||
FinalContent string `json:"final_content,omitempty"`
|
||||
Exchange *Exchange `json:"-"`
|
||||
RepairInstruction []Message `json:"-"`
|
||||
Execution outcomes.ExecutionCounts `json:"execution"`
|
||||
Content json.RawMessage `json:"content,omitempty"`
|
||||
Provider string `json:"provider,omitempty"`
|
||||
Model string `json:"model,omitempty"`
|
||||
PromptTokens int `json:"prompt_tokens,omitempty"`
|
||||
CompletionTokens int `json:"completion_tokens,omitempty"`
|
||||
TotalTokens int `json:"total_tokens,omitempty"`
|
||||
Prompt PromptMetadata `json:"prompt"`
|
||||
Prepared *PreparedSnapshot `json:"prepared,omitempty"`
|
||||
FinalContent string `json:"final_content,omitempty"`
|
||||
}
|
||||
|
||||
// PreparedSnapshot is the exact rendered request snapshot. Its messages may
|
||||
@@ -68,14 +86,15 @@ type Message struct {
|
||||
// CallRecord brackets one logical operation, including preparation. Content
|
||||
// is present only when a model returned it; consumers must protect it.
|
||||
type CallRecord struct {
|
||||
CallID uint64 `json:"call_id"`
|
||||
Context DiagnosticContext `json:"context"`
|
||||
Prompt PromptMetadata `json:"prompt"`
|
||||
Started time.Time `json:"started"`
|
||||
Finished time.Time `json:"finished,omitempty"`
|
||||
Prepared *PreparedSnapshot `json:"prepared,omitempty"`
|
||||
FinalContent string `json:"final_content,omitempty"`
|
||||
Failure FailureKind `json:"failure,omitempty"`
|
||||
RequestedPromptID string `json:"requested_prompt_id,omitempty"`
|
||||
CallID uint64 `json:"call_id"`
|
||||
Context DiagnosticContext `json:"context"`
|
||||
Prompt PromptMetadata `json:"prompt"`
|
||||
Started time.Time `json:"started"`
|
||||
Finished time.Time `json:"finished,omitempty"`
|
||||
Prepared *PreparedSnapshot `json:"prepared,omitempty"`
|
||||
FinalContent string `json:"final_content,omitempty"`
|
||||
Failure FailureKind `json:"failure,omitempty"`
|
||||
}
|
||||
|
||||
type Client interface {
|
||||
|
||||
Reference in New Issue
Block a user