async fn plan_tool_call(
conn: &mut PgConnection,
user_context: &ChatbotTurnContext,
tool_name: &str,
arguments: &str,
) -> ChatbotResult<PlannedToolCall>Expand description
Decides who answers a call the model made, before anything about it is stored.
A client tool’s authorization and arguments are both checked here, not when an answer arrives:
nothing can answer a call the tool would reject or the caller may not make, so it has to fail
while the turn can still hand the LLM a failure output. The server tools are checked the same
way inside call_chatbot_tool. Errors on a rejection the turn cannot survive — see
recover_or_terminate.