mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-04-26 23:45:52 +00:00
Fixed: #1531
fix(gemini): add `deprecated` to unsupported schema keywords Add `deprecated` to the list of unsupported schema metadata fields in Gemini and update tests to verify its removal.
This commit is contained in:
@@ -59,6 +59,7 @@ func buildRequestBodyFromPayload(t *testing.T, modelName string) map[string]any
|
|||||||
"properties": {
|
"properties": {
|
||||||
"mode": {
|
"mode": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
"deprecated": true,
|
||||||
"enum": ["a", "b"],
|
"enum": ["a", "b"],
|
||||||
"enumTitles": ["A", "B"]
|
"enumTitles": ["A", "B"]
|
||||||
}
|
}
|
||||||
@@ -156,4 +157,7 @@ func assertSchemaSanitizedAndPropertyPreserved(t *testing.T, params map[string]a
|
|||||||
if _, ok := mode["enumTitles"]; ok {
|
if _, ok := mode["enumTitles"]; ok {
|
||||||
t.Fatalf("enumTitles should be removed from nested schema")
|
t.Fatalf("enumTitles should be removed from nested schema")
|
||||||
}
|
}
|
||||||
|
if _, ok := mode["deprecated"]; ok {
|
||||||
|
t.Fatalf("deprecated should be removed from nested schema")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ func removeUnsupportedKeywords(jsonStr string) string {
|
|||||||
keywords := append(unsupportedConstraints,
|
keywords := append(unsupportedConstraints,
|
||||||
"$schema", "$defs", "definitions", "const", "$ref", "$id", "additionalProperties",
|
"$schema", "$defs", "definitions", "const", "$ref", "$id", "additionalProperties",
|
||||||
"propertyNames", "patternProperties", // Gemini doesn't support these schema keywords
|
"propertyNames", "patternProperties", // Gemini doesn't support these schema keywords
|
||||||
"enumTitles", "prefill", // Claude/OpenCode schema metadata fields unsupported by Gemini
|
"enumTitles", "prefill", "deprecated", // Schema metadata fields unsupported by Gemini
|
||||||
)
|
)
|
||||||
|
|
||||||
deletePaths := make([]string, 0)
|
deletePaths := make([]string, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user