Enable bounded output repair in the engine

This commit is contained in:
2026-08-25 09:55:19 +00:00
parent ee99dc9478
commit ae6f1a9865
7 changed files with 213 additions and 31 deletions

View File

@@ -3486,9 +3486,10 @@ extra_params:
}
type fakeLLMClient struct {
response *promptkit.GenerateResponse
err error
requests []promptkit.GenerateRequest
response *promptkit.GenerateResponse
responses []*promptkit.GenerateResponse
err error
requests []promptkit.GenerateRequest
}
type recordingArtifactReader struct {
@@ -3664,5 +3665,12 @@ func (f *fakeLLMClient) Generate(_ context.Context, req promptkit.GenerateReques
if f.err != nil {
return nil, f.err
}
if len(f.responses) > 0 {
index := len(f.requests) - 1
if index >= len(f.responses) {
return nil, fmt.Errorf("no response configured for generation %d", index+1)
}
return f.responses[index], nil
}
return f.response, nil
}