Types:
from anthropic.types import (
ContentBlock,
ContentBlockDeltaEvent,
ContentBlockParam,
ContentBlockStartEvent,
ContentBlockStopEvent,
ImageBlockParam,
InputJSONDelta,
Message,
MessageDeltaEvent,
MessageDeltaUsage,
MessageParam,
MessageStartEvent,
MessageStopEvent,
MessageStreamEvent,
Metadata,
Model,
RawContentBlockDeltaEvent,
RawContentBlockStartEvent,
RawContentBlockStopEvent,
RawMessageDeltaEvent,
RawMessageStartEvent,
RawMessageStopEvent,
RawMessageStreamEvent,
TextBlock,
TextBlockParam,
TextDelta,
Tool,
ToolChoice,
ToolChoiceAny,
ToolChoiceAuto,
ToolChoiceTool,
ToolResultBlockParam,
ToolUseBlock,
ToolUseBlockParam,
Usage,
)
Methods:
client.messages.create(**params) -> Message
client.messages.stream(*args) -> MessageStreamManager[MessageStream] | MessageStreamManager[MessageStreamT]
Types:
from anthropic.types import (
AnthropicBeta,
BetaAPIError,
BetaAuthenticationError,
BetaError,
BetaErrorResponse,
BetaInvalidRequestError,
BetaNotFoundError,
BetaOverloadedError,
BetaPermissionError,
BetaRateLimitError,
)
Types:
from anthropic.types.beta import (
BetaBase64PDFBlock,
BetaBase64PDFSource,
BetaCacheControlEphemeral,
BetaContentBlock,
BetaContentBlockParam,
BetaImageBlockParam,
BetaInputJSONDelta,
BetaMessage,
BetaMessageDeltaUsage,
BetaMessageParam,
BetaMessageTokensCount,
BetaMetadata,
BetaRawContentBlockDeltaEvent,
BetaRawContentBlockStartEvent,
BetaRawContentBlockStopEvent,
BetaRawMessageDeltaEvent,
BetaRawMessageStartEvent,
BetaRawMessageStopEvent,
BetaRawMessageStreamEvent,
BetaTextBlock,
BetaTextBlockParam,
BetaTextDelta,
BetaTool,
BetaToolBash20241022,
BetaToolChoice,
BetaToolChoiceAny,
BetaToolChoiceAuto,
BetaToolChoiceTool,
BetaToolComputerUse20241022,
BetaToolResultBlockParam,
BetaToolTextEditor20241022,
BetaToolUnion,
BetaToolUseBlock,
BetaToolUseBlockParam,
BetaUsage,
)
Methods:
client.beta.messages.create(**params) -> BetaMessage
client.beta.messages.count_tokens(**params) -> BetaMessageTokensCount
Types:
from anthropic.types.beta.messages import (
BetaMessageBatch,
BetaMessageBatchCanceledResult,
BetaMessageBatchErroredResult,
BetaMessageBatchExpiredResult,
BetaMessageBatchIndividualResponse,
BetaMessageBatchRequestCounts,
BetaMessageBatchResult,
BetaMessageBatchSucceededResult,
)
Methods:
client.beta.messages.batches.create(**params) -> BetaMessageBatch
client.beta.messages.batches.retrieve(message_batch_id) -> BetaMessageBatch
client.beta.messages.batches.list(**params) -> SyncPage[BetaMessageBatch]
client.beta.messages.batches.cancel(message_batch_id) -> BetaMessageBatch
client.beta.messages.batches.results(message_batch_id) -> BinaryAPIResponse
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