How OpenTools works under the hood
call_
) is either an LLM call or a tool call. Calls happen sequentially — for example, an LLM call might result in a tool call, whose result needs to be fed into another LLM call. Every call belongs to a Generation (many-to-one).genr_
) are 1-to-1 with requests to create a chat completion. They create between 1 and 9 child Calls (LLM → Tool → LLM → … → LLM), depending on how many tool calls the model wants. If there’s no resolution by the 9th call in the sequence, we return the final LLM call as-is to prevent runaway costs.