From b6fdfc0571508a61cec6dcc355195f64419c4ab8 Mon Sep 17 00:00:00 2001 From: ccsang Date: Sun, 15 Mar 2026 05:43:19 +0000 Subject: [PATCH 1/2] fix(core): add items field to CreateSkillPayloadTool array schema for Gemini API compatibility Fixes #6279 The Gemini API requires array types in function declarations to have an 'items' field. This fix adds to the array variant in the payload parameter's anyOf schema. - Fixes: AstrBotDevs/AstrBot#6279 --- astrbot/core/computer/tools/neo_skills.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/computer/tools/neo_skills.py b/astrbot/core/computer/tools/neo_skills.py index 492b6e45ed..e60648144d 100644 --- a/astrbot/core/computer/tools/neo_skills.py +++ b/astrbot/core/computer/tools/neo_skills.py @@ -164,7 +164,10 @@ class CreateSkillPayloadTool(NeoSkillToolBase): "type": "object", "properties": { "payload": { - "anyOf": [{"type": "object"}, {"type": "array"}], + "anyOf": [ + {"type": "object"}, + {"type": "array", "items": {"type": "object"}}, + ], "description": ( "Skill payload JSON. Typical schema: {skill_markdown, inputs, outputs, meta}. " "This only stores content and returns payload_ref; it does not create a candidate or release." From 7e6515df8e8aeb1f34d9a30bd99fa2ca4a0d080c Mon Sep 17 00:00:00 2001 From: ccsang Date: Sun, 15 Mar 2026 07:34:29 +0000 Subject: [PATCH 2/2] refactor: use empty items schema to allow any array element type Address Sourcery AI review comment: - Changed to to match runtime - Empty schema allows any type while satisfying Gemini API requirement --- astrbot/core/computer/tools/neo_skills.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astrbot/core/computer/tools/neo_skills.py b/astrbot/core/computer/tools/neo_skills.py index e60648144d..1aea5c35d9 100644 --- a/astrbot/core/computer/tools/neo_skills.py +++ b/astrbot/core/computer/tools/neo_skills.py @@ -166,7 +166,7 @@ class CreateSkillPayloadTool(NeoSkillToolBase): "payload": { "anyOf": [ {"type": "object"}, - {"type": "array", "items": {"type": "object"}}, + {"type": "array", "items": {}}, ], "description": ( "Skill payload JSON. Typical schema: {skill_markdown, inputs, outputs, meta}. "