This "RootModel" key is non-standard and will cause any real OpenAI-compatible client to fail.
The standard OpenAI tool format sends parameters as a bare JSON Schema object:
"parameters": {
"type": "object",
"properties": { ... },
"required": [...]
}
This server requires the non-standard {"parameters": {"RootModel": {...}}} envelope because FunctionParameters in cli/serve/models.py defines RootModel as a literal field name rather than accepting the schema directly. Any client using the OpenAI SDK, LangChain, or the standard tool format will get a Pydantic validation error.
This is a pre-existing issue in models.py, but this PR introduces the first public examples that document and normalise the non-standard shape. Worth opening a tracked issue to fix FunctionParameters to accept a bare dict[str, Any] before these examples become the established pattern.
Originally posted by @planetf1 in #850 (comment)
This
"RootModel"key is non-standard and will cause any real OpenAI-compatible client to fail.The standard OpenAI tool format sends
parametersas a bare JSON Schema object:This server requires the non-standard
{"parameters": {"RootModel": {...}}}envelope becauseFunctionParametersincli/serve/models.pydefinesRootModelas a literal field name rather than accepting the schema directly. Any client using the OpenAI SDK, LangChain, or the standard tool format will get a Pydantic validation error.This is a pre-existing issue in
models.py, but this PR introduces the first public examples that document and normalise the non-standard shape. Worth opening a tracked issue to fixFunctionParametersto accept a baredict[str, Any]before these examples become the established pattern.Originally posted by @planetf1 in #850 (comment)