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

Method retrieve

src/openai/resources/vector_stores/files.py:114–155  ·  view source on GitHub ↗

Retrieves a vector store 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 default timeout

(
        self,
        file_id: str,
        *,
        vector_store_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

112 )
113
114 def retrieve(
115 self,
116 file_id: str,
117 *,
118 vector_store_id: str,
119 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
120 # The extra values given here take precedence over values defined on the client or passed to this method.
121 extra_headers: Headers | None = None,
122 extra_query: Query | None = None,
123 extra_body: Body | None = None,
124 timeout: float | httpx.Timeout | None | NotGiven = not_given,
125 ) -> VectorStoreFile:
126 """
127 Retrieves a vector store file.
128
129 Args:
130 extra_headers: Send extra headers
131
132 extra_query: Add additional query parameters to the request
133
134 extra_body: Add additional JSON properties to the request
135
136 timeout: Override the client-level default timeout for this request, in seconds
137 """
138 if not vector_store_id:
139 raise ValueError(f"Expected a non-empty value for `vector_store_id` but received {vector_store_id!r}")
140 if not file_id:
141 raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
142 extra_headers = {"OpenAI-Beta": "assistants=v2", **(extra_headers or {})}
143 return self._get(
144 path_template(
145 "/vector_stores/{vector_store_id}/files/{file_id}", vector_store_id=vector_store_id, file_id=file_id
146 ),
147 options=make_request_options(
148 extra_headers=extra_headers,
149 extra_query=extra_query,
150 extra_body=extra_body,
151 timeout=timeout,
152 security={"bearer_auth": True},
153 ),
154 cast_to=VectorStoreFile,
155 )
156
157 def update(
158 self,

Callers 2

pollMethod · 0.45
pollMethod · 0.45

Calls 2

path_templateFunction · 0.85
make_request_optionsFunction · 0.85

Tested by

no test coverage detected