Add tri-state reasoning overrides
This commit is contained in:
@@ -281,6 +281,9 @@ func TestEngineExecutionSettingPrecedence(t *testing.T) {
|
||||
intPointer := func(value int) *int {
|
||||
return &value
|
||||
}
|
||||
stringPointer := func(value string) *string {
|
||||
return &value
|
||||
}
|
||||
|
||||
defaultsProfile := executionProfileFixture{
|
||||
id: "settings-defaults",
|
||||
@@ -388,7 +391,7 @@ func TestEngineExecutionSettingPrecedence(t *testing.T) {
|
||||
TopP: floatPointer(requestTarget.TopP),
|
||||
TimeoutSeconds: intPointer(requestTarget.TimeoutSeconds),
|
||||
ServiceTier: requestTarget.ServiceTier,
|
||||
ReasoningEffort: requestTarget.ReasoningEffort,
|
||||
ReasoningEffort: stringPointer(requestTarget.ReasoningEffort),
|
||||
APIKeyEnv: requestTarget.APIKeyEnv,
|
||||
ExtraParams: requestTarget.ExtraParams,
|
||||
},
|
||||
@@ -452,6 +455,43 @@ func TestEngineExecutionSettingPrecedence(t *testing.T) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
t.Run("blank request reasoning clears profile setting", func(t *testing.T) {
|
||||
profile := executionProfileFixture{
|
||||
id: "settings-reasoning-clear",
|
||||
endpoint: "http://profile-reasoning.test/v1",
|
||||
model: "profile-reasoning-model",
|
||||
reasoningEffort: "medium",
|
||||
}
|
||||
profileDir := t.TempDir()
|
||||
writeExecutionProfileFixture(t, profileDir, profile)
|
||||
engine, err := promptkit.NewEngine(promptkit.Config{
|
||||
PromptDir: frameworkPromptDir,
|
||||
ProfileDir: profileDir,
|
||||
SchemaDir: frameworkSchemaDir,
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("construct engine: %v", err)
|
||||
}
|
||||
|
||||
prepared, err := engine.Prepare(context.Background(), promptkit.RunRequest{
|
||||
PromptID: frameworkMarkdownSummaryPromptID,
|
||||
ProfileID: profile.id,
|
||||
Inputs: map[string]promptkit.ArtifactRef{
|
||||
"transcript": promptkit.Inline("Nia labels the archive."),
|
||||
"glossary": promptkit.Inline("archive: A catalogued collection."),
|
||||
},
|
||||
Execution: &promptkit.ExecutionTargetOverride{
|
||||
ReasoningEffort: stringPointer(" \t "),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("prepare engine: %v", err)
|
||||
}
|
||||
if prepared.EffectiveModelParams.ReasoningEffort != "" {
|
||||
t.Fatalf("expected blank request reasoning to clear profile value, got %q", prepared.EffectiveModelParams.ReasoningEffort)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestRunSucceedsWithInjectedLLMClient(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user