Skip to main content

Module output_limits

Module output_limits 

Source
Expand description

Bounds on how much a tool call may hand back, so that no tool can produce an output the conversation cannot store.

chatbot_conversation_message_tool_outputs.output is VARCHAR(131072), and record_tool_call writes the call and its output in one transaction: an oversized output does not degrade the answer, it rolls the call back and ends the turn. truncate_tool_output is the backstop that makes that unreachable; CappedList is what tools use so the backstop rarely has to fire.

Structsยง

CappedList ๐Ÿ”’
A list a tool caps before serializing it, so one long list cannot crowd out the fields beside it and so the model is never handed a partial list that looks complete.
ListTruncation ๐Ÿ”’
How much of a list was left out of a tool output.

Constantsยง

MAX_TOOL_OUTPUT_BYTES ๐Ÿ”’
The most a single tool output may carry, wrapper and instructions included.
TRUNCATION_INSTRUCTION ๐Ÿ”’
What a truncated tool output leaves out, phrased for the model rather than for a log.

Functionsยง

truncate_tool_output ๐Ÿ”’
Cuts output down to what a tool output row can hold, returning the text to send and, when it had to cut, the instruction telling the model what it is looking at.