Module messages

Module messages 

Source
Expand description

The Messages API implementations.

Structs§

CacheControl
Cache control for content blocks.
ContentBlockDeltaChunk
The content block delta chunk.
ContentBlockStartChunk
The content block start chunk.
ContentBlockStopChunk
The content block stop chunk.
DeltaUsage
The delta usage of the stream.
ImageContentBlock
The image content block.
ImageContentSource
The image content source.
MaxTokens
The maximum number of tokens.
Message
The message.
MessageChunkTypeError
The error type for parsing message chunk type.
MessageDeltaChunk
The message delta chunk.
MessageStartChunk
The message start chunk.
MessageStopChunk
The message stop chunk.
MessagesRequestBody
The request body for the Messages API.
MessagesRequestBuilder
A builder for the MessagesRequestBody.
MessagesResponseBody
The response body for the Messages API.
Metadata
An object describing metadata about the request.
PingChunk
The ping chunk.
StopSequence
The stop sequence.
StreamStop
The stream stop information.
Temperature
Amount of randomness injected into the response.
TextContentBlock
The text content block.
TextDeltaContentBlock
The text delta content block.
Thinking
ThinkingContentBlock
ToolDefinition
A tool definition that can be used by assistant.
ToolList
A list of tools that can be called by the assistant.
ToolResult
A result of a tool.
ToolResultContentBlock
The tool result content block.
ToolUse
A tool use request.
ToolUseContentBlock
The tool use content block.
TopK
Only sample from the top K options for each subsequent token.
TopP
Use nucleus sampling.
Usage
Billing and rate-limit usage.
UserId
An external identifier for the user who is associated with the request.

Enums§

CacheControlType
The type of cache control.
CacheTtl
Time to live for cache entries.
ClaudeModel
The model that will complete your prompt.
Content
The content of the message.
ContentBlock
The content block of the message.
ContentBlockDelta
ContentBlockStart
ContentFlatteningError
The error type for the content flattening.
ContentType
The content type of the message.
ImageMediaType
The media type of the image.
ImageMediaTypeParseError
The error type for parsing the image media type from an extension in a path.
ImageSourceType
The source type of the image.
MessageChunk
The stream chunk of messages.
MessageChunkType
The type of message chunk.
MessageObjectType
The object type for message.
MessagesError
The error type for the messages API.
Role
The role of the message.
StopReason
The reason that we stopped.
StreamError
The error type for the streaming messages.
StreamOption
Whether to incrementally stream the response using server-sent events.
SystemPrompt
System prompt.
ToolCallError
The error type for the tool call.

Traits§

AsyncTool
An asynchronous tool that can be used by assistant.
Tool
A tool that can be used by assistant.