Chat Messages
Roles
.tool messages when you append function-call results back into the conversation.
Message Structure
content: Ordered fragments of the message. The SDK supports.text,.image, and.audioparts.reasoningContent: Optional text produced inside<think>tags by eligible models.functionCalls: Attach the calls returned byMessageResponse.functionCallwhen you include tool execution results in the history.
Message Content
.image and WAV data for .audio. Helper initializers such as ChatMessageContent.fromUIImage, ChatMessageContent.fromNSImage, ChatMessageContent.fromWAVData, and ChatMessageContent.fromFloatSamples(_:sampleRate:channelCount:) simplify interop with platform-native buffers. On the wire, image parts are encoded as OpenAI-style image_url payloads and audio parts as input_audio arrays with Base64 data.