Retrieves a run. Args: 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 requ
(
self,
run_id: str,
*,
thread_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,
)
| 634 | |
| 635 | @typing_extensions.deprecated("The Assistants API is deprecated in favor of the Responses API") |
| 636 | def retrieve( |
| 637 | self, |
| 638 | run_id: str, |
| 639 | *, |
| 640 | thread_id: str, |
| 641 | # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 642 | # The extra values given here take precedence over values defined on the client or passed to this method. |
| 643 | extra_headers: Headers | None = None, |
| 644 | extra_query: Query | None = None, |
| 645 | extra_body: Body | None = None, |
| 646 | timeout: float | httpx.Timeout | None | NotGiven = not_given, |
| 647 | ) -> Run: |
| 648 | """ |
| 649 | Retrieves a run. |
| 650 | |
| 651 | Args: |
| 652 | extra_headers: Send extra headers |
| 653 | |
| 654 | extra_query: Add additional query parameters to the request |
| 655 | |
| 656 | extra_body: Add additional JSON properties to the request |
| 657 | |
| 658 | timeout: Override the client-level default timeout for this request, in seconds |
| 659 | """ |
| 660 | if not thread_id: |
| 661 | raise ValueError(f"Expected a non-empty value for `thread_id` but received {thread_id!r}") |
| 662 | if not run_id: |
| 663 | raise ValueError(f"Expected a non-empty value for `run_id` but received {run_id!r}") |
| 664 | extra_headers = {"OpenAI-Beta": "assistants=v2", **(extra_headers or {})} |
| 665 | return self._get( |
| 666 | path_template("/threads/{thread_id}/runs/{run_id}", thread_id=thread_id, run_id=run_id), |
| 667 | options=make_request_options( |
| 668 | extra_headers=extra_headers, |
| 669 | extra_query=extra_query, |
| 670 | extra_body=extra_body, |
| 671 | timeout=timeout, |
| 672 | security={"bearer_auth": True}, |
| 673 | ), |
| 674 | cast_to=Run, |
| 675 | ) |
| 676 | |
| 677 | @typing_extensions.deprecated("The Assistants API is deprecated in favor of the Responses API") |
| 678 | def update( |
no test coverage detected