Available on crate features
agents and codeact only.Expand description
The typed value a script returns to the host.
A CodeAct script communicates its result by returning a tagged value (the runtime’s completion value, decoded to JSON). The host classifies it into one of three outcomes:
ScriptOutput::Observation— fed back to the model for the next turn,ScriptOutput::Error— fed back to the model (an opaque message string),ScriptOutput::FinalResult— returned to the caller; ends the loop,ScriptOutput::TransferToAgent— hands control to another agent; ends the loop. Only offered to the model when transfer targets exist.
Errors are just strings. The framework is language-agnostic: it does not model exception types, tracebacks, or “kinds”. Whatever the runtime engine produces — a Python traceback, a JS stack, a shell error — is passed through verbatim, because that is what the LLM expects for that engine.
Enums§
- Script
Output - The typed value a CodeAct script must return.