Repository navigation
Commit 26360d5
committed
Allow openai 3.x in llama-index-llms-openai
The `openai<3` cap was added in 0.7.0 (March 2026), five months before
openai 3.0.0 shipped, so it was a routine next-major cap rather than a
reaction to a known incompatibility. openai 3.x has been out since
August 2026 and the package still works against it.
Testing against openai 3.7.0 with the cap removed:
* The full package suite passes on both openai 2.54.0 and 3.7.0,
including the API-backed tests, which cover streaming, async
streaming, structured prediction, built-in tools and file upload.
* All type and client import paths the package uses still resolve, and
no parameter it passes has been removed.
* openai 3.0.0's one documented breaking change is the move to HTTPX2.
The package never constructs a transport itself, it only forwards an
optional `http_client`, and openai 3 accepts both client families.
Requests, including streaming, succeed either way.
One test needed updating. `ResponseOutputTextAnnotationAddedEvent.annotation`
was typed as a bare `object` in openai 2 and is a discriminated union in
openai 3, so the fixture's placeholder payload no longer validates. It
now uses a real annotation and normalises the stored value, which works
on both majors. No library code required changes.
Claude-Session: https://claude.ai/code/session_01YDFeREeB9bZQ3aeuKfJses1 parent 56beedf commit 26360d5
2 files changed
Lines changed: 16 additions & 6 deletions
File tree
- llama-index-integrations/llms/llama-index-llms-openai
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
296 | 302 | | |
297 | 303 | | |
298 | 304 | | |
| |||
307 | 313 | | |
308 | 314 | | |
309 | 315 | | |
310 | | - | |
311 | | - | |
312 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
313 | 323 | | |
314 | 324 | | |
315 | 325 | | |
| |||
0 commit comments