Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.10.0"
".": "1.11.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 11
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch%2Fturbopuffer-144a89af43469857b14698c6cd8d9e9394f0beb722a52b011d7c208438797f67.yml
openapi_spec_hash: 587ddf28d6f4533c31329ed23195815f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch%2Fturbopuffer-2167687b97544b7376e8ebf9e97e3be0c7b1b9cae458d90c41557efb3fc0a380.yml
openapi_spec_hash: 24b9061de54496e538f90435e68bc353
config_hash: a31fec3e293600dd17e128d578ed68cd
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 1.11.0 (2025-12-15)

Full Changelog: [v1.10.0...v1.11.0](https://github.com/turbopuffer/turbopuffer-python/compare/v1.10.0...v1.11.0)

### Features

* add word_v3 to the spec ([634b7f2](https://github.com/turbopuffer/turbopuffer-python/commit/634b7f272e71bfabda310649d136f613bae83ed1))


### Bug Fixes

* **types:** allow pyright to infer TypedDict types within SequenceNotStr ([2c2a4bc](https://github.com/turbopuffer/turbopuffer-python/commit/2c2a4bc039d797b11981d1da388fd2cc5e31f78b))


### Chores

* add missing docstrings ([1f04083](https://github.com/turbopuffer/turbopuffer-python/commit/1f04083d328be8f1f1805bfc55bd044ee2e56324))
* **internal:** add missing files argument to base client ([7afed9a](https://github.com/turbopuffer/turbopuffer-python/commit/7afed9a2bbc1184ce28430316035383cf248ee8f))

## 1.10.0 (2025-12-06)

Full Changelog: [v1.9.1...v1.10.0](https://github.com/turbopuffer/turbopuffer-python/compare/v1.9.1...v1.10.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "turbopuffer"
version = "1.10.0"
version = "1.11.0"
description = "The official Python library for the turbopuffer API"
dynamic = ["readme"]
license = "MIT"
Expand Down
10 changes: 8 additions & 2 deletions src/turbopuffer/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1273,9 +1273,12 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
)
return self.request(cast_to, opts)

def put(
Expand Down Expand Up @@ -1803,9 +1806,12 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(method="patch", url=path, json_data=body, **options)
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
)
return await self.request(cast_to, opts)

async def put(
Expand Down
5 changes: 3 additions & 2 deletions src/turbopuffer/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ class HttpxSendArgs(TypedDict, total=False):
if TYPE_CHECKING:
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
#
# Note: index() and count() methods are intentionally omitted to allow pyright to properly
# infer TypedDict types when dict literals are used in lists assigned to SequenceNotStr.
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
Expand All @@ -251,8 +254,6 @@ def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
def __contains__(self, value: object, /) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
def count(self, value: Any, /) -> int: ...
def __reversed__(self) -> Iterator[_T_co]: ...
else:
# just point this to a normal `Sequence` at runtime to avoid having to special case
Expand Down
2 changes: 1 addition & 1 deletion src/turbopuffer/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "turbopuffer"
__version__ = "1.10.0" # x-release-please-version
__version__ = "1.11.0" # x-release-please-version
4 changes: 4 additions & 0 deletions src/turbopuffer/types/attribute_schema_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class AnnAnnConfig(BaseModel):
"""Configuration options for ANN (Approximate Nearest Neighbor) indexing."""

distance_metric: Optional[DistanceMetric] = None
"""A function used to calculate vector similarity."""

Expand All @@ -20,6 +22,8 @@ class AnnAnnConfig(BaseModel):


class AttributeSchemaConfig(BaseModel):
"""Detailed configuration for an attribute attached to a document."""

type: AttributeType
"""The data type of the attribute.

Expand Down
4 changes: 4 additions & 0 deletions src/turbopuffer/types/attribute_schema_config_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@


class AnnAnnConfig(TypedDict, total=False):
"""Configuration options for ANN (Approximate Nearest Neighbor) indexing."""

distance_metric: DistanceMetric
"""A function used to calculate vector similarity."""

Expand All @@ -21,6 +23,8 @@ class AnnAnnConfig(TypedDict, total=False):


class AttributeSchemaConfigParam(TypedDict, total=False):
"""Detailed configuration for an attribute attached to a document."""

type: Required[AttributeType]
"""The data type of the attribute.

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/bm25_clause_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@


class Bm25ClauseParams(TypedDict, total=False):
"""Additional (optional) parameters for a single BM25 query clause."""

last_as_prefix: bool
"""Whether to treat the last token in the query input as a literal prefix."""
5 changes: 5 additions & 0 deletions src/turbopuffer/types/columns_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@


class ColumnsParamTyped(TypedDict, total=False):
"""A list of documents in columnar format.

Each key is a column name, mapped to an array of values for that column.
"""

id: Required[SequenceNotStr[IDParam]]
"""The IDs of the documents."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/contains_all_tokens_filter_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@


class ContainsAllTokensFilterParams(TypedDict, total=False):
"""Additional (optional) parameters for the ContainsAllTokens filter."""

last_as_prefix: bool
"""Whether to treat the last token in the query input as a literal prefix."""
4 changes: 3 additions & 1 deletion src/turbopuffer/types/full_text_search_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


class FullTextSearchConfig(BaseModel):
"""Configuration options for full-text search."""

ascii_folding: Optional[bool] = None
"""
Whether to convert each non-ASCII character in a token to its ASCII equivalent,
Expand Down Expand Up @@ -53,5 +55,5 @@ class FullTextSearchConfig(BaseModel):
tokenizer: Optional[Tokenizer] = None
"""The tokenizer to use for full-text search on an attribute.

Defaults to `word_v2`.
Defaults to `word_v3`.
"""
4 changes: 3 additions & 1 deletion src/turbopuffer/types/full_text_search_config_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@


class FullTextSearchConfigParam(TypedDict, total=False):
"""Configuration options for full-text search."""

ascii_folding: bool
"""
Whether to convert each non-ASCII character in a token to its ASCII equivalent,
Expand Down Expand Up @@ -54,5 +56,5 @@ class FullTextSearchConfigParam(TypedDict, total=False):
tokenizer: Tokenizer
"""The tokenizer to use for full-text search on an attribute.

Defaults to `word_v2`.
Defaults to `word_v3`.
"""
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_delete_all_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@


class NamespaceDeleteAllResponse(BaseModel):
"""The response to a successful namespace deletion request."""

status: Literal["OK"]
"""The status of the request."""
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_explain_query_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ class NamespaceExplainQueryParams(TypedDict, total=False):


class Consistency(TypedDict, total=False):
"""The consistency level for a query."""

level: Literal["strong", "eventual"]
"""The query's consistency level.

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_explain_query_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@


class NamespaceExplainQueryResponse(BaseModel):
"""The response to a successful query explain."""

plan_text: Optional[str] = None
"""The textual representation of the query plan."""
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_hint_cache_warm_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@


class NamespaceHintCacheWarmResponse(BaseModel):
"""The response to a successful cache warm request."""

status: Literal["ACCEPTED"]
"""The status of the request."""

Expand Down
6 changes: 6 additions & 0 deletions src/turbopuffer/types/namespace_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class EncryptionCmekCmek(BaseModel):


class EncryptionCmek(BaseModel):
"""
Indicates that the namespace is encrypted with a customer-managed encryption key (CMEK).
"""

cmek: EncryptionCmekCmek


Expand All @@ -56,6 +60,8 @@ class IndexIndexUpdating(BaseModel):


class NamespaceMetadata(BaseModel):
"""Metadata about a namespace."""

approx_logical_bytes: int
"""The approximate number of logical bytes in the namespace."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_multi_query_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class NamespaceMultiQueryParams(TypedDict, total=False):


class Consistency(TypedDict, total=False):
"""The consistency level for a query."""

level: Literal["strong", "eventual"]
"""The query's consistency level.

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_multi_query_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ class Result(BaseModel):


class NamespaceMultiQueryResponse(BaseModel):
"""The result of a multi-query."""

billing: QueryBilling
"""The billing information for a query."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_query_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class NamespaceQueryParams(TypedDict, total=False):


class Consistency(TypedDict, total=False):
"""The consistency level for a query."""

level: Literal["strong", "eventual"]
"""The query's consistency level.

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_query_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class NamespaceQueryResponse(BaseModel):
"""The result of a query."""

billing: QueryBilling
"""The billing information for a query."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_recall_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class GroundTruth(BaseModel):


class NamespaceRecallResponse(BaseModel):
"""The response to a successful cache warm request."""

avg_ann_count: float
"""
The average number of documents retrieved by the approximate nearest neighbor
Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@


class NamespaceSummary(BaseModel):
"""A summary of a namespace."""

id: str
"""The namespace ID."""
4 changes: 4 additions & 0 deletions src/turbopuffer/types/namespace_write_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,14 @@ class EncryptionCmek(TypedDict, total=False):


class Encryption(TypedDict, total=False):
"""The encryption configuration for a namespace."""

cmek: EncryptionCmek


class PatchByFilter(TypedDict, total=False):
"""The patch and filter specifying which documents to patch."""

filters: Required[Filter]
"""Filter by attributes. Same syntax as the query endpoint."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/namespace_write_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


class NamespaceWriteResponse(BaseModel):
"""The response to a successful write request."""

billing: WriteBilling
"""The billing information for a write request."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/query_billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class QueryBilling(BaseModel):
"""The billing information for a query."""

billable_logical_bytes_queried: int
"""The number of billable logical bytes queried from the namespace."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/query_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@


class QueryParam(TypedDict, total=False):
"""Query, filter, full-text search and vector search documents."""

aggregate_by: Dict[str, AggregateBy]
"""
Aggregations to compute over all documents in the namespace that match the
Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/query_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@


class QueryPerformance(ClientPerformance):
"""The performance information for a query."""

approx_namespace_size: int
"""the approximate number of documents in the namespace."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/row.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@


class Row(BaseModel):
"""A single document, in a row-based format."""

id: ID
"""An identifier for a document."""

Expand Down
2 changes: 2 additions & 0 deletions src/turbopuffer/types/row_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@


class RowParamTyped(TypedDict, total=False):
"""A single document, in a row-based format."""

id: Required[IDParam]
"""An identifier for a document."""

Expand Down
2 changes: 1 addition & 1 deletion src/turbopuffer/types/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

__all__ = ["Tokenizer"]

Tokenizer: TypeAlias = Literal["pre_tokenized_array", "word_v0", "word_v1", "word_v2"]
Tokenizer: TypeAlias = Literal["pre_tokenized_array", "word_v0", "word_v1", "word_v2", "word_v3"]
2 changes: 2 additions & 0 deletions src/turbopuffer/types/write_billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@


class WriteBilling(BaseModel):
"""The billing information for a write request."""

billable_logical_bytes_written: int
"""The number of billable logical bytes written to the namespace."""

Expand Down