From 8c3a005247ea045b9a95e7459eba2a90067daf71 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 24 Apr 2024 11:58:54 -0400 Subject: [PATCH 1/4] fix(docs): doc improvements (#1364) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84d9017e45..b8a0d9b0cb 100644 --- a/README.md +++ b/README.md @@ -521,7 +521,7 @@ The context manager is required so that the response will reliably be closed. ### Making custom/undocumented requests -This library is typed for convenient access the documented API. +This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used. From 4204e63e27584c68ad27825261225603d7a87008 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:24:04 -0400 Subject: [PATCH 2/4] chore(tests): rename test file (#1366) --- tests/api_resources/beta/chat/__init__.py | 1 - 1 file changed, 1 deletion(-) delete mode 100644 tests/api_resources/beta/chat/__init__.py diff --git a/tests/api_resources/beta/chat/__init__.py b/tests/api_resources/beta/chat/__init__.py deleted file mode 100644 index fd8019a9a1..0000000000 --- a/tests/api_resources/beta/chat/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. From fbc0e15f422971bd15499d4ea5f42a1c885c7004 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:33:44 -0400 Subject: [PATCH 3/4] fix(api): change timestamps to unix integers (#1367) --- src/openai/resources/batches.py | 10 ++++++---- src/openai/types/batch.py | 18 +++++++++--------- src/openai/types/batch_create_params.py | 5 +++-- src/openai/types/beta/vector_store.py | 6 +++--- .../beta/vector_stores/vector_store_file.py | 6 ++++++ 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/openai/resources/batches.py b/src/openai/resources/batches.py index 9b52958efc..a2a0272a7d 100644 --- a/src/openai/resources/batches.py +++ b/src/openai/resources/batches.py @@ -65,8 +65,9 @@ def create( See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. - Your input file must be formatted as a JSONL file, and must be uploaded with the - purpose `batch`. + Your input file must be formatted as a + [JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput), + and must be uploaded with the purpose `batch`. metadata: Optional custom metadata for the batch. @@ -252,8 +253,9 @@ async def create( See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. - Your input file must be formatted as a JSONL file, and must be uploaded with the - purpose `batch`. + Your input file must be formatted as a + [JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput), + and must be uploaded with the purpose `batch`. metadata: Optional custom metadata for the batch. diff --git a/src/openai/types/batch.py b/src/openai/types/batch.py index bde04d1a24..90f6d79572 100644 --- a/src/openai/types/batch.py +++ b/src/openai/types/batch.py @@ -24,7 +24,7 @@ class Batch(BaseModel): completion_window: str """The time frame within which the batch should be processed.""" - created_at: str + created_at: int """The Unix timestamp (in seconds) for when the batch was created.""" endpoint: str @@ -41,13 +41,13 @@ class Batch(BaseModel): ] """The current status of the batch.""" - cancelled_at: Optional[str] = None + cancelled_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch was cancelled.""" - cancelling_at: Optional[str] = None + cancelling_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch started cancelling.""" - completed_at: Optional[str] = None + completed_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch was completed.""" error_file_id: Optional[str] = None @@ -55,19 +55,19 @@ class Batch(BaseModel): errors: Optional[Errors] = None - expired_at: Optional[str] = None + expired_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch expired.""" - expires_at: Optional[str] = None + expires_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch will expire.""" - failed_at: Optional[str] = None + failed_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch failed.""" - finalizing_at: Optional[str] = None + finalizing_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch started finalizing.""" - in_progress_at: Optional[str] = None + in_progress_at: Optional[int] = None """The Unix timestamp (in seconds) for when the batch started processing.""" metadata: Optional[builtins.object] = None diff --git a/src/openai/types/batch_create_params.py b/src/openai/types/batch_create_params.py index 6a22be8626..a67aaa1e5e 100644 --- a/src/openai/types/batch_create_params.py +++ b/src/openai/types/batch_create_params.py @@ -27,8 +27,9 @@ class BatchCreateParams(TypedDict, total=False): See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. - Your input file must be formatted as a JSONL file, and must be uploaded with the - purpose `batch`. + Your input file must be formatted as a + [JSONL file](https://platform.openai.com/docs/api-reference/batch/requestInput), + and must be uploaded with the purpose `batch`. """ metadata: Optional[Dict[str, str]] diff --git a/src/openai/types/beta/vector_store.py b/src/openai/types/beta/vector_store.py index 122705734d..488961b444 100644 --- a/src/openai/types/beta/vector_store.py +++ b/src/openai/types/beta/vector_store.py @@ -40,9 +40,6 @@ class VectorStore(BaseModel): id: str """The identifier, which can be referenced in API endpoints.""" - bytes: int - """The byte size of the vector store.""" - created_at: int """The Unix timestamp (in seconds) for when the vector store was created.""" @@ -72,6 +69,9 @@ class VectorStore(BaseModel): for use. """ + usage_bytes: int + """The total number of bytes used by the files in the vector store.""" + expires_after: Optional[ExpiresAfter] = None """The expiration policy for a vector store.""" diff --git a/src/openai/types/beta/vector_stores/vector_store_file.py b/src/openai/types/beta/vector_stores/vector_store_file.py index a878b281d5..3fab489602 100644 --- a/src/openai/types/beta/vector_stores/vector_store_file.py +++ b/src/openai/types/beta/vector_stores/vector_store_file.py @@ -39,6 +39,12 @@ class VectorStoreFile(BaseModel): vector store file is ready for use. """ + usage_bytes: int + """The total vector store usage in bytes. + + Note that this may be different from the original file size. + """ + vector_store_id: str """ The ID of the From ab2f953e1aae11ae2b32418ac5c986420a0760de Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:34:10 -0400 Subject: [PATCH 4/4] release: 1.23.4 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 14 ++++++++++++++ pyproject.toml | 2 +- src/openai/_version.py | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 75baea2d17..9fbf60ba41 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.23.3" + ".": "1.23.4" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index eed20091bf..48ab946491 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 1.23.4 (2024-04-24) + +Full Changelog: [v1.23.3...v1.23.4](https://github.com/openai/openai-python/compare/v1.23.3...v1.23.4) + +### Bug Fixes + +* **api:** change timestamps to unix integers ([#1367](https://github.com/openai/openai-python/issues/1367)) ([fbc0e15](https://github.com/openai/openai-python/commit/fbc0e15f422971bd15499d4ea5f42a1c885c7004)) +* **docs:** doc improvements ([#1364](https://github.com/openai/openai-python/issues/1364)) ([8c3a005](https://github.com/openai/openai-python/commit/8c3a005247ea045b9a95e7459eba2a90067daf71)) + + +### Chores + +* **tests:** rename test file ([#1366](https://github.com/openai/openai-python/issues/1366)) ([4204e63](https://github.com/openai/openai-python/commit/4204e63e27584c68ad27825261225603d7a87008)) + ## 1.23.3 (2024-04-23) Full Changelog: [v1.23.2...v1.23.3](https://github.com/openai/openai-python/compare/v1.23.2...v1.23.3) diff --git a/pyproject.toml b/pyproject.toml index fbda5414f6..9cde315623 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "1.23.3" +version = "1.23.4" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_version.py b/src/openai/_version.py index ab45006b24..943be8e435 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "1.23.3" # x-release-please-version +__version__ = "1.23.4" # x-release-please-version