lua_params_to_json_schema

Function lua_params_to_json_schema 

Source
fn lua_params_to_json_schema(params: &LuaTable) -> Result<Value>
Expand description

Convert Lua parameter declarations to OpenAI function-calling JSON Schema.

Input format (Lua array of tables):

{
    { name = "title", type = "string", required = true, description = "Ticket title" },
    { name = "priority", type = "string", enum = { "low", "medium", "high" } },
}

Output format:

{
    "type": "object",
    "properties": {
        "title": { "type": "string", "description": "Ticket title" },
        "priority": { "type": "string", "enum": ["low", "medium", "high"] }
    },
    "required": ["title"]
}