Add reusable PromptKit request flags

This commit is contained in:
2026-11-07 04:16:09 +00:00
parent 6378ceb3c5
commit c3d5f551c3
17 changed files with 450 additions and 239 deletions

View File

@@ -37,9 +37,9 @@ func TestSmokeTestCommandRetainsSingletonValuesAndResetsInvocations(t *testing.T
first := app.Execute(context.Background(), []string{
"promptkit", "test", "authentication", "--config=old.yml", "--config=final.yml",
"--overlay=old-overlay.yml", "--overlay=final-overlay.yml", "--campaign=old", "--campaign=final",
"--backend=old-backend", "--backend=final-backend", "--prompt=old-prompt", "--prompt=final-prompt",
"--profile=old-profile", "--profile=final-profile", "--model=old-model", "--model=final-model",
"--temperature=0", "--transient-retries=0",
"--llm-backend=old-backend", "--llm-backend=final-backend", "--llm-prompt=old-prompt", "--llm-prompt=final-prompt",
"--llm-profile=old-profile", "--llm-profile=final-profile", "--llm-model=old-model", "--llm-model=final-model",
"--llm-temperature=0", "--llm-transient-retries=0",
}, commandkit.Streams{Out: io.Discard, Err: io.Discard})
if first.Kind != commandkit.OutcomeSuccess || len(requests) != 1 {
t.Fatalf("first smoke invocation = %#v, requests=%#v", first, requests)
@@ -73,11 +73,11 @@ func TestSmokeTestCommandUsageAndInputFailuresStopProviderWork(t *testing.T) {
}{
{name: "missing kind", args: []string{"promptkit", "test"}},
{name: "extra operand", args: []string{"promptkit", "test", "authentication", "extra"}},
{name: "malformed temperature", args: []string{"promptkit", "test", "authentication", "--temperature=warm"}},
{name: "malformed token count", args: []string{"promptkit", "test", "authentication", "--max-tokens=many"}},
{name: "malformed top-p", args: []string{"promptkit", "test", "authentication", "--top-p=high"}},
{name: "malformed timeout", args: []string{"promptkit", "test", "authentication", "--timeout-seconds=soon"}},
{name: "malformed retries", args: []string{"promptkit", "test", "authentication", "--transient-retries=several"}},
{name: "malformed temperature", args: []string{"promptkit", "test", "authentication", "--llm-temperature=warm"}},
{name: "malformed token count", args: []string{"promptkit", "test", "authentication", "--llm-max-tokens=many"}},
{name: "malformed top-p", args: []string{"promptkit", "test", "authentication", "--llm-top-p=high"}},
{name: "malformed timeout", args: []string{"promptkit", "test", "authentication", "--llm-timeout-seconds=soon"}},
{name: "malformed retries", args: []string{"promptkit", "test", "authentication", "--llm-transient-retries=several"}},
{name: "unsupported format", args: []string{"promptkit", "test", "authentication", "--format=invalid"}},
{name: "unknown flag", args: []string{"promptkit", "test", "authentication", "--unknown=value"}},
} {