refactor(util, executor): optimize payload handling and schema processing

- Replaced repetitive string operations with a centralized `escapeGJSONPathKey` function.
- Streamlined handling of JSON schema cleaning for Gemini and Antigravity requests.
- Improved payload management by transitioning from byte slices to strings for processing.
- Removed unnecessary cloning of byte slices in several places.
This commit is contained in:
Luis Pater
2026-02-05 19:00:30 +08:00
parent 7cf9ff0345
commit 25c6b479c7
5 changed files with 36 additions and 76 deletions

View File

@@ -667,6 +667,9 @@ func orDefault(val, def string) string {
}
func escapeGJSONPathKey(key string) string {
if strings.IndexAny(key, ".*?") == -1 {
return key
}
return gjsonPathKeyReplacer.Replace(key)
}