Skip to content

Commit b89396c

Browse files
release: 0.2.0-alpha.65 (#471)
* chore(tests): add tests for httpx client instantiation & proxies * chore(internal): update conftest.py * chore(ci): enable for pull requests * chore(readme): update badges * fix(tests): fix: tests which call HTTP endpoints directly with the example parameters * docs(client): fix httpx.Timeout documentation reference * feat(client): add support for aiohttp * chore(tests): skip some failing tests on the latest python versions * fix(ci): release-doctor — report correct token name * chore(ci): only run for pushes and fork pull requests * fix(ci): correct conditional * chore(ci): change upload type * chore(internal): codegen related update * chore(internal): bump pinned h11 dep * chore(package): mark python 3.13 as supported * release: 0.2.0-alpha.65 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Rishab Ramanathan <rishramanathan@gmail.com>
1 parent 1ef1a1e commit b89396c

25 files changed

+397
-161
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ on:
77
- 'integrated/**'
88
- 'stl-preview-head/**'
99
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

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

@@ -30,17 +35,31 @@ jobs:
3035
- name: Run lints
3136
run: ./scripts/lint
3237

33-
upload:
34-
if: github.repository == 'stainless-sdks/openlayer-python'
38+
build:
39+
if: github.repository == 'stainless-sdks/openlayer-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
3540
timeout-minutes: 10
36-
name: upload
41+
name: build
3742
permissions:
3843
contents: read
3944
id-token: write
4045
runs-on: depot-ubuntu-24.04
4146
steps:
4247
- uses: actions/checkout@v4
4348

49+
- name: Install Rye
50+
run: |
51+
curl -sSf https://rye.astral.sh/get | bash
52+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53+
env:
54+
RYE_VERSION: '0.44.0'
55+
RYE_INSTALL_OPTION: '--yes'
56+
57+
- name: Install dependencies
58+
run: rye sync --all-features
59+
60+
- name: Run build
61+
run: rye build
62+
4463
- name: Get GitHub OIDC Token
4564
id: github-oidc
4665
uses: actions/github-script@v6

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.0-alpha.64"
2+
".": "0.2.0-alpha.65"
33
}

