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 @@
{
".": "0.2.0-alpha.75"
".": "0.2.0-alpha.76"
}
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/openlayer/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions src/openlayer/_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/openlayer/_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__ = "openlayer"
__version__ = "0.2.0-alpha.75" # x-release-please-version
__version__ = "0.2.0-alpha.76" # x-release-please-version