feat: regex support for model-mappings

This commit is contained in:
altamash
2025-12-23 18:41:58 +05:30
parent e52b542e22
commit 5dcf7cb846
4 changed files with 149 additions and 20 deletions

View File

@@ -144,6 +144,11 @@ type AmpModelMapping struct {
// To is the target model name to route to (e.g., "claude-sonnet-4").
// The target model must have available providers in the registry.
To string `yaml:"to" json:"to"`
// Regex indicates whether the 'from' field should be interpreted as a regular
// expression for matching model names. When true, this mapping is evaluated
// after exact matches and in the order provided. Defaults to false (exact match).
Regex bool `yaml:"regex,omitempty" json:"regex,omitempty"`
}
// AmpCode groups Amp CLI integration settings including upstream routing,