Skip to main content

client_tool_answer_output

Function client_tool_answer_output 

Source
pub fn client_tool_answer_output(
    tool_name: &str,
    arguments: &str,
    answer: &ClientToolAnswer,
) -> ChatbotResult<String>
Expand description

Turns a client’s answer into the tool output the resumed turn reads.

arguments is the argument JSON the suspended call was recorded with, re-validated here because the answer is only meaningful against what was actually offered. Fails with ChatbotErrorType::InvalidToolAnswer when the answer does not fit the call, and with ChatbotErrorType::InvalidToolName when no client tool goes by tool_name.