Skip to main content

tool_failure_output_for_llm

Function tool_failure_output_for_llm 

Source
fn tool_failure_output_for_llm(error: &ChatbotError) -> String
Expand description

Turn a failed tool call into a function call output the LLM can act on, so it can recover or explain the failure to the user instead of the turn dying.

Only messages written in tool code are passed through; anything else is reported generically, because other messages are built from library errors and can carry internals such as SQL or endpoint URLs.