Skip to content

release: 0.2.0-alpha.65 #471

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
55a2e38
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 17, 2025
af83c82
chore(internal): update conftest.py
stainless-app[bot] Jun 17, 2025
07c86b5
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
2c30786
chore(readme): update badges
stainless-app[bot] Jun 18, 2025
ab7ef6b
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 18, 2025
ad5d7c0
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 19, 2025
977528d
feat(client): add support for aiohttp
stainless-app[bot] Jun 23, 2025
ef12a3a
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
e42727c
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
fbf9c05
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
f616411
fix(ci): correct conditional
stainless-app[bot] Jun 30, 2025
49cdc9c
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
ffde2dc
Merge branch 'next' into main--merge-conflict
whoseoyster Jul 6, 2025
fac2147
Merge pull request #13 from stainless-sdks/main--merge-conflict
whoseoyster Jul 6, 2025
f514ca3
chore(internal): codegen related update
stainless-app[bot] Jul 8, 2025
5193b7a
Merge remote-tracking branch 'origin/main' into next
stainless-app[bot] Jul 8, 2025
a5370d8
Merge remote-tracking branch 'origin/main' into next
stainless-app[bot] Jul 8, 2025
ddef8c8
chore(internal): bump pinned h11 dep
stainless-app[bot] Jul 9, 2025
e663ce9
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 9, 2025
733471b
release: 0.2.0-alpha.65
stainless-app[bot] Jul 9, 2025
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
25 changes: 22 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/openlayer-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -30,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/openlayer-python'
build:
if: github.repository == 'stainless-sdks/openlayer-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand Down
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.64"
".": "0.2.0-alpha.65"
}
47 changes: 47 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,53 @@ 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.65 (2025-07-09)

Full Changelog: [v0.2.0-alpha.64...v0.2.0-alpha.65](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.64...v0.2.0-alpha.65)

### Features

