From 6522147183b1c1d816824e3d330b4e0a2da4a0f5 Mon Sep 17 00:00:00 2001 From: CaIon <1808837298@qq.com> Date: Fri, 18 Apr 2025 21:38:12 +0800 Subject: [PATCH] refactor: remove unsupported root-level fields from cleanFunctionParameters --- relay/channel/gemini/relay-gemini.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/relay/channel/gemini/relay-gemini.go b/relay/channel/gemini/relay-gemini.go index e358d741..e923c0b2 100644 --- a/relay/channel/gemini/relay-gemini.go +++ b/relay/channel/gemini/relay-gemini.go @@ -300,6 +300,12 @@ func cleanFunctionParameters(params interface{}) interface{} { cleanedMap[k] = v } + // Remove unsupported root-level fields + delete(cleanedMap, "$schema") + delete(cleanedMap, "additionalProperties") + delete(cleanedMap, "default") + delete(cleanedMap, "exclusiveMaximum") + // Clean properties if props, ok := cleanedMap["properties"].(map[string]interface{}); ok && props != nil { cleanedProps := make(map[string]interface{}) @@ -319,7 +325,8 @@ func cleanFunctionParameters(params interface{}) interface{} { // Remove unsupported fields delete(cleanedPropMap, "default") delete(cleanedPropMap, "exclusiveMaximum") - delete(cleanedPropMap, "exclusiveMinimum") + delete(cleanedPropMap, "$schema") + delete(cleanedPropMap, "additionalProperties") // Check and clean 'format' for string types if propType, typeExists := cleanedPropMap["type"].(string); typeExists && propType == "string" {