feat(translator): add support for removing `strict` in Gemini request transformation

- Updated API and CLI translators to remove the `strict` path during request transformation, in addition to existing predefined JSON paths.
This commit is contained in:
Luis Pater
2025-10-10 02:59:21 +08:00
parent 829dd06b42
commit 11f090c223
2 changed files with 2 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ func ConvertOpenAIRequestToGeminiCLI(modelName string, inputRawJSON []byte, _ bo
util.Walk(root, "", "additionalProperties", &pathsToDelete) util.Walk(root, "", "additionalProperties", &pathsToDelete)
util.Walk(root, "", "$schema", &pathsToDelete) util.Walk(root, "", "$schema", &pathsToDelete)
util.Walk(root, "", "ref", &pathsToDelete) util.Walk(root, "", "ref", &pathsToDelete)
util.Walk(root, "", "strict", &pathsToDelete)
var err error var err error
for _, p := range pathsToDelete { for _, p := range pathsToDelete {

View File

@@ -31,6 +31,7 @@ func ConvertOpenAIRequestToGemini(modelName string, inputRawJSON []byte, _ bool)
util.Walk(root, "", "additionalProperties", &pathsToDelete) util.Walk(root, "", "additionalProperties", &pathsToDelete)
util.Walk(root, "", "$schema", &pathsToDelete) util.Walk(root, "", "$schema", &pathsToDelete)
util.Walk(root, "", "ref", &pathsToDelete) util.Walk(root, "", "ref", &pathsToDelete)
util.Walk(root, "", "strict", &pathsToDelete)
var err error var err error
for _, p := range pathsToDelete { for _, p := range pathsToDelete {