Expand description
The transcript a provider receives: messages in which system messages hold the prompt and tool declarations.
The first message, when it is a system message, is the initial prompt. Later system messages patch sections and add or remove tools. Providers that cannot take system messages mid-conversation get them collapsed into the first one.
Functions§
- current_
system_ message - All system messages folded into one: their text joined, sections merged (a
removed then re-added section moves to the end), and the current tools.
Nonewhen the transcript has no system message and no tools. - current_
tools - Tools active at the end of the transcript, in declaration order.
- declarations_
equal - Whether two declarations serialize identically.
- declared_
tools - Every tool ever declared, with its latest declaration.
- estimate_
context_ tokens - Tokens the transcript occupies: the last successful assistant usage plus estimates for the messages after it, or estimates throughout.
- estimate_
message_ tokens - Rough token count of one message: characters / 4, images at 4800 characters.
- has_
non_ additive_ tool_ changes - Whether any system message removes a tool or declares a name a second time.
- has_
tool_ redefinitions - Whether a tool name is declared twice with different declarations.
- initial_
system_ message - The leading system message, if the transcript starts with one.
- resolve_
transcript - The transcript as a provider sees it: unchanged when it accepts mid-conversation system messages, otherwise with every system message collapsed into the first.
- resolve_
transcript_ tools - Tools for the top-level request field, and whether later system messages keep their own additions in place. Anchoring needs API support and a transcript that only ever adds tools. Otherwise the request lists the current tools.
- tool_
state_ changes - Declarations to add and names to remove to get from
previoustocurrent. A changed declaration is both removed and added. - transform_
messages - Rewrites a transcript for
model:
Type Aliases§
- Normalize
Tool Call Id - Maps a tool-call id from another model to one the target API accepts, given the assistant message that made the call.