Add Promptkit debug capture for generated reports
This commit is contained in:
@@ -44,15 +44,16 @@ const (
|
||||
)
|
||||
|
||||
type GenerateRequest struct {
|
||||
Config config.Config
|
||||
Report ReportKind
|
||||
OutputPath string
|
||||
Now time.Time
|
||||
Date time.Time
|
||||
Collector Collector
|
||||
Notifier Notifier
|
||||
Executor promptexec.Executor
|
||||
Store state.Store
|
||||
Config config.Config
|
||||
Report ReportKind
|
||||
OutputPath string
|
||||
LLMDebugDir string
|
||||
Now time.Time
|
||||
Date time.Time
|
||||
Collector Collector
|
||||
Notifier Notifier
|
||||
Executor promptexec.Executor
|
||||
Store state.Store
|
||||
}
|
||||
|
||||
type BatchRequest struct {
|
||||
@@ -279,6 +280,10 @@ func GenerateDetailed(ctx context.Context, req GenerateRequest) (*ReportResult,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
debugWriter, err := state.NewPromptDebugWriter(req.LLMDebugDir)
|
||||
if err != nil {
|
||||
return nil, promptexec.NewError(promptexec.InvalidConfiguration, "initialize prompt debug", err)
|
||||
}
|
||||
inspection, err := InspectPromptExecution(ctx, PromptInspectionRequest{
|
||||
Resolved: resolved,
|
||||
Executor: req.Executor,
|
||||
@@ -296,6 +301,7 @@ func GenerateDetailed(ctx context.Context, req GenerateRequest) (*ReportResult,
|
||||
Resolved: resolved,
|
||||
Collection: *collection,
|
||||
Inspection: inspection,
|
||||
DebugWriter: debugWriter,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user