chore(internal): codegen related update

This commit is contained in:
stainless-app[bot] 2025-11-28 03:09:11 +00:00
parent 2f2c394c71
commit 9022bea168
4 changed files with 20 additions and 16 deletions

View file

@ -46,7 +46,7 @@ managed = true
# version pins are in requirements-dev.lock # version pins are in requirements-dev.lock
dev-dependencies = [ dev-dependencies = [
"pyright==1.1.399", "pyright==1.1.399",
"mypy", "mypy==1.17",
"respx", "respx",
"pytest", "pytest",
"pytest-asyncio", "pytest-asyncio",

View file

@ -72,7 +72,7 @@ mdurl==0.1.2
multidict==6.4.4 multidict==6.4.4
# via aiohttp # via aiohttp
# via yarl # via yarl
mypy==1.14.1 mypy==1.17.0
mypy-extensions==1.0.0 mypy-extensions==1.0.0
# via mypy # via mypy
nodeenv==1.8.0 nodeenv==1.8.0
@ -81,6 +81,8 @@ nox==2023.4.22
packaging==23.2 packaging==23.2
# via nox # via nox
# via pytest # via pytest
pathspec==0.12.1
# via mypy
platformdirs==3.11.0 platformdirs==3.11.0
# via virtualenv # via virtualenv
pluggy==1.5.0 pluggy==1.5.0

View file

@ -55,21 +55,21 @@ multidict==6.4.4
propcache==0.3.1 propcache==0.3.1
# via aiohttp # via aiohttp
# via yarl # via yarl
pydantic==2.11.9 pydantic==2.12.5
# via opencode-ai # via opencode-ai
pydantic-core==2.33.2 pydantic-core==2.41.5
# via pydantic # via pydantic
sniffio==1.3.0 sniffio==1.3.0
# via anyio # via anyio
# via opencode-ai # via opencode-ai
typing-extensions==4.12.2 typing-extensions==4.15.0
# via anyio # via anyio
# via multidict # via multidict
# via opencode-ai # via opencode-ai
# via pydantic # via pydantic
# via pydantic-core # via pydantic-core
# via typing-inspection # via typing-inspection
typing-inspection==0.4.1 typing-inspection==0.4.2
# via pydantic # via pydantic
yarl==1.20.0 yarl==1.20.0
# via aiohttp # via aiohttp

View file

@ -54,11 +54,12 @@ class Stream(Generic[_T]):
process_data = self._client._process_response_data process_data = self._client._process_response_data
iterator = self._iter_events() iterator = self._iter_events()
for sse in iterator: try:
yield process_data(data=sse.json(), cast_to=cast_to, response=response) for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
# As we might not fully consume the response stream, we need to close it explicitly finally:
response.close() # Ensure the response is closed even if the consumer doesn't read all data
response.close()
def __enter__(self) -> Self: def __enter__(self) -> Self:
return self return self
@ -117,11 +118,12 @@ class AsyncStream(Generic[_T]):
process_data = self._client._process_response_data process_data = self._client._process_response_data
iterator = self._iter_events() iterator = self._iter_events()
async for sse in iterator: try:
yield process_data(data=sse.json(), cast_to=cast_to, response=response) async for sse in iterator:
yield process_data(data=sse.json(), cast_to=cast_to, response=response)
# As we might not fully consume the response stream, we need to close it explicitly finally:
await response.aclose() # Ensure the response is closed even if the consumer doesn't read all data
await response.aclose()
async def __aenter__(self) -> Self: async def __aenter__(self) -> Self:
return self return self