VectorCollectionResponse
Represents a page of vector records.
For the list of response object types, see Response Objects.
Use VectorCollectionResponse to inspect vectors returned from a vector table and the pagination metadata for the page.
Attributes
| Attribute | Type | Description |
|---|---|---|
items |
list of VecDBVectorVectorItem or None |
Vectors returned in the current page. |
limit |
int or float or None |
Page size limit applied by the service. |
offset |
int or float or None |
Offset used for the current page. |
count |
int or float or None |
Number of vectors returned in the current page. |
VecDBVectorVectorItem
Represents one vector record returned in the items list of a VectorCollectionResponse response.
Attributes
| Attribute | Type | Description |
|---|---|---|
id |
str or None |
Record identifier. |
dense_vector |
list[float or int] or None |
Dense vector values. |
metadata |
dict[str, Any] or None |
Metadata associated with the vector record. |
Iterate Items
Iterate over response.items to inspect each vector record.
response = client.list_vectors(table_name="product_vectors")
for vector in response.items or []:
print(vector.id)
print(vector.metadata)
Methods
| Method | Return Type | Description |
|---|---|---|
model_dump() |
dict[str, Any] |
Returns a dictionary representation of the response. |
model_dump_json() |
str |
Returns a JSON string representation of the response. |
to_dict() |
dict[str, Any] |
Returns a dictionary representation compatible with earlier SDK response handling. |
to_json() |
str |
Returns a JSON string representation compatible with earlier SDK response handling. |
to_str() |
str |
Returns a readable string representation compatible with earlier SDK response handling. |
model_validate(obj) |
VectorCollectionResponse |
Creates a response object from a dictionary payload. |
model_validate_json(json_data) |
VectorCollectionResponse |
Creates a response object from a JSON string. |
Iterate Attributes
Use serialization helpers to iterate response attributes and item attributes.
response = client.list_vectors(table_name="product_vectors", limit=25, offset=0)
payload = response.to_dict()
for attribute, value in payload.items():
print(attribute, value)
for vector in response.items or []:
vector_payload = vector.to_dict()
for attribute, value in vector_payload.items():
print(attribute, value)
Sample Response
{
"items": [
{
"id": "prod_001",
"dense_vector": [0.12, 0.45, 0.32],
"metadata": {
"name": "Trail running shoes",
"category": "footwear"
}
}
],
"limit": 25,
"offset": 0,
"count": 1
}
Returned By
Returned by: list_vectors().