refactor(runtime): rename FormProtocol to FromProtocol across payload handling logic

- Updated variable, function, and struct names from `FormProtocol` to `FromProtocol` for clarity.
- Adjusted related payload matching and normalization logic.
- Updated tests and examples to align with the new naming convention.
This commit is contained in:
Luis Pater
2026-05-17 23:39:07 +08:00
parent 2007a89594
commit 9ef99aa766
4 changed files with 20 additions and 20 deletions
+2 -2
View File
@@ -346,8 +346,8 @@ type PayloadModelRule struct {
Protocol string `yaml:"protocol" json:"protocol"`
// Headers restricts the rule to requests whose headers match all configured wildcard patterns.
Headers map[string]string `yaml:"headers" json:"headers"`
// FormProtocol restricts the rule to a specific source protocol (e.g., "gemini", "responses").
FormProtocol string `yaml:"form-protocol" json:"form-protocol"`
// FromProtocol restricts the rule to a specific source protocol (e.g., "gemini", "responses").
FromProtocol string `yaml:"from-protocol" json:"from-protocol"`
// Match requires payload JSON paths to equal the configured values.
Match []map[string]any `yaml:"match" json:"match"`
// NotMatch requires payload JSON paths to not equal the configured values.