Versions in this module Expand all Collapse all v0 v0.7.0 Aug 29, 2026 v0.6.1 Aug 24, 2026 v0.6.0 Aug 14, 2026 Changes in this version + func MarshalBlock(b Block) ([]byte, error) + func MarshalBlocks(bs []Block) ([]byte, error) + type AIMessage struct + Usage *Usage + func (m *AIMessage) UnmarshalJSON(data []byte) error + func (m AIMessage) MarshalJSON() ([]byte, error) + type AgenticMessages []Conversation + type AudioBlock struct + Data []byte + MediaType MediaType + type Block interface + func CloneBlock(block Block) Block + func CloneBlocks(blocks []Block) []Block + func UnmarshalBlock(data []byte) (Block, error) + func UnmarshalBlocks(data []byte) ([]Block, error) + type BlockDecodeError struct + Cause error + func (e *BlockDecodeError) Error() string + func (e *BlockDecodeError) Unwrap() error + type BlockEncodeError struct + Cause error + Type BlockType + func (e *BlockEncodeError) Error() string + func (e *BlockEncodeError) Unwrap() error + type BlockLimitError struct + Got int + Limit string + Max int + func (e *BlockLimitError) Error() string + type BlockType string + const TypeAudio + const TypeDocument + const TypeImage + const TypeRefusal + const TypeText + const TypeThinking + const TypeToolResult + const TypeToolUse + type Chunk interface + type Conversation interface + type DocumentBlock struct + Data []byte + MediaType MediaType + Name string + Text string + type ImageBlock struct + MediaType MediaType + Source ImageSource + type ImageChunk struct + Index int + MediaType MediaType + Source ImageSource + type ImageSource struct + Data []byte + URL string + type MediaType string + const MediaTypeAudioAAC + const MediaTypeAudioFLAC + const MediaTypeAudioMP4 + const MediaTypeAudioMPEG + const MediaTypeAudioOGG + const MediaTypeAudioWAV + const MediaTypeAudioWebM + const MediaTypeDocumentCSV + const MediaTypeDocumentDOCX + const MediaTypeDocumentHTML + const MediaTypeDocumentMarkdown + const MediaTypeDocumentPDF + const MediaTypeDocumentText + const MediaTypeDocumentXLSX + const MediaTypeImageGIF + const MediaTypeImageJPEG + const MediaTypeImagePNG + const MediaTypeImageSVG + const MediaTypeImageWebP + type Message struct + Blocks []Block + Role Role + func (m *Message) UnmarshalJSON(data []byte) error + func (m Message) MarshalJSON() ([]byte, error) + type NilBlockError struct + Type BlockType + func (e *NilBlockError) Error() string + type RefusalBlock struct + Text string + type RefusalChunk struct + Text string + type Role string + const RoleAssistant + const RoleSystem + const RoleTool + const RoleUser + type SystemMessage struct + type TextBlock struct + Text string + type TextChunk struct + Text string + type ThinkingBlock struct + ProviderState json.RawMessage + ProviderStateFormat string + Signature string + SignatureFormat string + Thinking string + func NewSignedThinkingBlock(thinking, signature, signatureFormat string, providerState json.RawMessage, ...) *ThinkingBlock + func NewThinkingBlock(thinking, signature string, providerState json.RawMessage, ...) *ThinkingBlock + func (b *ThinkingBlock) ReplayableAs(format string) bool + func (b *ThinkingBlock) SignatureReplayableAs(format string) (string, bool) + type ThinkingChunk struct + Index int + ProviderState json.RawMessage + ProviderStateFormat string + Signature string + SignatureFormat string + Thinking string + func (c *ThinkingChunk) SignatureReplayableAs(format string) (string, bool) + type TokenCount uint64 + type ToolResultBlock struct + Content []Block + IsError bool + ToolUseID string + func (t *ToolResultBlock) MarshalJSON() ([]byte, error) + func (t *ToolResultBlock) UnmarshalJSON(data []byte) error + type ToolResultMessage struct + IsError bool + ToolUseID string + func (m *ToolResultMessage) UnmarshalJSON(data []byte) error + func (m ToolResultMessage) MarshalJSON() ([]byte, error) + type ToolUseBlock struct + ID string + Input json.RawMessage + Name string + ProviderState json.RawMessage + ProviderStateFormat string + func NewToolUseBlock(id, name string, input, providerState json.RawMessage, ...) *ToolUseBlock + func (b *ToolUseBlock) ReplayableAs(format string) bool + type ToolUseChunk struct + ID string + Index int + InputJSON string + Name string + ProviderState json.RawMessage + ProviderStateFormat string + type UnknownBlockTypeError struct + Type BlockType + func (e *UnknownBlockTypeError) Error() string + type Usage struct + CacheCreationTokens TokenCount + CacheReadTokens TokenCount + InputTokens TokenCount + OutputTokens TokenCount + ReasoningTokens TokenCount + func (u Usage) Add(other Usage) (Usage, error) + func (u Usage) ContextTokens() (TokenCount, error) + func (u Usage) ReasoningWithinOutput() bool + func (u Usage) TotalTokens() (TokenCount, error) + func (u Usage) Validate() error + type UsageField string + const UsageFieldCacheCreationTokens + const UsageFieldCacheReadTokens + const UsageFieldContextTokens + const UsageFieldInputTokens + const UsageFieldOutputTokens + const UsageFieldReasoningTokens + const UsageFieldTotalTokens + type UsageOverflowError struct + Field UsageField + Left TokenCount + Right TokenCount + func (e *UsageOverflowError) Error() string + type UsageValidationError struct + Field UsageField + Reason UsageValidationReason + func (e *UsageValidationError) Error() string + type UsageValidationReason string + const UsageValidationReasonReasoningExceedsOutput + type UserMessage struct v0.5.1 Aug 11, 2026 v0.5.0 Aug 2, 2026 v0.4.0 Jul 31, 2026 v0.3.0 Jul 23, 2026 v0.2.0 Jul 13, 2026 v0.1.0 Jul 4, 2026