Messages
Verifiers uses a provider-agnostic message format compatible with OpenAI and Anthropic APIs.Overview
TheMessages type represents conversations as lists of message objects, where each message has a role and content.
Type Definition
Message Types
SystemMessage
UserMessage
AssistantMessage
ToolMessage
TextMessage
MessageContent
- String: Simple text
- List of parts: Multimodal content (text, images, audio)
TextContentPart
ImageUrlContentPart
InputAudioContentPart
ToolCall
Example Usage
Building Conversations
Tool Call Flow
Multimodal Messages
Extracting Content
Formatting for Display
Provider Compatibility
Verifiers messages are compatible with:- OpenAI: Direct usage with
openai.ChatCompletion.create() - Anthropic: Automatic conversion by
AnthropicClient - Custom APIs: Can be serialized/deserialized as needed