Types:
from anthropic.types import (
ContentBlock,
ContentBlockDeltaEvent,
ContentBlockStartEvent,
ContentBlockStopEvent,
ImageBlockParam,
InputJSONDelta,
Message,
MessageDeltaEvent,
MessageDeltaUsage,
MessageParam,
MessageStartEvent,
MessageStopEvent,
MessageStreamEvent,
Model,
RawContentBlockDeltaEvent,
RawContentBlockStartEvent,
RawContentBlockStopEvent,
RawMessageDeltaEvent,
RawMessageStartEvent,
RawMessageStopEvent,
RawMessageStreamEvent,
TextBlock,
TextBlockParam,
TextDelta,
Tool,
ToolResultBlockParam,
ToolUseBlock,
ToolUseBlockParam,
Usage,
)
Methods:
client.messages.create(**params) -> Message
client.messages.stream(*args) -> MessageStreamManager[MessageStream] | MessageStreamManager[MessageStreamT]
Types:
from anthropic.types.beta.prompt_caching import (
PromptCachingBetaCacheControlEphemeral,
PromptCachingBetaImageBlockParam,
PromptCachingBetaMessage,
PromptCachingBetaMessageParam,
PromptCachingBetaTextBlockParam,
PromptCachingBetaTool,
PromptCachingBetaToolResultBlockParam,
PromptCachingBetaToolUseBlockParam,
PromptCachingBetaUsage,
RawPromptCachingBetaMessageStartEvent,
RawPromptCachingBetaMessageStreamEvent,
)
Methods:
client.beta.prompt_caching.messages.create(**params) -> PromptCachingBetaMessage
client.beta.prompt_caching.messages.stream(**params) -> PromptCachingBetaMessageStreamManager