* adds openai agents sdk trace processor ([da53c53](https://github.com/openlayer-ai/openlayer-python/commit/da53c534e3e9969fa4b2bb7e1ba571caa80a78aa))
* **client:** add support for aiohttp ([977528d](https://github.com/openlayer-ai/openlayer-python/commit/977528d63ccc1d9c9ad534c2c84f490dcfd8fa2c))
* **examples:** add OpenAI Agents tracing notebook for multi-agent conversation monitoring ([dbeb9f4](https://github.com/openlayer-ai/openlayer-python/commit/dbeb9f4f8f267b02434bae4a6ab56f9f8d2843af))
* implement remaining methods for LangChain callback handler ([cd6d303](https://github.com/openlayer-ai/openlayer-python/commit/cd6d30373859a432d91d36fcd56294906e9b52aa))
* **openai-agents:** enhance OpenAI Agents tracing with structured span data extraction ([46d0852](https://github.com/openlayer-ai/openlayer-python/commit/46d08528ba036ace5fdf45a35f813c2494e1ae1f))


### Bug Fixes

* **ci:** correct conditional ([f616411](https://github.com/openlayer-ai/openlayer-python/commit/f6164110ff27782f0df72c486d2c45c66f3a6cb5))
* **ci:** release-doctor — report correct token name ([e42727c](https://github.com/openlayer-ai/openlayer-python/commit/e42727caf8c7ac350874d9195487da19df7f0081))
* context list handling ([#474](https://github.com/openlayer-ai/openlayer-python/issues/474)) ([1ef1a1e](https://github.com/openlayer-ai/openlayer-python/commit/1ef1a1e917675646ec62275101d19e595ba6c2cf))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([ab7ef6b](https://github.com/openlayer-ai/openlayer-python/commit/ab7ef6b12437afc6bc07b1839cdd5fb70d4c3628))
* update pyarrow version ([f4feadf](https://github.com/openlayer-ai/openlayer-python/commit/f4feadfa95a07a71d79b6184795e79c44644947b))


### Chores

* **ci:** change upload type ([49cdc9c](https://github.com/openlayer-ai/openlayer-python/commit/49cdc9c1c246051fcd78722eab8896fc3398a555))
* **ci:** enable for pull requests ([07c86b5](https://github.com/openlayer-ai/openlayer-python/commit/07c86b5080d0c910e373b6f50b966ea56794e734))
* **ci:** only run for pushes and fork pull requests ([fbf9c05](https://github.com/openlayer-ai/openlayer-python/commit/fbf9c05081172a447968c7c4ed011a364239ac7a))
* **internal:** bump pinned h11 dep ([ddef8c8](https://github.com/openlayer-ai/openlayer-python/commit/ddef8c848fd1abb9a884b6fa0a42b5e9f2be0412))
* **internal:** codegen related update ([f514ca3](https://github.com/openlayer-ai/openlayer-python/commit/f514ca32ebd1068d9b91b85d1788de560da14a08))
* **internal:** update conftest.py ([af83c82](https://github.com/openlayer-ai/openlayer-python/commit/af83c828c31f99537e8b57074a325d0ec8dec13e))
* **package:** mark python 3.13 as supported ([e663ce9](https://github.com/openlayer-ai/openlayer-python/commit/e663ce9a6b27739878efac099e0c253cc616190c))
* **readme:** update badges ([2c30786](https://github.com/openlayer-ai/openlayer-python/commit/2c30786b6870f003f4c6c2a9f68136eff15d2ebf))
* refactor LangChain callback handler ([858285d](https://github.com/openlayer-ai/openlayer-python/commit/858285dc4387088001a50ebde6c1cf34ffb5374c))
* remove unused imports, break long lines, and formatting cleanup ([753c317](https://github.com/openlayer-ai/openlayer-python/commit/753c31705958f2c16ed27092e33f97aa87854230))
* **tests:** add tests for httpx client instantiation & proxies ([55a2e38](https://github.com/openlayer-ai/openlayer-python/commit/55a2e38b32dd755ac27b36c7b1ebffe0ef41d3f2))
* **tests:** skip some failing tests on the latest python versions ([ef12a3a](https://github.com/openlayer-ai/openlayer-python/commit/ef12a3a6487d67e0add70f168a5954fb49c0f47b))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([ad5d7c0](https://github.com/openlayer-ai/openlayer-python/commit/ad5d7c000f6ffb885d176192a98a740ff1251bd4))


### Refactors

* **integrations:** update Openlayer integration imports ([ac78c1c](https://github.com/openlayer-ai/openlayer-python/commit/ac78c1c6c4dce5c6f822263ad9b168cd2d414c13))

## 0.2.0-alpha.64 (2025-06-16)

Full Changelog: [v0.2.0-alpha.63...v0.2.0-alpha.64](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.63...v0.2.0-alpha.64)
Expand Down
54 changes: 52 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Openlayer Python API library

[![PyPI version](https://img.shields.io/pypi/v/openlayer.svg)](https://pypi.org/project/openlayer/)
[![PyPI version](<https://img.shields.io/pypi/v/openlayer.svg?label=pypi%20(stable)>)](https://pypi.org/project/openlayer/)

The Openlayer Python library provides convenient access to the Openlayer REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -100,6 +100,56 @@ asyncio.run(main())

Functionality between the synchronous and asynchronous clients is otherwise identical.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install --pre openlayer[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from openlayer import DefaultAioHttpClient
from openlayer import AsyncOpenlayer


async def main() -> None:
async with AsyncOpenlayer(
api_key=os.environ.get("OPENLAYER_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
response = await client.inference_pipelines.data.stream(
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
config={
"input_variable_names": ["user_query"],
"output_column_name": "output",
"num_of_token_column_name": "tokens",
"cost_column_name": "cost",
"timestamp_column_name": "timestamp",
},
rows=[
{
"user_query": "what is the meaning of life?",
"output": "42",
"tokens": 7,
"cost": 0.02,
"timestamp": 1610000000,
}
],
)
print(response.success)


asyncio.run(main())
```

## Using types

Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
Expand Down Expand Up @@ -227,7 +277,7 @@ client.with_options(max_retries=5).inference_pipelines.data.stream(
### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from openlayer import Openlayer
Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The OPENLAYER_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openlayer"
version = "0.2.0-alpha.64"
version = "0.2.0-alpha.65"
description = "The official Python library for the openlayer API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -30,6 +30,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
Expand All @@ -43,6 +44,8 @@ classifiers = [
Homepage = "https://github.com/openlayer-ai/openlayer-python"
Repository = "https://github.com/openlayer-ai/openlayer-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]

[tool.rye]
managed = true
Expand Down
31 changes: 29 additions & 2 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,24 @@
# with-sources: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.13
# via httpx-aiohttp
# via openlayer
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via openlayer
argcomplete==3.1.2
# via nox
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
Expand All @@ -35,24 +46,34 @@ execnet==2.1.1
# via pytest-xdist
filelock==3.12.4
# via virtualenv
h11==0.14.0
frozenlist==1.7.0
# via aiohttp
# via aiosignal
h11==0.16.0
# via httpcore
httpcore==1.0.2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via openlayer
# via respx
httpx-aiohttp==0.1.8
# via openlayer
idna==3.4
# via anyio
# via httpx
# via requests
# via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
multidict==6.5.0
# via aiohttp
# via yarl
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
Expand All @@ -73,6 +94,9 @@ platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
# via pytest
propcache==0.3.2
# via aiohttp
# via yarl
pyarrow==15.0.2
# via openlayer
pydantic==2.10.3
Expand Down Expand Up @@ -117,6 +141,7 @@ tqdm==4.67.1
# via openlayer
typing-extensions==4.12.2
# via anyio
# via multidict
# via mypy
# via openlayer
# via pydantic
Expand All @@ -128,5 +153,7 @@ urllib3==2.2.3
# via requests
virtualenv==20.24.5
# via nox
yarl==1.20.1
# via aiohttp
zipp==3.17.0
# via importlib-metadata
31 changes: 29 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@
# with-sources: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.13
# via httpx-aiohttp
# via openlayer
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via openlayer
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
Expand All @@ -23,22 +34,35 @@ distro==1.8.0
# via openlayer
exceptiongroup==1.2.2
# via anyio
h11==0.14.0
frozenlist==1.7.0
# via aiohttp
# via aiosignal
h11==0.16.0
# via httpcore
httpcore==1.0.2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via openlayer
httpx-aiohttp==0.1.8
# via openlayer
idna==3.4
# via anyio
# via httpx
# via requests
# via yarl
multidict==6.5.0
# via aiohttp
# via yarl
numpy==1.26.4
# via openlayer
# via pandas
# via pyarrow
pandas==2.2.2
# via openlayer
propcache==0.3.2
# via aiohttp
# via yarl
pyarrow==15.0.2
# via openlayer
pydantic==2.10.3
Expand All @@ -64,10 +88,13 @@ tqdm==4.67.1
# via openlayer
typing-extensions==4.12.2
# via anyio
# via multidict
# via openlayer
# via pydantic
# via pydantic-core
tzdata==2024.1
# via pandas
urllib3==2.2.3
# via requests
yarl==1.20.1
# via aiohttp
Loading