Skip to content

Commit e2a5229

Browse files
chore(api): upload stainless config from cloudflare-config
1 parent 1abdbfd commit e2a5229

7 files changed

Lines changed: 300 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1806
1+
configured_endpoints: 1807
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-88e489ffcdc25d2b600aabfddfc4509e020dda51b71624c4369eab50f5ac15a7.yml
33
openapi_spec_hash: 26da5dec2367f3c63bded8a4a7caa937
4-
config_hash: 03215e1e2607cd36fdac96c1ef923317
4+
config_hash: 9f61e9f02b675e373b140471d52b670c

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7172,6 +7172,7 @@ from cloudflare.types.vectorize import (
71727172
IndexDeleteByIDsResponse,
71737173
IndexInfoResponse,
71747174
IndexInsertResponse,
7175+
IndexListVectorsResponse,
71757176
IndexQueryResponse,
71767177
IndexUpsertResponse,
71777178
)
@@ -7187,6 +7188,7 @@ Methods:
71877188
- <code title="post /accounts/{account_id}/vectorize/v2/indexes/{index_name}/get_by_ids">client.vectorize.indexes.<a href="./src/cloudflare/resources/vectorize/indexes/indexes.py">get_by_ids</a>(index_name, \*, account_id, \*\*<a href="src/cloudflare/types/vectorize/index_get_by_ids_params.py">params</a>) -> object</code>
71887189
- <code title="get /accounts/{account_id}/vectorize/v2/indexes/{index_name}/info">client.vectorize.indexes.<a href="./src/cloudflare/resources/vectorize/indexes/indexes.py">info</a>(index_name, \*, account_id) -> <a href="./src/cloudflare/types/vectorize/index_info_response.py">Optional[IndexInfoResponse]</a></code>
71897190
- <code title="post /accounts/{account_id}/vectorize/v2/indexes/{index_name}/insert">client.vectorize.indexes.<a href="./src/cloudflare/resources/vectorize/indexes/indexes.py">insert</a>(index_name, \*, account_id, \*\*<a href="src/cloudflare/types/vectorize/index_insert_params.py">params</a>) -> <a href="./src/cloudflare/types/vectorize/index_insert_response.py">Optional[IndexInsertResponse]</a></code>
7191+
- <code title="get /accounts/{account_id}/vectorize/v2/indexes/{index_name}/list">client.vectorize.indexes.<a href="./src/cloudflare/resources/vectorize/indexes/indexes.py">list_vectors</a>(index_name, \*, account_id, \*\*<a href="src/cloudflare/types/vectorize/index_list_vectors_params.py">params</a>) -> <a href="./src/cloudflare/types/vectorize/index_list_vectors_response.py">Optional[IndexListVectorsResponse]</a></code>
71907192
- <code title="post /accounts/{account_id}/vectorize/v2/indexes/{index_name}/query">client.vectorize.indexes.<a href="./src/cloudflare/resources/vectorize/indexes/indexes.py">query</a>(index_name, \*, account_id, \*\*<a href="src/cloudflare/types/vectorize/index_query_params.py">params</a>) -> <a href="./src/cloudflare/types/vectorize/index_query_response.py">Optional[IndexQueryResponse]</a></code>
71917193
- <code title="post /accounts/{account_id}/vectorize/v2/indexes/{index_name}/upsert">client.vectorize.indexes.<a href="./src/cloudflare/resources/vectorize/indexes/indexes.py">upsert</a>(index_name, \*, account_id, \*\*<a href="src/cloudflare/types/vectorize/index_upsert_params.py">params</a>) -> <a href="./src/cloudflare/types/vectorize/index_upsert_response.py">Optional[IndexUpsertResponse]</a></code>
71927194

src/cloudflare/resources/vectorize/indexes/indexes.py

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
index_insert_params,
3535
index_upsert_params,
3636
index_get_by_ids_params,
37+
index_list_vectors_params,
3738
index_delete_by_ids_params,
3839
)
3940
from ....types.vectorize.create_index import CreateIndex
@@ -42,6 +43,7 @@
4243
from ....types.vectorize.index_delete_response import IndexDeleteResponse
4344
from ....types.vectorize.index_insert_response import IndexInsertResponse
4445
from ....types.vectorize.index_upsert_response import IndexUpsertResponse
46+
from ....types.vectorize.index_list_vectors_response import IndexListVectorsResponse
4547
from ....types.vectorize.index_delete_by_ids_response import IndexDeleteByIDsResponse
4648

