MCPcopy
hub / github.com/openai/openai-python / retrieve

Method retrieve

src/openai/resources/files.py:508–543  ·  view source on GitHub ↗

Returns information about a specific file. 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 def

(
        self,
        file_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,
    )

Source from the content-addressed store, hash-verified

506 )
507
508 async def retrieve(
509 self,
510 file_id: str,
511 *,
512 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
513 # The extra values given here take precedence over values defined on the client or passed to this method.
514 extra_headers: Headers | None = None,
515 extra_query: Query | None = None,
516 extra_body: Body | None = None,
517 timeout: float | httpx.Timeout | None | NotGiven = not_given,
518 ) -> FileObject:
519 """
520 Returns information about a specific file.
521
522 Args:
523 extra_headers: Send extra headers
524
525 extra_query: Add additional query parameters to the request
526
527 extra_body: Add additional JSON properties to the request
528
529 timeout: Override the client-level default timeout for this request, in seconds
530 """
531 if not file_id:
532 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
533 return await self._get(
534 path_template("/files/{file_id}", file_id=file_id),
535 options=make_request_options(
536 extra_headers=extra_headers,
537 extra_query=extra_query,
538 extra_body=extra_body,
539 timeout=timeout,
540 security={"bearer_auth": True},
541 ),
542 cast_to=FileObject,
543 )
544
545 def list(
546 self,

Callers 1

wait_for_processingMethod · 0.95

Calls 2

path_templateFunction · 0.85
make_request_optionsFunction · 0.85

Tested by

no test coverage detected