CHANGELOG.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,53 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## 0.2.0-alpha.65 (2025-07-09)
9+
10+
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)
11+
12+
### Features
13+
14+
* adds openai agents sdk trace processor ([da53c53](https://github.com/openlayer-ai/openlayer-python/commit/da53c534e3e9969fa4b2bb7e1ba571caa80a78aa))
15+
* **client:** add support for aiohttp ([977528d](https://github.com/openlayer-ai/openlayer-python/commit/977528d63ccc1d9c9ad534c2c84f490dcfd8fa2c))
16+
* **examples:** add OpenAI Agents tracing notebook for multi-agent conversation monitoring ([dbeb9f4](https://github.com/openlayer-ai/openlayer-python/commit/dbeb9f4f8f267b02434bae4a6ab56f9f8d2843af))
17+
* implement remaining methods for LangChain callback handler ([cd6d303](https://github.com/openlayer-ai/openlayer-python/commit/cd6d30373859a432d91d36fcd56294906e9b52aa))
18+
* **openai-agents:** enhance OpenAI Agents tracing with structured span data extraction ([46d0852](https://github.com/openlayer-ai/openlayer-python/commit/46d08528ba036ace5fdf45a35f813c2494e1ae1f))
19+
20+
21+
### Bug Fixes
22+
23+
* **ci:** correct conditional ([f616411](https://github.com/openlayer-ai/openlayer-python/commit/f6164110ff27782f0df72c486d2c45c66f3a6cb5))
24+
* **ci:** release-doctor — report correct token name ([e42727c](https://github.com/openlayer-ai/openlayer-python/commit/e42727caf8c7ac350874d9195487da19df7f0081))
25+
* context list handling ([#474](https://github.com/openlayer-ai/openlayer-python/issues/474)) ([1ef1a1e](https://github.com/openlayer-ai/openlayer-python/commit/1ef1a1e917675646ec62275101d19e595ba6c2cf))
26+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([ab7ef6b](https://github.com/openlayer-ai/openlayer-python/commit/ab7ef6b12437afc6bc07b1839cdd5fb70d4c3628))
27+
* update pyarrow version ([f4feadf](https://github.com/openlayer-ai/openlayer-python/commit/f4feadfa95a07a71d79b6184795e79c44644947b))
28+
29+
30+
### Chores
31+
32+
* **ci:** change upload type ([49cdc9c](https://github.com/openlayer-ai/openlayer-python/commit/49cdc9c1c246051fcd78722eab8896fc3398a555))
33+
* **ci:** enable for pull requests ([07c86b5](https://github.com/openlayer-ai/openlayer-python/commit/07c86b5080d0c910e373b6f50b966ea56794e734))
34+
* **ci:** only run for pushes and fork pull requests ([fbf9c05](https://github.com/openlayer-ai/openlayer-python/commit/fbf9c05081172a447968c7c4ed011a364239ac7a))
35+
* **internal:** bump pinned h11 dep ([ddef8c8](https://github.com/openlayer-ai/openlayer-python/commit/ddef8c848fd1abb9a884b6fa0a42b5e9f2be0412))
36+
* **internal:** codegen related update ([f514ca3](https://github.com/openlayer-ai/openlayer-python/commit/f514ca32ebd1068d9b91b85d1788de560da14a08))
37+
* **internal:** update conftest.py ([af83c82](https://github.com/openlayer-ai/openlayer-python/commit/af83c828c31f99537e8b57074a325d0ec8dec13e))
38+
* **package:** mark python 3.13 as supported ([e663ce9](https://github.com/openlayer-ai/openlayer-python/commit/e663ce9a6b27739878efac099e0c253cc616190c))
39+
* **readme:** update badges ([2c30786](https://github.com/openlayer-ai/openlayer-python/commit/2c30786b6870f003f4c6c2a9f68136eff15d2ebf))
40+
* refactor LangChain callback handler ([858285d](https://github.com/openlayer-ai/openlayer-python/commit/858285dc4387088001a50ebde6c1cf34ffb5374c))
41+
* remove unused imports, break long lines, and formatting cleanup ([753c317](https://github.com/openlayer-ai/openlayer-python/commit/753c31705958f2c16ed27092e33f97aa87854230))
42+
* **tests:** add tests for httpx client instantiation & proxies ([55a2e38](https://github.com/openlayer-ai/openlayer-python/commit/55a2e38b32dd755ac27b36c7b1ebffe0ef41d3f2))
43+
* **tests:** skip some failing tests on the latest python versions ([ef12a3a](https://github.com/openlayer-ai/openlayer-python/commit/ef12a3a6487d67e0add70f168a5954fb49c0f47b))
44+
45+
46+
### Documentation
47+
48+
* **client:** fix httpx.Timeout documentation reference ([ad5d7c0](https://github.com/openlayer-ai/openlayer-python/commit/ad5d7c000f6ffb885d176192a98a740ff1251bd4))
49+
50+
51+
### Refactors
52+
53+
* **integrations:** update Openlayer integration imports ([ac78c1c](https://github.com/openlayer-ai/openlayer-python/commit/ac78c1c6c4dce5c6f822263ad9b168cd2d414c13))
54+
855
## 0.2.0-alpha.64 (2025-06-16)
956

1057
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)

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Openlayer Python API library
22

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

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

101101
Functionality between the synchronous and asynchronous clients is otherwise identical.
102102

103+
### With aiohttp
104+
105+
By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.
106+
107+
You can enable this by installing `aiohttp`:
108+
109+
```sh
110+
# install from PyPI
111+
pip install --pre openlayer[aiohttp]
112+
```
113+
114+
Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:
115+
116+
```python
117+
import os
118+
import asyncio
119+
from openlayer import DefaultAioHttpClient
120+
from openlayer import AsyncOpenlayer
121+
122+
123+
async def main() -> None:
124+
async with AsyncOpenlayer(
125+
api_key=os.environ.get("OPENLAYER_API_KEY"), # This is the default and can be omitted
126+
http_client=DefaultAioHttpClient(),
127+
) as client:
128+
response = await client.inference_pipelines.data.stream(
129+
inference_pipeline_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
130+
config={
131+
"input_variable_names": ["user_query"],
132+
"output_column_name": "output",
133+
"num_of_token_column_name": "tokens",
134+
"cost_column_name": "cost",
135+
"timestamp_column_name": "timestamp",
136+
},
137+
rows=[
138+
{
139+
"user_query": "what is the meaning of life?",
140+
"output": "42",
141+
"tokens": 7,
142+
"cost": 0.02,
143+
"timestamp": 1610000000,
144+
}
145+
],
146+
)
147+
print(response.success)
148+
149+
150+
asyncio.run(main())
151+
```
152+
103153
## Using types
104154

105155
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:
@@ -227,7 +277,7 @@ client.with_options(max_retries=5).inference_pipelines.data.stream(
227277
### Timeouts
228278

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

232282
```python
233283
from openlayer import Openlayer

bin/check-release-environment

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
errors=()
44

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

99
lenErrors=${#errors[@]}

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openlayer"
3-
version = "0.2.0-alpha.64"
3+
version = "0.2.0-alpha.65"
44
description = "The official Python library for the openlayer API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -30,6 +30,7 @@ classifiers = [
3030
"Programming Language :: Python :: 3.10",
3131
"Programming Language :: Python :: 3.11",
3232
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
3334
"Operating System :: OS Independent",
3435
"Operating System :: POSIX",
3536
"Operating System :: MacOS",
@@ -43,6 +44,8 @@ classifiers = [
4344
Homepage = "https://github.com/openlayer-ai/openlayer-python"
4445
Repository = "https://github.com/openlayer-ai/openlayer-python"
4546

47+
[project.optional-dependencies]
48+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]
4649

4750
[tool.rye]
4851
managed = true

requirements-dev.lock

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,24 @@
88
# with-sources: false
99

1010
-e file:.
11+
aiohappyeyeballs==2.6.1
12+
# via aiohttp
13+
aiohttp==3.12.13
14+
# via httpx-aiohttp
15+
# via openlayer
16+
aiosignal==1.3.2
17+
# via aiohttp
1118
annotated-types==0.6.0
1219
# via pydantic
1320
anyio==4.4.0
1421
# via httpx
1522
# via openlayer
1623
argcomplete==3.1.2
1724
# via nox
25+
async-timeout==5.0.1
26+
# via aiohttp
27+
attrs==25.3.0
28+
# via aiohttp
1829
certifi==2023.7.22
1930
# via httpcore
2031
# via httpx
@@ -35,24 +46,34 @@ execnet==2.1.1
3546
# via pytest-xdist
3647
filelock==3.12.4
3748
# via virtualenv
38-
h11==0.14.0
49+
frozenlist==1.7.0
50+
# via aiohttp
51+
# via aiosignal
52+
h11==0.16.0
3953
# via httpcore
40-
httpcore==1.0.2
54+
httpcore==1.0.9
4155
# via httpx
4256
httpx==0.28.1
57+
# via httpx-aiohttp
4358
# via openlayer
4459
# via respx
60+
httpx-aiohttp==0.1.8
61+
# via openlayer
4562
idna==3.4
4663
# via anyio
4764
# via httpx
4865
# via requests
66+
# via yarl
4967
importlib-metadata==7.0.0
5068
iniconfig==2.0.0
5169
# via pytest
5270
markdown-it-py==3.0.0
5371
# via rich
5472
mdurl==0.1.2
5573
# via markdown-it-py
74+
multidict==6.5.0
75+
# via aiohttp
76+
# via yarl
5677
mypy==1.14.1
5778
mypy-extensions==1.0.0
5879
# via mypy
@@ -73,6 +94,9 @@ platformdirs==3.11.0
7394
# via virtualenv
7495
pluggy==1.5.0
7596
# via pytest
97+
propcache==0.3.2
98+
# via aiohttp
99+
# via yarl
76100
pyarrow==15.0.2
77101
# via openlayer
78102
pydantic==2.10.3
@@ -117,6 +141,7 @@ tqdm==4.67.1
117141
# via openlayer
118142
typing-extensions==4.12.2
119143
# via anyio
144+
# via multidict
120145
# via mypy
121146
# via openlayer
122147
# via pydantic
@@ -128,5 +153,7 @@ urllib3==2.2.3
128153
# via requests
129154
virtualenv==20.24.5
130155
# via nox
156+
yarl==1.20.1
157+
# via aiohttp
131158
zipp==3.17.0
132159
# via importlib-metadata

requirements.lock

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@
88
# with-sources: false
99

1010
-e file:.
11+
aiohappyeyeballs==2.6.1
12+
# via aiohttp
13+
aiohttp==3.12.13
14+
# via httpx-aiohttp
15+
# via openlayer
16+
aiosignal==1.3.2
17+
# via aiohttp
1118
annotated-types==0.6.0
1219
# via pydantic
1320
anyio==4.4.0
1421
# via httpx
1522
# via openlayer
23+
async-timeout==5.0.1
24+
# via aiohttp
25+
attrs==25.3.0
26+
# via aiohttp
1627
certifi==2023.7.22
1728
# via httpcore
1829
# via httpx
@@ -23,22 +34,35 @@ distro==1.8.0
2334
# via openlayer
2435
exceptiongroup==1.2.2
2536
# via anyio
26-
h11==0.14.0
37+
frozenlist==1.7.0
38+
# via aiohttp
39+
# via aiosignal
40+
h11==0.16.0
2741
# via httpcore
28-
httpcore==1.0.2
42+
httpcore==1.0.9
2943
# via httpx
3044
httpx==0.28.1
45+
# via httpx-aiohttp
46+
# via openlayer
47+
httpx-aiohttp==0.1.8
3148
# via openlayer
3249
idna==3.4
3350
# via anyio
3451
# via httpx
3552
# via requests
53+
# via yarl
54+
multidict==6.5.0
55+
# via aiohttp
56+
# via yarl
3657
numpy==1.26.4
3758
# via openlayer
3859
# via pandas
3960
# via pyarrow
4061
pandas==2.2.2
4162
# via openlayer
63+
propcache==0.3.2
64+
# via aiohttp
65+
# via yarl
4266
pyarrow==15.0.2
4367
# via openlayer
4468
pydantic==2.10.3
@@ -64,10 +88,13 @@ tqdm==4.67.1
6488
# via openlayer
6589
typing-extensions==4.12.2
6690
# via anyio
91+
# via multidict
6792
# via openlayer
6893
# via pydantic
6994
# via pydantic-core
7095
tzdata==2024.1
7196
# via pandas
7297
urllib3==2.2.3
7398
# via requests
99+
yarl==1.20.1
100+
# via aiohttp

0 commit comments

Comments
 (0)