70fb5b00f3
The generation() method was re-extracting tools from the raw request body, bypassing the filtering that render_chat() applies when tool_choice is a function object (forced function call). This caused parse_tool_calls() to receive the unfiltered tool list, producing incorrect or missing tool_calls in the response. - Add tools and tool_choice parameters to generation() signature - Pass them from chat_completion() after render_chat() processing - Add early structural validation of tools in generation_options() for clear HTTP 400 errors on malformed input