Variable: ChatMessageSchema
constChatMessageSchema:ZodObject<{content:ZodOptional<ZodNullable<ZodUnion<readonly [ZodString,ZodObject<{text:ZodOptional<ZodString>;type:ZodOptional<ZodString>; },$catchall<ZodUnknown>>,ZodArray<ZodObject<{text:ZodOptional<ZodString>;type:ZodOptional<ZodString>; },$catchall<ZodUnknown>>>]>>>;name:ZodOptional<ZodString>;role:ZodString;tool_call_id:ZodOptional<ZodString>;tool_calls:ZodOptional<ZodArray<ZodObject<{function:ZodObject<{arguments:ZodString;name:ZodString; },$strip>;id:ZodString;type:ZodString; },$strip>>>; },$strip>
ChatMessage fields
Section titled “ChatMessage fields”A single chat message in an OpenAI Chat Completions request or response.
role: Message author. See ChatRole for the standard values; widened for provider extensions.content(optional): Message body. Null when an assistant turn only calls tools.content.type(optional): Part discriminator, such as text, input_text, or output_text.content.text(optional): Plain-text payload carried by this part when present.tool_calls(optional): Tool calls attached to an assistant turn.tool_call_id(optional): Set on a tool turn, keying it back to the call it answers.name(optional): Optional speaker or function name.