Home / File/ message_create_params.py — anthropic-sdk-python Source File

message_create_params.py — anthropic-sdk-python Source File

Architecture documentation for message_create_params.py, a python file in the anthropic-sdk-python codebase. 21 imports, 1 dependents.

File python AnthropicClient 21 imports 1 dependents 3 classes

Entity Profile

Dependency Diagram

graph LR
  323219cc_84cd_94e9_ae78_777a62f2a45c["message_create_params.py"]
  c200b525_3039_1d0b_d858_f0f2859bd98e["_types"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> c200b525_3039_1d0b_d858_f0f2859bd98e
  0b785e51_9b26_ae4b_cf32_6b73997c2811["model_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 0b785e51_9b26_ae4b_cf32_6b73997c2811
  ee233da2_be45_4f72_f2d1_e5c3132da735["message_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> ee233da2_be45_4f72_f2d1_e5c3132da735
  5b37714c_c7af_1519_a0b1_0167fccc0751["MessageParam"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 5b37714c_c7af_1519_a0b1_0167fccc0751
  95691951_9186_c77d_0461_2a4a1f93938c["metadata_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 95691951_9186_c77d_0461_2a4a1f93938c
  a81c5c45_31d0_b1b7_cd7b_91288590f985["MetadataParam"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> a81c5c45_31d0_b1b7_cd7b_91288590f985
  ad175324_e5f5_a13e_bfab_419a3f7bb8cf["text_block_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> ad175324_e5f5_a13e_bfab_419a3f7bb8cf
  2bf44e5b_0987_db82_09a9_ca08ad9d6f15["TextBlockParam"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 2bf44e5b_0987_db82_09a9_ca08ad9d6f15
  454d11cb_0b86_9e73_f884_ace481771106["tool_union_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 454d11cb_0b86_9e73_f884_ace481771106
  e379b36a_6cc4_73cb_a38b_f2eb2d9f7dc8["tool_choice_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> e379b36a_6cc4_73cb_a38b_f2eb2d9f7dc8
  75f45536_924c_c385_0b03_5cc1a67cf4ab["output_config_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 75f45536_924c_c385_0b03_5cc1a67cf4ab
  cfd73339_00da_52d7_4ad2_7ed904085316["OutputConfigParam"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> cfd73339_00da_52d7_4ad2_7ed904085316
  821cd9e1_c9b7_aa68_181f_1b0002d949a2["thinking_config_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 821cd9e1_c9b7_aa68_181f_1b0002d949a2
  1c602635_358e_cfb2_923c_ecf6b6ca2d09["tool_choice_any_param.py"]
  323219cc_84cd_94e9_ae78_777a62f2a45c --> 1c602635_358e_cfb2_923c_ecf6b6ca2d09
  style 323219cc_84cd_94e9_ae78_777a62f2a45c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Union, Iterable, Optional
from typing_extensions import Literal, Required, TypeAlias, TypedDict

from .._types import SequenceNotStr
from .model_param import ModelParam
from .message_param import MessageParam
from .metadata_param import MetadataParam
from .text_block_param import TextBlockParam
from .tool_union_param import ToolUnionParam
from .tool_choice_param import ToolChoiceParam
from .output_config_param import OutputConfigParam
from .thinking_config_param import ThinkingConfigParam
from .tool_choice_any_param import ToolChoiceAnyParam
from .tool_choice_auto_param import ToolChoiceAutoParam
from .tool_choice_tool_param import ToolChoiceToolParam

__all__ = [
    "MessageCreateParamsBase",
    "Metadata",
    "ToolChoice",
    "ToolChoiceToolChoiceAuto",
    "ToolChoiceToolChoiceAny",
    "ToolChoiceToolChoiceTool",
    "MessageCreateParamsNonStreaming",
    "MessageCreateParamsStreaming",
]


class MessageCreateParamsBase(TypedDict, total=False):
    max_tokens: Required[int]
    """The maximum number of tokens to generate before stopping.

    Note that our models may stop _before_ reaching this maximum. This parameter
    only specifies the absolute maximum number of tokens to generate.

    Different models have different maximum values for this parameter. See
    [models](https://docs.claude.com/en/docs/models-overview) for details.
    """

    messages: Required[Iterable[MessageParam]]
    """Input messages.

    Our models are trained to operate on alternating `user` and `assistant`
    conversational turns. When creating a new `Message`, you specify the prior
    conversational turns with the `messages` parameter, and the model then generates
    the next `Message` in the conversation. Consecutive `user` or `assistant` turns
    in your request will be combined into a single turn.

    Each input message must be an object with a `role` and `content`. You can
    specify a single `user`-role message, or you can include multiple `user` and
    `assistant` messages.

    If the final message uses the `assistant` role, the response content will
    continue immediately from the content in that message. This can be used to
    constrain part of the model's response.

// ... (264 more lines)

Frequently Asked Questions

What does message_create_params.py do?
message_create_params.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain.
What does message_create_params.py depend on?
message_create_params.py imports 21 module(s): MessageParam, MetadataParam, OutputConfigParam, TextBlockParam, ToolChoiceAnyParam, ToolChoiceAutoParam, ToolChoiceToolParam, _types, and 13 more.
What files import message_create_params.py?
message_create_params.py is imported by 1 file(s): __init__.py.
Where is message_create_params.py in the architecture?
message_create_params.py is located at src/anthropic/types/message_create_params.py (domain: AnthropicClient, directory: src/anthropic/types).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free