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.46.0"
".": "1.47.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: 10
configured_endpoints: 9
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/babs-technologies%2Fspitch-d909291d8029ce7de8d2ccad8e6d05f1f1d893f2ba68fcf6c1cd7265ab6a8df9.yml
openapi_spec_hash: 243f422b356ab7c8c417f87fe9ae2ad6
config_hash: a7d6293922d36aa3c3d9d7418f952ece
config_hash: 75f0cebdc2bbaa3b412c700aac6d0a13
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## 1.47.0 (2026-02-04)

Full Changelog: [v1.46.0...v1.47.0](https://github.com/spi-tch/spitch-python/compare/v1.46.0...v1.47.0)

### Features

* **api:** manual updates ([fc95856](https://github.com/spi-tch/spitch-python/commit/fc95856fb63359296f4c6211b58d2297559a7670))
* **api:** manual updates ([fc4b87a](https://github.com/spi-tch/spitch-python/commit/fc4b87a89ee3e9bd71b91261b47e49ef93198543))
* **api:** manual updates ([37b581a](https://github.com/spi-tch/spitch-python/commit/37b581a20032fe936d4cec742e3fc17bca98f4b4))
* **api:** manual updates ([671d858](https://github.com/spi-tch/spitch-python/commit/671d858a48e9b4af627d8ee4c13460cd05b55f51))

## 1.46.0 (2026-02-04)

Full Changelog: [v1.45.0...v1.46.0](https://github.com/spi-tch/spitch-python/compare/v1.45.0...v1.46.0)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ client = Spitch()
all_files = []
# Automatically fetches more pages as needed.
for file in client.files.list(
limit=10,
limit=50,
):
# Do something with file here
all_files.append(file)
Expand All @@ -149,7 +149,7 @@ async def main() -> None:
all_files = []
# Iterate through items across all pages, issuing requests as needed.
async for file in client.files.list(
limit=10,
limit=50,
):
all_files.append(file)
print(all_files)
Expand All @@ -162,7 +162,7 @@ Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get

```python
first_page = await client.files.list(
limit=10,
limit=50,
)
if first_page.has_next_page():
print(f"will fetch next page using these details: {first_page.next_page_info()}")
Expand All @@ -176,7 +176,7 @@ Or just work directly with the returned data:

```python
first_page = await client.files.list(
limit=10,
limit=50,
)

print(f"next page cursor: {first_page.next_cursor}") # => "next page cursor: ..."
Expand Down
7 changes: 3 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ Methods:
Types:

```python
from spitch.types import File, FileUsage, Files, FileDeleteResponse
from spitch.types import FileMeta, FileUsage, FileDeleteResponse
```

Methods:

- <code title="get /v1/files">client.files.<a href="./src/spitch/resources/files.py">list</a>(\*\*<a href="src/spitch/types/file_list_params.py">params</a>) -> <a href="./src/spitch/types/file.py">SyncFilesCursor[File]</a></code>
- <code title="get /v1/files">client.files.<a href="./src/spitch/resources/files.py">list</a>(\*\*<a href="src/spitch/types/file_list_params.py">params</a>) -> <a href="./src/spitch/types/file_meta.py">SyncFilesCursor[FileMeta]</a></code>
- <code title="delete /v1/files/{file_id}">client.files.<a href="./src/spitch/resources/files.py">delete</a>(file_id) -> <a href="./src/spitch/types/file_delete_response.py">FileDeleteResponse</a></code>
- <code title="get /v1/files/{file_id}/url">client.files.<a href="./src/spitch/resources/files.py">download</a>(file_id, \*\*<a href="src/spitch/types/file_download_params.py">params</a>) -> object</code>
- <code title="get /v1/files/{file_id}">client.files.<a href="./src/spitch/resources/files.py">get</a>(file_id) -> <a href="./src/spitch/types/file.py">File</a></code>
- <code title="post /v1/files">client.files.<a href="./src/spitch/resources/files.py">upload</a>(\*\*<a href="src/spitch/types/file_upload_params.py">params</a>) -> <a href="./src/spitch/types/file.py">File</a></code>
- <code title="post /v1/files">client.files.<a href="./src/spitch/resources/files.py">upload</a>(\*\*<a href="src/spitch/types/file_upload_params.py">params</a>) -> <a href="./src/spitch/types/file_meta.py">FileMeta</a></code>
- <code title="get /v1/files:usage">client.files.<a href="./src/spitch/resources/files.py">usage</a>() -> <a href="./src/spitch/types/file_usage.py">FileUsage</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "spitch"
version = "1.46.0"
version = "1.47.0"
description = "The official Python library for the Spitch API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions src/spitch/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
DEFAULT_MAX_RETRIES = 2
DEFAULT_CONNECTION_LIMITS = httpx.Limits(max_connections=100, max_keepalive_connections=20)

INITIAL_RETRY_DELAY = 0.5
MAX_RETRY_DELAY = 8.0
INITIAL_RETRY_DELAY = 0.3
MAX_RETRY_DELAY = 10.0
2 changes: 1 addition & 1 deletion src/spitch/_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__ = "spitch"
__version__ = "1.46.0" # x-release-please-version
__version__ = "1.47.0" # x-release-please-version
100 changes: 11 additions & 89 deletions src/spitch/resources/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
async_to_streamed_response_wrapper,
)
from ..pagination import SyncFilesCursor, AsyncFilesCursor
from ..types.file import File
from .._base_client import AsyncPaginator, make_request_options
from ..types.file_meta import FileMeta
from ..types.file_usage import FileUsage
from ..types.file_delete_response import FileDeleteResponse

Expand Down Expand Up @@ -57,7 +57,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncFilesCursor[File]:
) -> SyncFilesCursor[FileMeta]:
"""
Get Files

Expand All @@ -72,7 +72,7 @@ def list(
"""
return self._get_api_list(
"/v1/files",
page=SyncFilesCursor[File],
page=SyncFilesCursor[FileMeta],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -86,7 +86,7 @@ def list(
file_list_params.FileListParams,
),
),
model=File,
model=FileMeta,
)

def delete(
Expand Down Expand Up @@ -160,39 +160,6 @@ def download(
cast_to=object,
)

def get(
self,
file_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,
) -> File:
"""
Get 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 for this request, in seconds
"""
if not file_id:
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
return self._get(
f"/v1/files/{file_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=File,
)

def upload(
self,
*,
Expand All @@ -203,7 +170,7 @@ def upload(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> File:
) -> FileMeta:
"""
Upload a file to your storage.

Expand All @@ -229,7 +196,7 @@ def upload(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=File,
cast_to=FileMeta,
)

def usage(
Expand Down Expand Up @@ -283,7 +250,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[File, AsyncFilesCursor[File]]:
) -> AsyncPaginator[FileMeta, AsyncFilesCursor[FileMeta]]:
"""
Get Files

Expand All @@ -298,7 +265,7 @@ def list(
"""
return self._get_api_list(
"/v1/files",
page=AsyncFilesCursor[File],
page=AsyncFilesCursor[FileMeta],
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
Expand All @@ -312,7 +279,7 @@ def list(
file_list_params.FileListParams,
),
),
model=File,
model=FileMeta,
)

async def delete(
Expand Down Expand Up @@ -386,39 +353,6 @@ async def download(
cast_to=object,
)

async def get(
self,
file_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,
) -> File:
"""
Get 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 for this request, in seconds
"""
if not file_id:
raise ValueError(f"Expected a non-empty value for `file_id` but received {file_id!r}")
return await self._get(
f"/v1/files/{file_id}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=File,
)

async def upload(
self,
*,
Expand All @@ -429,7 +363,7 @@ async def upload(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> File:
) -> FileMeta:
"""
Upload a file to your storage.

Expand All @@ -455,7 +389,7 @@ async def upload(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=File,
cast_to=FileMeta,
)

async def usage(
Expand Down Expand Up @@ -491,9 +425,6 @@ def __init__(self, files: FilesResource) -> None:
self.download = to_raw_response_wrapper(
files.download,
)
self.get = to_raw_response_wrapper(
files.get,
)
self.upload = to_raw_response_wrapper(
files.upload,
)
Expand All @@ -515,9 +446,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.download = async_to_raw_response_wrapper(
files.download,
)
self.get = async_to_raw_response_wrapper(
files.get,
)
self.upload = async_to_raw_response_wrapper(
files.upload,
)
Expand All @@ -539,9 +467,6 @@ def __init__(self, files: FilesResource) -> None:
self.download = to_streamed_response_wrapper(
files.download,
)
self.get = to_streamed_response_wrapper(
files.get,
)
self.upload = to_streamed_response_wrapper(
files.upload,
)
Expand All @@ -563,9 +488,6 @@ def __init__(self, files: AsyncFilesResource) -> None:
self.download = async_to_streamed_response_wrapper(
files.download,
)
self.get = async_to_streamed_response_wrapper(
files.get,
)
self.upload = async_to_streamed_response_wrapper(
files.upload,
)
Expand Down
3 changes: 1 addition & 2 deletions src/spitch/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

from __future__ import annotations

from .file import File as File
from .files import Files as Files
from .segment import Segment as Segment
from .file_meta import FileMeta as FileMeta
from .diacritics import Diacritics as Diacritics
from .file_usage import FileUsage as FileUsage
from .translation import Translation as Translation
Expand Down
4 changes: 2 additions & 2 deletions src/spitch/types/file.py → src/spitch/types/file_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

from .._models import BaseModel

__all__ = ["File"]
__all__ = ["FileMeta"]


class File(BaseModel):
class FileMeta(BaseModel):
"""Metadata info for this file."""

created_at: datetime
Expand Down
16 changes: 0 additions & 16 deletions src/spitch/types/files.py

This file was deleted.

Loading
Loading