L i֨ `ddlmZddlZddlmZmZmZddlmZddl m Z m Z ddl Z ddl mZddlmZmZmZd d lmZmZmZmZmZmZdd lmZmZmZmZmZm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&m'Z'm(Z(dd l)m*Z*ddl+m,Z,m-Z-ddl.m/Z/m0Z0ddl1m2Z2m3Z3ddl4m5Z5m6Z6ddl7m8Z8ddl9m:Z:m;Z;ddlm?Z?ddl@mAZAddlBmCZCddlDmEZEddlFmGZGddlHmIZIddlJmKZKddlLmZddlMmNZNddlOmPZPdd gZQd!d!d!d!d!d"d#d"d"d$d$d% ZRGd&de,ZSGd'd e-ZTGd(d)ZUGd*d+ZVGd,d-ZWGd.d/ZXy)0) annotationsN)UnionIterableOptional)partial)Literaloverload)_legacy_response)ThinkingConfigParammessage_create_paramsmessage_count_tokens_params)Batches AsyncBatchesBatchesWithRawResponseAsyncBatchesWithRawResponseBatchesWithStreamingResponse!AsyncBatchesWithStreamingResponse) NOT_GIVENBodyOmitQueryHeadersNotGivenSequenceNotStromit not_given)is_given required_argsmaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)DEFAULT_TIMEOUTMODEL_NONSTREAMING_TOKENS)Stream AsyncStream)make_request_options)MessageStreamManagerAsyncMessageStreamManager)Message) ModelParam) MessageParam) MetadataParam)TextBlockParam)ToolUnionParam)ToolChoiceParam)MessageTokensCount)r )RawMessageStreamEvent)MessageCountTokensToolParamMessages AsyncMessageszNovember 6th, 2024zJuly 21st, 2025zJanuary 5th, 2026zFebruary 19th, 2026) z claude-1.3zclaude-1.3-100kzclaude-instant-1.1zclaude-instant-1.1-100kzclaude-instant-1.2zclaude-3-sonnet-20240229zclaude-3-opus-20240229z claude-2.1z claude-2.0zclaude-3-7-sonnet-latestzclaude-3-7-sonnet-20250219ceZdZeddZeddZeddZeeeeeeeeeeeeddde d ddZ eeeeeeeeeeeddde d ddZ eeeeeeeeeeeddde d dd Z e gd gd eeeeeeeeeeeddde d dd Z eeeeeeeeeeeddde d  ddZ eeeeddde d ddZy)r9c,t|jSN)r_clientselfs k/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/anthropic/resources/messages/messages.pybatcheszMessages.batchesBst||$$ct|Sa This property can be used as a prefix for any HTTP method call to return the raw response object instead of the parsed content. For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers )MessagesWithRawResponser?s rAwith_raw_responsezMessages.with_raw_responseFs't,,rCct|Sz An alternative to `.with_raw_response` that doesn't eagerly read the response body. For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response )MessagesWithStreamingResponser?s rAwith_streaming_responsez Messages.with_streaming_responsePs-T22rCNmetadata service_tierstop_sequencesstreamsystem temperaturethinking tool_choicetoolstop_ktop_p extra_headers extra_query extra_bodytimeoutcyu* Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation. The Messages API can be used for either single queries or stateless multi-turn conversations. Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup) Args: max_tokens: 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: 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. Example with a single `user` message: ```json [{ "role": "user", "content": "Hello, Claude" }] ``` Example with multiple conversational turns: ```json [ { "role": "user", "content": "Hello there." }, { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, { "role": "user", "content": "Can you explain LLMs in plain English?" } ] ``` Example with a partially-filled response from Claude: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent: ```json { "role": "user", "content": "Hello, Claude" } ``` ```json { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } ``` See [input examples](https://docs.claude.com/en/api/messages-examples). Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. There is a limit of 100,000 messages in a single request. model: The model that will complete your prompt. See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. metadata: An object describing metadata about the request. service_tier: Determines whether to use priority capacity (if available) or standard capacity for this request. Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details. stop_sequences: Custom text sequences that will cause the model to stop generating. Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`. If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence. stream: Whether to incrementally stream the response using server-sent events. See [streaming](https://docs.claude.com/en/api/messages-streaming) for details. system: System prompt. A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts). temperature: Amount of randomness injected into the response. Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks. Note that even with `temperature` of `0.0`, the results will not be fully deterministic. thinking: Configuration for enabling Claude's extended thinking. When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit. See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details. tool_choice: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all. tools: Definitions of tools that the model may use. If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks. There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)). Each tool definition includes: - `name`: Name of the tool. - `description`: Optional, but strongly-recommended description of the tool. - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks. For example, if you defined `tools` as: ```json [ { "name": "get_stock_price", "description": "Get the current stock price for a given ticker symbol.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string", "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." } }, "required": ["ticker"] } } ] ``` And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this: ```json [ { "type": "tool_use", "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "name": "get_stock_price", "input": { "ticker": "^GSPC" } } ] ``` You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message: ```json [ { "type": "tool_result", "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "content": "259.75 USD" } ] ``` Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output. See our [guide](https://docs.claude.com/en/docs/tool-use) for more details. top_k: Only sample from the top K options for each subsequent token. Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277). Recommended for advanced use cases only. You usually only need to use `temperature`. top_p: Use nucleus sampling. In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both. Recommended for advanced use cases only. You usually only need to use `temperature`. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds Nr@ max_tokensmessagesmodelrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[s rAcreatezMessages.createYT rCrMrNrOrQrRrSrTrUrVrWrXrYrZr[cyu* Send a structured list of input messages with text and/or image content, and the model will generate the next message in the conversation. The Messages API can be used for either single queries or stateless multi-turn conversations. Learn more about the Messages API in our [user guide](https://docs.claude.com/en/docs/initial-setup) Args: max_tokens: 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: 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. Example with a single `user` message: ```json [{ "role": "user", "content": "Hello, Claude" }] ``` Example with multiple conversational turns: ```json [ { "role": "user", "content": "Hello there." }, { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, { "role": "user", "content": "Can you explain LLMs in plain English?" } ] ``` Example with a partially-filled response from Claude: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent: ```json { "role": "user", "content": "Hello, Claude" } ``` ```json { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } ``` See [input examples](https://docs.claude.com/en/api/messages-examples). Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. There is a limit of 100,000 messages in a single request. model: The model that will complete your prompt. See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. stream: Whether to incrementally stream the response using server-sent events. See [streaming](https://docs.claude.com/en/api/messages-streaming) for details. metadata: An object describing metadata about the request. service_tier: Determines whether to use priority capacity (if available) or standard capacity for this request. Anthropic offers different levels of service for your API requests. See [service-tiers](https://docs.claude.com/en/api/service-tiers) for details. stop_sequences: Custom text sequences that will cause the model to stop generating. Our models will normally stop when they have naturally completed their turn, which will result in a response `stop_reason` of `"end_turn"`. If you want the model to stop generating when it encounters custom strings of text, you can use the `stop_sequences` parameter. If the model encounters one of the custom sequences, the response `stop_reason` value will be `"stop_sequence"` and the response `stop_sequence` value will contain the matched stop sequence. system: System prompt. A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts). temperature: Amount of randomness injected into the response. Defaults to `1.0`. Ranges from `0.0` to `1.0`. Use `temperature` closer to `0.0` for analytical / multiple choice, and closer to `1.0` for creative and generative tasks. Note that even with `temperature` of `0.0`, the results will not be fully deterministic. thinking: Configuration for enabling Claude's extended thinking. When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit. See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details. tool_choice: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all. tools: Definitions of tools that the model may use. If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks. There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)). Each tool definition includes: - `name`: Name of the tool. - `description`: Optional, but strongly-recommended description of the tool. - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks. For example, if you defined `tools` as: ```json [ { "name": "get_stock_price", "description": "Get the current stock price for a given ticker symbol.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string", "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." } }, "required": ["ticker"] } } ] ``` And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this: ```json [ { "type": "tool_use", "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "name": "get_stock_price", "input": { "ticker": "^GSPC" } } ] ``` You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message: ```json [ { "type": "tool_result", "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "content": "259.75 USD" } ] ``` Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output. See our [guide](https://docs.claude.com/en/docs/tool-use) for more details. top_k: Only sample from the top K options for each subsequent token. Used to remove "long tail" low probability responses. [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277). Recommended for advanced use cases only. You usually only need to use `temperature`. top_p: Use nucleus sampling. In nucleus sampling, we compute the cumulative distribution over all the options for each subsequent token in decreasing probability order and cut it off once it reaches a particular probability specified by `top_p`. You should either alter `temperature` or `top_p`, but not both. Recommended for advanced use cases only. You usually only need to use `temperature`. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds Nr^r@r`rarbrPrMrNrOrQrRrSrTrUrVrWrXrYrZr[s rArczMessages.createerdrCcyrgr^rhs rArczMessages.createqrdrCr`rarbr`rarbrPc|sXt|sM|jjtk(r0|jj |t j |d}|tvr*tjd|dt|dtd|jdt||||||||| | | | | |d|rtjntjt!||||t"|xsd t$t& S N The model '.' is deprecated and will reach end-of-life on ~. Please migrate to a newer model. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.r  stacklevel /v1/messages)r`rarbrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[Fbodyoptionscast_torP stream_cls)rr>r[r(_calculate_nonstreaming_timeoutr)getDEPRECATED_MODELSwarningswarnDeprecationWarning_postr!r MessageCreateParamsStreamingMessageCreateParamsNonStreamingr,r/r*r7r_s rArczMessages.create}s2hw/DLL4H4HO4[llBB599%FG % % MMeW$RSdejSkRlmlm"  zz  ", (" ($0&4$$#. (#.""""&BB*JJ'*)+Q[el?U349  rCrM containerrNrOrQrRrVrWrSrTrUrXrYrZr[cP|tvr*tjd|dt|dtdddi|xsi}t |j dt ||||||||| | | || | d d tjt|||| td tt }t|S zCreate a Message streamrnrorpr rqzX-Stainless-Stream-HelperrarsT)r`rarbrMrrNrOrQrRrVrWrUrSrTrPrtru)r|r}r~rrrr!r MessageCreateParamsr,r/r*r7r-)r@r`rarbrMrrNrOrQrRrVrWrSrTrUrXrYrZr[ make_requests rArPzMessages.streams2 % % MMeW$RSdejSkRlmlm"  ( "  JJ  ", (" (!*$0&4$#.""" (#.""&99%()+Q[el349 <$L11rCrQrSrTrUrXrYrZr[c |jdt||||||dtjt ||| | t S)i Count the number of tokens in a Message. The Token Count API can be used to count the number of tokens in a Message, including tools, images, and documents, without creating it. Learn more about token counting in our [user guide](https://docs.claude.com/en/docs/build-with-claude/token-counting) Args: messages: 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. Example with a single `user` message: ```json [{ "role": "user", "content": "Hello, Claude" }] ``` Example with multiple conversational turns: ```json [ { "role": "user", "content": "Hello there." }, { "role": "assistant", "content": "Hi, I'm Claude. How can I help you?" }, { "role": "user", "content": "Can you explain LLMs in plain English?" } ] ``` Example with a partially-filled response from Claude: ```json [ { "role": "user", "content": "What's the Greek name for Sun? (A) Sol (B) Helios (C) Sun" }, { "role": "assistant", "content": "The best answer is (" } ] ``` Each input message `content` may be either a single `string` or an array of content blocks, where each block has a specific `type`. Using a `string` for `content` is shorthand for an array of one content block of type `"text"`. The following input messages are equivalent: ```json { "role": "user", "content": "Hello, Claude" } ``` ```json { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] } ``` See [input examples](https://docs.claude.com/en/api/messages-examples). Note that if you want to include a [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the top-level `system` parameter — there is no `"system"` role for input messages in the Messages API. There is a limit of 100,000 messages in a single request. model: The model that will complete your prompt. See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options. system: System prompt. A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role. See our [guide to system prompts](https://docs.claude.com/en/docs/system-prompts). thinking: Configuration for enabling Claude's extended thinking. When enabled, responses include `thinking` content blocks showing Claude's thinking process before the final answer. Requires a minimum budget of 1,024 tokens and counts towards your `max_tokens` limit. See [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking) for details. tool_choice: How the model should use the provided tools. The model can use a specific tool, any available tool, decide by itself, or not use tools at all. tools: Definitions of tools that the model may use. If you include `tools` in your API request, the model may return `tool_use` content blocks that represent the model's use of those tools. You can then run those tools using the tool input generated by the model and then optionally return results back to the model using `tool_result` content blocks. There are two types of tools: **client tools** and **server tools**. The behavior described below applies to client tools. For [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools), see their individual documentation as each has its own behavior (e.g., the [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)). Each tool definition includes: - `name`: Name of the tool. - `description`: Optional, but strongly-recommended description of the tool. - `input_schema`: [JSON schema](https://json-schema.org/draft/2020-12) for the tool `input` shape that the model will produce in `tool_use` output content blocks. For example, if you defined `tools` as: ```json [ { "name": "get_stock_price", "description": "Get the current stock price for a given ticker symbol.", "input_schema": { "type": "object", "properties": { "ticker": { "type": "string", "description": "The stock ticker symbol, e.g. AAPL for Apple Inc." } }, "required": ["ticker"] } } ] ``` And then asked the model "What's the S&P 500 at today?", the model might produce `tool_use` content blocks in the response like this: ```json [ { "type": "tool_use", "id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "name": "get_stock_price", "input": { "ticker": "^GSPC" } } ] ``` You might then run your `get_stock_price` tool with `{"ticker": "^GSPC"}` as an input, and return the following back to the model in a subsequent `user` message: ```json [ { "type": "tool_result", "tool_use_id": "toolu_01D7FLrfh4GYq7yT1ULFeyMV", "content": "259.75 USD" } ] ``` Tools can be used for workflows that include running client-side tools and functions, or more generally whenever you want the model to produce a particular JSON structure of output. See our [guide](https://docs.claude.com/en/docs/tool-use) for more details. extra_headers: Send extra headers extra_query: Add additional query parameters to the request extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds /v1/messages/count_tokensrarbrQrSrTrUrtrvrwrx)rr!rMessageCountTokensParamsr,r6 r@rarbrQrSrTrUrXrYrZr[s rA count_tokenszMessages.count_tokenssbNzz ' ("$ (#." ,DD )+Q[el'!  rC)returnr)rrF)rrJ&r`intraIterable[MessageParam]rbr0rMMetadataParam | OmitrN'Literal['auto', 'standard_only'] | OmitrOSequenceNotStr[str] | OmitrPzLiteral[False] | OmitrQ+Union[str, Iterable[TextBlockParam]] | OmitrR float | OmitrSThinkingConfigParam | OmitrTToolChoiceParam | OmitrUIterable[ToolUnionParam] | OmitrV int | OmitrWrrXHeaders | NonerY Query | NonerZ Body | Noner['float | httpx.Timeout | None | NotGivenrr/)&r`rrarrbr0rP Literal[True]rMrrNrrOrrQrrRrrSrrTrrUrrVrrWrrXrrYrrZrr[rrzStream[RawMessageStreamEvent])&r`rrarrbr0rPboolrMrrNrrOrrQrrRrrSrrTrrUrrVrrWrrXrrYrrZrr[rr'Message | Stream[RawMessageStreamEvent])&r`rrarrbr0rMrrNrrOrrP%Literal[False] | Literal[True] | OmitrQrrRrrSrrTrrUrrVrrWrrXrrYrrZrr[rrr)&r`rrarrbr0rMrrOptional[str] | OmitrNrrOrrQrrRrrVrrWrrSrrTrrUrrXrrYrrZrr[rrr-rarrbr0rQrrSrrTrrUz,Iterable[MessageCountTokensToolParam] | OmitrXrrYrrZrr[rrr6__name__ __module__ __qualname__r#rBrGrKr rrrcr rrPrr^rCrAr9r9AsI%%--33*.@D59(,>B$(/3.215 ")-$("&;D-I I ) I  I ' I >I 3I &I <I "I -I ,I /I I !I &&'I (")I * +I ,9-I . /I I V*.@D59>B$(/3.215 ")-$("&;D-I I ) I  I  I 'I >I 3I <I "I -I ,I /I I !I &&'I (")I * +I ,9-I . '/I I V*.@D59>B$(/3.215 ")-$("&;D-I I ) I  I  I 'I >I 3I <I "I -I ,I /I I !I &&'I (")I * +I ,9-I . 1/I I V68ef*.@D598<>B$(/3.215 ")-$("&;D-A A ) A  A ' A >A 3A 6A <A "A -A ,A /A A !A &&'A (")A * +A ,9-A . 1/A gA R*.*.@D59>B$( "/3.215)-$("&;D-B2B2) B2  B2 ' B2(B2>B23B2<B2"B2B2B2-B2,B2 /!B2&&'B2(")B2* +B2,9-B2. /B2R?C/3.2>B)-$("&;DX )X  X < X - X ,X <X &X "X  X 9X  X rCceZdZeddZeddZeddZeeeeeeeeeeeeddde d ddZ eeeeeeeeeeeddde d ddZ eeeeeeeeeeeddde d dd Z e gd gd eeeeeeeeeeeddde d dd Z eeeeeeeeeeeddde d  ddZ eeeeddde d ddZy)r:c,t|jSr=)rr>r?s rArBzAsyncMessages.batchessDLL))rCct|SrE)AsyncMessagesWithRawResponser?s rArGzAsyncMessages.with_raw_responses,D11rCct|SrI)"AsyncMessagesWithStreamingResponser?s rArKz%AsyncMessages.with_streaming_responses2$77rCNrLc Kywr]r^r_s rArczAsyncMessages.create T rec Kywrgr^rhs rArczAsyncMessages.createrrc Kywrgr^rhs rArczAsyncMessages.createrrrjrkc*K|sXt|sM|jjtk(r0|jj |t j |d}|tvr*tjd|dt|dtd|jdt||||||||| | | | | |d|rtjntjd{t!||||t"|xsd t$t& d{S757wrm)rr>r[r(rzr)r{r|r}r~rrr"r rrr,r/r+r7r_s rArczAsyncMessages.creates42hw/DLL4H4HO4[llBB599%FG % % MMeW$RSdejSkRlmlm"  ZZ ,", (" ($0&4$$#. (#.""""&BB*JJ'*)+Q[el?U"#899     s$CDD 0D D DDrcF|tvr*tjd|dt|dtdddi|xsi}|j dt ||||||||| | | || | d d t jt|||| td tt }t|Sr) r|r}r~rrr!r rr,r/r+r7r.)r@r`rarbrMrrNrOrQrRrVrWrSrTrUrXrYrZr[requests rArPzAsyncMessages.stream`s2 % % MMeW$RSdejSkRlmlm"  ( " **  ", (" (!*$0&4$#.""" (#.""&99%()+Q[el"#897 :)11rCrc K|jdt||||||dtjd{t ||| | t d{S7$7w)rrrNrtr)rr"rrr,r6rs rArzAsyncMessages.count_tokenss{NZZ ', ("$ (#." ,DD  )+Q[el'!      s!1AA AAAA)rr)rr)rrr)&r`rrarrbr0rPrrMrrNrrOrrQrrRrrSrrTrrUrrVrrWrrXrrYrrZrr[rrz"AsyncStream[RawMessageStreamEvent])&r`rrarrbr0rPrrMrrNrrOrrQrrRrrSrrTrrUrrVrrWrrXrrYrrZrr[rr,Message | AsyncStream[RawMessageStreamEvent])&r`rrarrbr0rMrrNrrOrrPrrQrrRrrSrrTrrUrrVrrWrrXrrYrrZrr[rrr)&r`rrarrbr0rMrrrrNrrOrrQrrRrrVrrWrrSrrTrrUrrXrrYrrZrr[rrr.rrr^rCrAr:r:sI**2288*.@D59(,>B$(/3.215 ")-$("&;D-I I ) I  I ' I >I 3I &I <I "I -I ,I /I I !I &&'I (")I * +I ,9-I . /I I V*.@D59>B$(/3.215 ")-$("&;D-I I ) I  I  I 'I >I 3I <I "I -I ,I /I I !I &&'I (")I * +I ,9-I . ,/I I V*.@D59>B$(/3.215 ")-$("&;D-I I ) I  I  I 'I >I 3I <I "I -I ,I /I I !I &&'I (")I * +I ,9-I . 6/I I V68ef*.@D598<>B$(/3.215 ")-$("&;D-A A ) A  A ' A >A 3A 6A <A "A -A ,A /A A !A &&'A (")A * +A ,9-A . 6/A gA R*.*.@D59>B$( "/3.215)-$("&;D-A2A2) A2  A2 ' A2(A2>A23A2<A2"A2A2A2-A2,A2 /!A2&&'A2(")A2* +A2,9-A2. #/A2P?C/3.2>B)-$("&;DX )X  X < X - X ,X <X &X "X  X 9X  X rCc&eZdZddZeddZy)rFc||_tj|j|_tj|j|_yr=) _messagesr to_raw_response_wrapperrcrr@ras rA__init__z MessagesWithRawResponse.__init__ s@!&>> OO  -DD  ! ! rCc@t|jjSr=)rrrBr?s rArBzMessagesWithRawResponse.batches s%dnn&<&<==rCNrar9rNone)rrrrrrr#rBr^rCrArFrF~ s >>rCrFc&eZdZddZeddZy)rc||_tj|j|_tj|j|_yr=)rr async_to_raw_response_wrapperrcrrs rArz%AsyncMessagesWithRawResponse.__init__ s@!&DD OO  -JJ  ! ! rCc@t|jjSr=)rrrBr?s rArBz$AsyncMessagesWithRawResponse.batches s*4>>+A+ABBrCNrar:rr)rrrr^rCrArr s CCrCrc&eZdZddZeddZy)rJcz||_t|j|_t|j|_yr=)rr&rcrrs rArz&MessagesWithStreamingResponse.__init__ s4!2 OO  9  ! ! rCc@t|jjSr=)rrrBr?s rArBz%MessagesWithStreamingResponse.batches s+DNN,B,BCCrCNr)rrrr^rCrArJrJ s DDrCrJc&eZdZddZeddZy)rcz||_t|j|_t|j|_yr=)rr'rcrrs rArz+AsyncMessagesWithStreamingResponse.__init__ s4!8 OO  ?  ! ! rCc@t|jjSr=)rrrBr?s rArBz*AsyncMessagesWithStreamingResponse.batches s01G1GHHrCNr)rrrr^rCrArr s IIrCr)Y __future__rr}typingrrr functoolsrtyping_extensionsrr httpxr typesr r rrBrrrrrr_typesrrrrrrrrr_utilsrr r!r"_compatr# _resourcer$r% _responser&r' _constantsr(r) _streamingr*r+ _base_clientr, lib.streamingr-r. types.messager/types.model_paramr0types.message_paramr1types.metadata_paramr2types.text_block_paramr3types.tool_union_paramr4types.tool_choice_paramr5types.message_tokens_countr6types.thinking_config_paramtypes.raw_message_stream_eventr7%types.message_count_tokens_tool_paramr8__all__r|r9r:rFrrJrr^rCrArs#,,/  gffUU&:YD-0L$+/1446<>CP  ''+.3. 11## 5"7 \ \ ~$[ $[ |$ > > C C D D I IrC