Skip to content

Commit 713a18b

Browse files
committed
vendoring openai 2.7.1
1 parent 1141e31 commit 713a18b

91 files changed

Lines changed: 2580 additions & 1507 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

portkey_ai/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@
155155
AsyncChatKitThreads,
156156
Calls,
157157
AsyncCalls,
158+
InputTokens,
159+
AsyncInputTokens,
158160
)
159161

160162
from portkey_ai.version import VERSION
@@ -329,4 +331,6 @@
329331
"AsyncChatKitThreads",
330332
"Calls",
331333
"AsyncCalls",
334+
"InputTokens",
335+
"AsyncInputTokens",
332336
]
File renamed without changes.

portkey_ai/_vendor/openai-2.2.0.dist-info/METADATA renamed to portkey_ai/_vendor/openai-2.7.1.dist-info/METADATA

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.3
22
Name: openai
3-
Version: 2.2.0
3+
Version: 2.7.1
44
Summary: The official Python library for the openai API
55
Project-URL: Homepage, https://github.com/openai/openai-python
66
Project-URL: Repository, https://github.com/openai/openai-python
@@ -25,14 +25,14 @@ Requires-Python: >=3.8
2525
Requires-Dist: anyio<5,>=3.5.0
2626
Requires-Dist: distro<2,>=1.7.0
2727
Requires-Dist: httpx<1,>=0.23.0
28-
Requires-Dist: jiter<1,>=0.4.0
28+
Requires-Dist: jiter<1,>=0.10.0
2929
Requires-Dist: pydantic<3,>=1.9.0
3030
Requires-Dist: sniffio
3131
Requires-Dist: tqdm>4
3232
Requires-Dist: typing-extensions<5,>=4.11
3333
Provides-Extra: aiohttp
3434
Requires-Dist: aiohttp; extra == 'aiohttp'
35-
Requires-Dist: httpx-aiohttp>=0.1.8; extra == 'aiohttp'
35+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
3636
Provides-Extra: datalib
3737
Requires-Dist: numpy>=1; extra == 'datalib'
3838
Requires-Dist: pandas-stubs>=1.1.0.11; extra == 'datalib'
@@ -290,7 +290,9 @@ async def main():
290290
client = AsyncOpenAI()
291291

292292
async with client.realtime.connect(model="gpt-realtime") as connection:
293-
await connection.session.update(session={'modalities': ['text']})
293+
await connection.session.update(
294+
session={"type": "realtime", "output_modalities": ["text"]}
295+
)
294296

295297
await connection.conversation.item.create(
296298
item={
@@ -302,10 +304,10 @@ async def main():
302304
await connection.response.create()
303305

304306
async for event in connection:
305-
if event.type == 'response.text.delta':
307+
if event.type == "response.output_text.delta":
306308
print(event.delta, flush=True, end="")
307309

308-
elif event.type == 'response.text.done':
310+
elif event.type == "response.output_text.done":
309311
print()
310312

311313
elif event.type == "response.done":

portkey_ai/_vendor/openai-2.2.0.dist-info/RECORD renamed to portkey_ai/_vendor/openai-2.7.1.dist-info/RECORD

Lines changed: 1057 additions & 1053 deletions
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

portkey_ai/_vendor/openai-2.2.0.dist-info/entry_points.txt renamed to portkey_ai/_vendor/openai-2.7.1.dist-info/entry_points.txt

File renamed without changes.

portkey_ai/_vendor/openai-2.2.0.dist-info/licenses/LICENSE renamed to portkey_ai/_vendor/openai-2.7.1.dist-info/licenses/LICENSE

File renamed without changes.

portkey_ai/_vendor/openai/_streaming.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,8 @@ def __stream__(self) -> Iterator[_T]:
9696

9797
yield process_data(data=data, cast_to=cast_to, response=response)
9898

99-
# Ensure the entire stream is consumed
100-
for _sse in iterator:
101-
...
99+
# As we might not fully consume the response stream, we need to close it explicitly
100+
response.close()
102101

103102
def __enter__(self) -> Self:
104103
return self
@@ -198,9 +197,8 @@ async def __stream__(self) -> AsyncIterator[_T]:
198197

199198
yield process_data(data=data, cast_to=cast_to, response=response)
200199

201-
# Ensure the entire stream is consumed
202-
async for _sse in iterator:
203-
...
200+
# As we might not fully consume the response stream, we need to close it explicitly
201+
await response.aclose()
204202

205203
async def __aenter__(self) -> Self:
206204
return self

portkey_ai/_vendor/openai/_utils/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
137137
# Type safe methods for narrowing types with TypeVars.
138138
# The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
139139
# however this cause Pyright to rightfully report errors. As we know we don't
140-
# care about the contained types we can safely use `object` in it's place.
140+
# care about the contained types we can safely use `object` in its place.
141141
#
142142
# There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
143143
# `is_*` is for when you're dealing with an unknown input

0 commit comments

Comments
 (0)