async fn answer_unanswered_tool_calls(
conn: &mut PgConnection,
conversation_id: Uuid,
output_text: &str,
needs_answering: impl Fn(&ChatbotConversationMessageToolCall) -> bool,
) -> ModelResult<Vec<ChatbotConversationMessageToolCall>>Expand description
Answers with output_text every unanswered tool call of the conversation that needs_answering
accepts, and returns the ones it left alone.
Must be called with the conversation lock held: which calls are unanswered is read here and the outputs are written against that read, and a call that ends up with two outputs is replayed as two and rejected by the provider for the rest of the conversation.