Skip to main content

record_tool_call

Function record_tool_call 

Source
async fn record_tool_call(
    conn: &mut PgConnection,
    conversation_id: Uuid,
    response_id: &str,
    call_id: &str,
    tool_name: &str,
    result: ChatbotToolCallResult,
) -> ChatbotResult<Vec<APIInputMessage>>
Expand description

Stores a finished tool call beside its output, and converts both rows back into the items the next round is sent.

The two rows go in one transaction: a call stored without its output is exactly the history the unanswered-call sweep exists to repair, and the LLM rejects the conversation until it is.