Skip to content

Latest commit

 

History

History
168 lines (145 loc) · 6.13 KB

api.md

File metadata and controls

168 lines (145 loc) · 6.13 KB

Messages

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]

Beta

Types:

from anthropic.types import (
    AnthropicBeta,
    BetaAPIError,
    BetaAuthenticationError,
    BetaError,
    BetaErrorResponse,
    BetaInvalidRequestError,
    BetaNotFoundError,
    BetaOverloadedError,
    BetaPermissionError,
    BetaRateLimitError,
)

Messages

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:

Batches

Types:

from anthropic.types.beta.messages import (
    BetaMessageBatch,
    BetaMessageBatchCanceledResult,
    BetaMessageBatchErroredResult,
    BetaMessageBatchExpiredResult,
    BetaMessageBatchIndividualResponse,
    BetaMessageBatchRequestCounts,
    BetaMessageBatchResult,
    BetaMessageBatchSucceededResult,
)

Methods:

PromptCaching

Messages

Types:

from anthropic.types.beta.prompt_caching import (
    PromptCachingBetaCacheControlEphemeral,
    PromptCachingBetaImageBlockParam,
    PromptCachingBetaMessage,
    PromptCachingBetaMessageParam,
    PromptCachingBetaTextBlockParam,
    PromptCachingBetaTool,
    PromptCachingBetaToolResultBlockParam,
    PromptCachingBetaToolUseBlockParam,
    PromptCachingBetaUsage,
    RawPromptCachingBetaMessageStartEvent,
    RawPromptCachingBetaMessageStreamEvent,
)

Methods: