Adopt PromptKit profile inheritance
This commit is contained in:
@@ -1,6 +1,2 @@
|
||||
id: weather-balanced
|
||||
backend: openrouter
|
||||
model: "~google/gemini-flash-latest"
|
||||
reasoning_effort: high
|
||||
timeout_seconds: 240
|
||||
service_tier: flex
|
||||
base_profile: gemini-flash-latest
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
id: weather-deep
|
||||
backend: openrouter
|
||||
model: "~anthropic/claude-sonnet-latest"
|
||||
reasoning_effort: high
|
||||
timeout_seconds: 240
|
||||
service_tier: flex
|
||||
base_profile: claude-sonnet-latest
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
id: weather-light
|
||||
backend: openrouter
|
||||
model: deepseek/deepseek-v4-flash
|
||||
timeout_seconds: 180
|
||||
service_tier: flex
|
||||
base_profile: deepseek-4-flash
|
||||
|
||||
@@ -361,6 +361,29 @@ func TestEmbeddedProfilesAreCompleteAndInspectable(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmbeddedProfilesAreMinimalBaseAliases(t *testing.T) {
|
||||
wantBases := map[string]string{
|
||||
"weather-balanced.yml": "gemini-flash-latest",
|
||||
"weather-deep.yml": "claude-sonnet-latest",
|
||||
"weather-light.yml": "deepseek-4-flash",
|
||||
}
|
||||
for path, wantBase := range wantBases {
|
||||
t.Run(path, func(t *testing.T) {
|
||||
data, err := fs.ReadFile(promptassets.ProfileFS(), path)
|
||||
if err != nil {
|
||||
t.Fatalf("read profile: %v", err)
|
||||
}
|
||||
var definition map[string]string
|
||||
if err := yaml.Unmarshal(data, &definition); err != nil {
|
||||
t.Fatalf("unmarshal profile: %v", err)
|
||||
}
|
||||
if definition["id"] != strings.TrimSuffix(path, ".yml") || definition["base_profile"] != wantBase || len(definition) != 2 {
|
||||
t.Fatalf("profile definition = %#v, want only its id and base profile %q", definition, wantBase)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestEmbeddedProfilesExcludeUnsafeOrIncidentalSettings(t *testing.T) {
|
||||
forbidden := []string{"endpoint:", "api_key", "credential", "temperature:", "top_p:", "max_tokens:"}
|
||||
if err := fs.WalkDir(promptassets.ProfileFS(), ".", func(path string, entry fs.DirEntry, err error) error {
|
||||
|
||||
Reference in New Issue
Block a user