From 348bf62632f34c9f807422225717eac4772e2f89 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:51:00 +0000 Subject: [PATCH 1/3] feat(client): support file upload requests --- src/openlayer/_base_client.py | 5 ++++- src/openlayer/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/openlayer/_base_client.py b/src/openlayer/_base_client.py index bea13ab1..28340224 100644 --- a/src/openlayer/_base_client.py +++ b/src/openlayer/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/openlayer/_files.py b/src/openlayer/_files.py index 715cc207..cc14c14f 100644 --- a/src/openlayer/_files.py +++ b/src/openlayer/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From be3b86012d324b6a1417636ff9e2960531870f81 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 05:06:25 +0000 Subject: [PATCH 2/3] chore(internal): fix ruff target version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e26690c9..2f4c09ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -167,7 +167,7 @@ reportPrivateUsage = false [tool.ruff] line-length = 120 output-format = "grouped" -target-version = "py37" +target-version = "py38" [tool.ruff.format] docstring-code-format = true From 15ee6bd7fda4199fa8929e6a96f1da8d9229978a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 20:06:50 +0000 Subject: [PATCH 3/3] release: 0.2.0-alpha.76 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 +- src/openlayer/_version.py | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4bb14de0..eeb3c0f8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0-alpha.75" + ".": "0.2.0-alpha.76" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2066d7f4..28395bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 0.2.0-alpha.76 (2025-08-06) + +Full Changelog: [v0.2.0-alpha.75...v0.2.0-alpha.76](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.75...v0.2.0-alpha.76) + +### Features + +* **client:** support file upload requests ([348bf62](https://github.com/openlayer-ai/openlayer-python/commit/348bf62632f34c9f807422225717eac4772e2f89)) +* **tracing:** add OCI Generative AI LLM tracing integration ([7e0621f](https://github.com/openlayer-ai/openlayer-python/commit/7e0621f954e4f9927b05544079157aec6c79d16f)) +* **tracing:** add OCI Generative AI tracing examples and documentation ([fbad796](https://github.com/openlayer-ai/openlayer-python/commit/fbad79691dd4bfb93376a72817eae2c70f39fbae)) +* **tracing:** enhance OCI Generative AI tracing notebook and integration ([c0ae879](https://github.com/openlayer-ai/openlayer-python/commit/c0ae8793bfc4f16da6604266de6e1a85b30ac341)) +* **tracing:** enhance OCI tracing functionality with token estimation options ([488ba7c](https://github.com/openlayer-ai/openlayer-python/commit/488ba7cd802e4982017e9a0e571a7db8d3f3d5ee)) +* **tracing:** enhance OCI tracing with timing and token estimation ([a517015](https://github.com/openlayer-ai/openlayer-python/commit/a517015d0c9838f09b1e4333ded92a7c2c283974)) +* **tracing:** update OCI Generative AI tracing notebook and remove examples ([2e02aa2](https://github.com/openlayer-ai/openlayer-python/commit/2e02aa2825308b93275dfd4da851d43368848926)) + + +### Chores + +* **internal:** fix ruff target version ([be3b860](https://github.com/openlayer-ai/openlayer-python/commit/be3b86012d324b6a1417636ff9e2960531870f81)) + + +### Refactors + +* **tracing:** clean up OCI tracing notebook by removing commented code ([e91fe47](https://github.com/openlayer-ai/openlayer-python/commit/e91fe4726589e77f7debaa0d6e9f6ea13e4d8523)) +* **tracing:** improve code formatting and consistency in oci_tracer.py ([d0700ae](https://github.com/openlayer-ai/openlayer-python/commit/d0700ae70bec89c256b6953d25244fbb54e594e6)) +* **tracing:** optimize chunk streaming and content extraction in oci_tracer.py ([a17bd88](https://github.com/openlayer-ai/openlayer-python/commit/a17bd88d14e4548632612f427bb77b3d699f5c1e)) +* **tracing:** streamline input extraction in OCI tracer ([915cd7b](https://github.com/openlayer-ai/openlayer-python/commit/915cd7b5a0b1f554614d6cb23d27ea8d87f8b0e6)) + ## 0.2.0-alpha.75 (2025-07-31) Full Changelog: [v0.2.0-alpha.74...v0.2.0-alpha.75](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.74...v0.2.0-alpha.75) diff --git a/pyproject.toml b/pyproject.toml index 2f4c09ed..cfb14e86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openlayer" -version = "0.2.0-alpha.75" +version = "0.2.0-alpha.76" description = "The official Python library for the openlayer API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openlayer/_version.py b/src/openlayer/_version.py index 25930fa2..9ddae4ff 100644 --- a/src/openlayer/_version.py +++ b/src/openlayer/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openlayer" -__version__ = "0.2.0-alpha.75" # x-release-please-version +__version__ = "0.2.0-alpha.76" # x-release-please-version