@@ -34,8 +34,8 @@ client = Mixedbread(
3434 environment = " development" ,
3535)
3636
37- vector_store = client.vector_stores .create()
38- print (vector_store .id)
37+ store = client.stores .create()
38+ print (store .id)
3939```
4040
4141While you can provide an ` api_key ` keyword argument,
@@ -60,8 +60,8 @@ client = AsyncMixedbread(
6060
6161
6262async def main () -> None :
63- vector_store = await client.vector_stores .create()
64- print (vector_store .id)
63+ store = await client.stores .create()
64+ print (store .id)
6565
6666
6767asyncio.run(main())
@@ -93,8 +93,8 @@ async def main() -> None:
9393 api_key = " My API Key" ,
9494 http_client = DefaultAioHttpClient(),
9595 ) as client:
96- vector_store = await client.vector_stores .create()
97- print (vector_store .id)
96+ store = await client.stores .create()
97+ print (store .id)
9898
9999
100100asyncio.run(main())
@@ -120,12 +120,12 @@ from mixedbread import Mixedbread
120120
121121client = Mixedbread()
122122
123- all_vector_stores = []
123+ all_stores = []
124124# Automatically fetches more pages as needed.
125- for vector_store in client.vector_stores .list():
126- # Do something with vector_store here
127- all_vector_stores .append(vector_store )
128- print (all_vector_stores )
125+ for store in client.stores .list():
126+ # Do something with store here
127+ all_stores .append(store )
128+ print (all_stores )
129129```
130130
131131Or, asynchronously:
@@ -138,11 +138,11 @@ client = AsyncMixedbread()
138138
139139
140140async def main () -> None :
141- all_vector_stores = []
141+ all_stores = []
142142 # Iterate through items across all pages, issuing requests as needed.
143- async for vector_store in client.vector_stores .list():
144- all_vector_stores .append(vector_store )
145- print (all_vector_stores )
143+ async for store in client.stores .list():
144+ all_stores .append(store )
145+ print (all_stores )
146146
147147
148148asyncio.run(main())
@@ -151,7 +151,7 @@ asyncio.run(main())
151151Alternatively, you can use the ` .has_next_page() ` , ` .next_page_info() ` , or ` .get_next_page() ` methods for more granular control working with pages:
152152
153153``` python
154- first_page = await client.vector_stores .list()
154+ first_page = await client.stores .list()
155155if first_page.has_next_page():
156156 print (f " will fetch next page using these details: { first_page.next_page_info()} " )
157157 next_page = await first_page.get_next_page()
@@ -163,11 +163,11 @@ if first_page.has_next_page():
163163Or just work directly with the returned data:
164164
165165``` python
166- first_page = await client.vector_stores .list()
166+ first_page = await client.stores .list()
167167
168168print (f " next page cursor: { first_page.pagination.last_cursor} " ) # => "next page cursor: ..."
169- for vector_store in first_page.data:
170- print (vector_store .id)
169+ for store in first_page.data:
170+ print (store .id)
171171
172172# Remove `await` for non-async usage.
173173```
@@ -181,10 +181,10 @@ from mixedbread import Mixedbread
181181
182182client = Mixedbread()
183183
184- vector_store = client.vector_stores .create(
184+ store = client.stores .create(
185185 expires_after = {},
186186)
187- print (vector_store .expires_after)
187+ print (store .expires_after)
188188```
189189
190190## File uploads
@@ -220,7 +220,7 @@ from mixedbread import Mixedbread
220220client = Mixedbread()
221221
222222try :
223- client.vector_stores .create()
223+ client.stores .create()
224224except mixedbread.APIConnectionError as e:
225225 print (" The server could not be reached" )
226226 print (e.__cause__) # an underlying Exception, likely raised within httpx.
@@ -263,7 +263,7 @@ client = Mixedbread(
263263)
264264
265265# Or, configure per-request:
266- client.with_options(max_retries = 5 ).vector_stores .create()
266+ client.with_options(max_retries = 5 ).stores .create()
267267```
268268
269269### Timeouts
@@ -286,7 +286,7 @@ client = Mixedbread(
286286)
287287
288288# Override per-request:
289- client.with_options(timeout = 5.0 ).vector_stores .create()
289+ client.with_options(timeout = 5.0 ).stores .create()
290290```
291291
292292On timeout, an ` APITimeoutError ` is thrown.
@@ -327,11 +327,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
327327from mixedbread import Mixedbread
328328
329329client = Mixedbread()
330- response = client.vector_stores .with_raw_response.create()
330+ response = client.stores .with_raw_response.create()
331331print (response.headers.get(' X-My-Header' ))
332332
333- vector_store = response.parse() # get the object that `vector_stores .create()` would have returned
334- print (vector_store .id)
333+ store = response.parse() # get the object that `stores .create()` would have returned
334+ print (store .id)
335335```
336336
337337These methods return an [ ` APIResponse ` ] ( https://github.com/mixedbread-ai/mixedbread-python/tree/main/src/mixedbread/_response.py ) object.
@@ -345,7 +345,7 @@ The above interface eagerly reads the full response body when you make the reque
345345To stream the response body, use ` .with_streaming_response ` instead, which requires a context manager and only reads the response body once you call ` .read() ` , ` .text() ` , ` .json() ` , ` .iter_bytes() ` , ` .iter_text() ` , ` .iter_lines() ` or ` .parse() ` . In the async client, these are async methods.
346346
347347``` python
348- with client.vector_stores .with_streaming_response.create() as response:
348+ with client.stores .with_streaming_response.create() as response:
349349 print (response.headers.get(" X-My-Header" ))
350350
351351 for line in response.iter_lines():
0 commit comments