Skip to main content

reshape_tool_output

Function reshape_tool_output 

Source
pub fn reshape_tool_output(root: &Value, schema: bool) -> Value
Expand description

Reshape parsed tree for !tool mode.

Call mode (!tool without !schema): First top-level key = tool name, its children = params. Output: { tool: "name", params: { ... } }

Schema mode (!tool + !schema): Each top-level key = tool name, children = param type definitions. Output: { tools: [ { name: "tool1", params: { key: "type", ... } }, ... ] }