I’m one of the developers of the tool calling implementation for Kilocode. The Kimi models are popular, and K2-Thinking seems very strong and popular.
However, I note that the inference implementation that moonshot AI uses for K2-Thinking does not follow the tool calling specification, and is breaking function calls.
Specifically, the OpenAI API specification notes that the definitions must follow the JSON Schema document. That document defines boolean as a valid type.
However, when sending a request to the moonshot ai API endpoints that includes a tool definition with boolean, the API responds with an error that the scalar type boolean is not permitted.
Beyond that, “null” is rejected as a type, despite that also being explicitly permitted.) in the specification.
Are you aware of these bugs? If so, is there a timeline to correct it?
Thank you very much for your feedback. As soon as we received your issue, we started troubleshooting, and the problem has been resolved at present.
Please try again, and if the problem still exists, please provide us with detailed input and output feedback to help us further resolve the issue. Thank you.
Similar to OpenAI, we provided limited support for JSON Schema. Some features, such as referencing external network resources, are restricted due to engineering and interpretability considerations.
Here, we recommend using our walle project to verify our support for features.
You can install this tool using
go install github.com/moonshotai/walle/cmd/walle@latest
and then
walle -schema '{"type": "object"}' -level strict
or
walle -schema-file your_schema.json
to check if our service fully supports this definition.
Thank you for your update. However, our team was unable to reproduce the original issue with the schema you provided (the one with "type": ["string", "null"]).
To help us verify the fix is complete and prevent future regressions, could you please share a complete, minimal chat completions request that previously failed? For example, a curl command like this: