Home / Function/ retrieve() — anthropic-sdk-python Function Reference

retrieve() — anthropic-sdk-python Function Reference

Architecture documentation for the retrieve() function in batches.py from the anthropic-sdk-python codebase.

Function python AnthropicClient SyncAPI calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  90a3fc39_63ec_f9ad_319d_de27ce6dd962["retrieve()"]
  c731f4b8_455b_5488_a095_755b0070aedd["AsyncBatches"]
  90a3fc39_63ec_f9ad_319d_de27ce6dd962 -->|defined in| c731f4b8_455b_5488_a095_755b0070aedd
  8215ec2b_8430_7898_ef69_d6b26e8479e1["retrieve()"]
  8215ec2b_8430_7898_ef69_d6b26e8479e1 -->|calls| 90a3fc39_63ec_f9ad_319d_de27ce6dd962
  93278600_427e_5359_fec5_e7c0f20d5529["results()"]
  93278600_427e_5359_fec5_e7c0f20d5529 -->|calls| 90a3fc39_63ec_f9ad_319d_de27ce6dd962
  8215ec2b_8430_7898_ef69_d6b26e8479e1["retrieve()"]
  90a3fc39_63ec_f9ad_319d_de27ce6dd962 -->|calls| 8215ec2b_8430_7898_ef69_d6b26e8479e1
  style 90a3fc39_63ec_f9ad_319d_de27ce6dd962 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/resources/messages/batches.py lines 392–431

    async def retrieve(
        self,
        message_batch_id: str,
        *,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> MessageBatch:
        """This endpoint is idempotent and can be used to poll for Message Batch
        completion.

        To access the results of a Message Batch, make a request to the
        `results_url` field in the response.

        Learn more about the Message Batches API in our
        [user guide](https://docs.claude.com/en/docs/build-with-claude/batch-processing)

        Args:
          message_batch_id: ID of the Message Batch.

          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
        """
        if not message_batch_id:
            raise ValueError(f"Expected a non-empty value for `message_batch_id` but received {message_batch_id!r}")
        return await self._get(
            f"/v1/messages/batches/{message_batch_id}",
            options=make_request_options(
                extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
            ),
            cast_to=MessageBatch,
        )

Subdomains

Calls

Frequently Asked Questions

What does retrieve() do?
retrieve() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/resources/messages/batches.py.
Where is retrieve() defined?
retrieve() is defined in src/anthropic/resources/messages/batches.py at line 392.
What does retrieve() call?
retrieve() calls 1 function(s): retrieve.
What calls retrieve()?
retrieve() is called by 2 function(s): results, retrieve.

Analyze Your Own Codebase

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

Try Supermodel Free