Skip to main content

answer_tool_call_and_resume_stream

Function answer_tool_call_and_resume_stream 

Source
pub async fn answer_tool_call_and_resume_stream(
    pool: PgPool,
    app_configuration: &ApplicationConfiguration,
    chatbot_configuration_id: Uuid,
    conversation_id: Uuid,
    tool_call_id: &str,
    answer: &ClientToolAnswer,
    user_context: ChatbotTurnContext,
) -> ChatbotResult<Pin<Box<dyn Stream<Item = ChatbotResult<Bytes>> + Send>>>
Expand description

Records a client’s answer to a tool call the turn suspended on, and continues that turn once nothing else is outstanding.

Of a round of parallel calls, only the request that answers the last one gets the resumed turn; the others get a stream carrying Suspended again, so a client reads every response the same way. tool_call_id must be a client-answered call of conversation_id that has no answer yet and answer must fit what that call offered, or this fails with ChatbotErrorType::InvalidToolAnswer and writes nothing.