4749
__all__ = ["IndexesResource", "AsyncIndexesResource"]
@@ -437,6 +439,61 @@ def insert(
437439
cast_to=cast(Type[Optional[IndexInsertResponse]], ResultWrapper[IndexInsertResponse]),
438440
)
439441

442+
def list_vectors(
443+
self,
444+
index_name: str,
445+
*,
446+
account_id: str,
447+
count: int | NotGiven = NOT_GIVEN,
448+
cursor: str | NotGiven = NOT_GIVEN,
449+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
450+
# The extra values given here take precedence over values defined on the client or passed to this method.
451+
extra_headers: Headers | None = None,
452+
extra_query: Query | None = None,
453+
extra_body: Body | None = None,
454+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
455+
) -> Optional[IndexListVectorsResponse]:
456+
"""
457+
Returns a paginated list of vector identifiers from the specified index.
458+
459+
Args:
460+
account_id: Identifier
461+
462+
count: Maximum number of vectors to return
463+
464+
cursor: Cursor for pagination to get the next page of results
465+
466+
extra_headers: Send extra headers
467+
468+
extra_query: Add additional query parameters to the request
469+
470+
extra_body: Add additional JSON properties to the request
471+
472+
timeout: Override the client-level default timeout for this request, in seconds
473+
"""
474+
if not account_id:
475+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
476+
if not index_name:
477+
raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}")
478+
return self._get(
479+
f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}/list",
480+
options=make_request_options(
481+
extra_headers=extra_headers,
482+
extra_query=extra_query,
483+
extra_body=extra_body,
484+
timeout=timeout,
485+
query=maybe_transform(
486+
{
487+
"count": count,
488+
"cursor": cursor,
489+
},
490+
index_list_vectors_params.IndexListVectorsParams,
491+
),
492+
post_parser=ResultWrapper[Optional[IndexListVectorsResponse]]._unwrapper,
493+
),
494+
cast_to=cast(Type[Optional[IndexListVectorsResponse]], ResultWrapper[IndexListVectorsResponse]),
495+
)
496+
440497
def query(
441498
self,
442499
index_name: str,
@@ -949,6 +1006,61 @@ async def insert(
9491006
cast_to=cast(Type[Optional[IndexInsertResponse]], ResultWrapper[IndexInsertResponse]),
9501007
)
9511008

1009+
async def list_vectors(
1010+
self,
1011+
index_name: str,
1012+
*,
1013+
account_id: str,
1014+
count: int | NotGiven = NOT_GIVEN,
1015+
cursor: str | NotGiven = NOT_GIVEN,
1016+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1017+
# The extra values given here take precedence over values defined on the client or passed to this method.
1018+
extra_headers: Headers | None = None,
1019+
extra_query: Query | None = None,
1020+
extra_body: Body | None = None,
1021+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1022+
) -> Optional[IndexListVectorsResponse]:
1023+
"""
1024+
Returns a paginated list of vector identifiers from the specified index.
1025+
1026+
Args:
1027+
account_id: Identifier
1028+
1029+
count: Maximum number of vectors to return
1030+
1031+
cursor: Cursor for pagination to get the next page of results
1032+
1033+
extra_headers: Send extra headers
1034+
1035+
extra_query: Add additional query parameters to the request
1036+
1037+
extra_body: Add additional JSON properties to the request
1038+
1039+
timeout: Override the client-level default timeout for this request, in seconds
1040+
"""
1041+
if not account_id:
1042+
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
1043+
if not index_name:
1044+
raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}")
1045+
return await self._get(
1046+
f"/accounts/{account_id}/vectorize/v2/indexes/{index_name}/list",
1047+
options=make_request_options(
1048+
extra_headers=extra_headers,
1049+
extra_query=extra_query,
1050+
extra_body=extra_body,
1051+
timeout=timeout,
1052+
query=await async_maybe_transform(
1053+
{
1054+
"count": count,
1055+
"cursor": cursor,
1056+
},
1057+
index_list_vectors_params.IndexListVectorsParams,
1058+
),
1059+
post_parser=ResultWrapper[Optional[IndexListVectorsResponse]]._unwrapper,
1060+
),
1061+
cast_to=cast(Type[Optional[IndexListVectorsResponse]], ResultWrapper[IndexListVectorsResponse]),
1062+
)
1063+
9521064
async def query(
9531065
self,
9541066
index_name: str,
@@ -1099,6 +1211,9 @@ def __init__(self, indexes: IndexesResource) -> None:
10991211
self.insert = to_raw_response_wrapper(
11001212
indexes.insert,
11011213
)
1214+
self.list_vectors = to_raw_response_wrapper(
1215+
indexes.list_vectors,
1216+
)
11021217
self.query = to_raw_response_wrapper(
11031218
indexes.query,
11041219
)
@@ -1139,6 +1254,9 @@ def __init__(self, indexes: AsyncIndexesResource) -> None:
11391254
self.insert = async_to_raw_response_wrapper(
11401255
indexes.insert,
11411256
)
1257+
self.list_vectors = async_to_raw_response_wrapper(
1258+
indexes.list_vectors,
1259+
)
11421260
self.query = async_to_raw_response_wrapper(
11431261
indexes.query,
11441262
)
@@ -1179,6 +1297,9 @@ def __init__(self, indexes: IndexesResource) -> None:
11791297
self.insert = to_streamed_response_wrapper(
11801298
indexes.insert,
11811299
)
1300+
self.list_vectors = to_streamed_response_wrapper(
1301+
indexes.list_vectors,
1302+
)
11821303
self.query = to_streamed_response_wrapper(
11831304
indexes.query,
11841305
)
@@ -1219,6 +1340,9 @@ def __init__(self, indexes: AsyncIndexesResource) -> None:
12191340
self.insert = async_to_streamed_response_wrapper(
12201341
indexes.insert,
12211342
)
1343+
self.list_vectors = async_to_streamed_response_wrapper(
1344+
indexes.list_vectors,
1345+
)
12221346
self.query = async_to_streamed_response_wrapper(
12231347
indexes.query,
12241348
)

src/cloudflare/types/vectorize/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
from .index_insert_response import IndexInsertResponse as IndexInsertResponse
1414
from .index_upsert_response import IndexUpsertResponse as IndexUpsertResponse
1515
from .index_get_by_ids_params import IndexGetByIDsParams as IndexGetByIDsParams
16+
from .index_list_vectors_params import IndexListVectorsParams as IndexListVectorsParams
1617
from .index_delete_by_ids_params import IndexDeleteByIDsParams as IndexDeleteByIDsParams
18+
from .index_list_vectors_response import IndexListVectorsResponse as IndexListVectorsResponse
1719
from .index_delete_by_ids_response import IndexDeleteByIDsResponse as IndexDeleteByIDsResponse
1820
from .index_dimension_configuration import IndexDimensionConfiguration as IndexDimensionConfiguration
1921
from .index_dimension_configuration_param import IndexDimensionConfigurationParam as IndexDimensionConfigurationParam
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Required, TypedDict
6+
7+
__all__ = ["IndexListVectorsParams"]
8+
9+
10+
class IndexListVectorsParams(TypedDict, total=False):
11+
account_id: Required[str]
12+
"""Identifier"""
13+
14+
count: int
15+
"""Maximum number of vectors to return"""
16+
17+
cursor: str
18+
"""Cursor for pagination to get the next page of results"""
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from datetime import datetime
5+
6+
from pydantic import Field as FieldInfo
7+
8+
from ..._models import BaseModel
9+
10+
__all__ = ["IndexListVectorsResponse", "Vector"]
11+
12+
13+
class Vector(BaseModel):
14+
id: str
15+
"""Identifier for a Vector"""
16+
17+
18+
class IndexListVectorsResponse(BaseModel):
19+
count: int
20+
"""Number of vectors returned in this response"""
21+
22+
is_truncated: bool = FieldInfo(alias="isTruncated")
23+
"""Whether there are more vectors available beyond this response"""
24+
25+
total_count: int = FieldInfo(alias="totalCount")
26+
"""Total number of vectors in the index"""
27+
28+
vectors: List[Vector]
29+
"""Array of vector items"""
30+
31+
cursor_expiration_timestamp: Optional[datetime] = FieldInfo(alias="cursorExpirationTimestamp", default=None)
32+
"""When the cursor expires as an ISO8601 string"""
33+
34+
next_cursor: Optional[str] = FieldInfo(alias="nextCursor", default=None)
35+
"""Cursor for the next page of results"""

0 commit comments

Comments
 (0)