Skip to content
providerkit
GitHub

toClientMessages

function toClientMessages(messages): AgentMessage[];

Defined in: agents/src/input.ts:213

Copies of the messages without the fields a provider owns: reasoningDetails, reasoningItems and each call’s thoughtSignature. Use it before history reaches a browser. Reasoning text and tool rounds stay: DeepSeek needs the reasoning of a tool-call turn sent back. The run applies the same rule to history a caller passes in, because a browser could forge those fields.

Parameter Type
messages readonly AgentMessage[]

AgentMessage[]