Skip to content

Commit fc1cb3b

Browse files
committed
Fix mypy no-any-return errors in client.py
1 parent 668e470 commit fc1cb3b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/otari/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,12 @@ async def response(
270270
params: dict[str, Any] = {"model": model, "input": input, **kwargs}
271271
if stream is not None:
272272
params["stream"] = stream
273-
return await self.openai.responses.create(**params)
273+
result: Response | AsyncStream[ResponseStreamEvent] = await self.openai.responses.create(**params)
274274
except Exception as exc:
275275
self._handle_error(exc)
276276
raise
277+
else:
278+
return result
277279

278280
# -- Embeddings ---------------------------------------------------------
279281

@@ -532,7 +534,8 @@ async def _batch_request(
532534
if not response.is_success:
533535
await self._handle_batch_error(response)
534536

535-
return response.json()
537+
result: dict[str, Any] = response.json()
538+
return result
536539

537540
async def _handle_batch_error(self, response: httpx.Response) -> None:
538541
"""Map batch HTTP errors to typed SDK errors."""

0 commit comments

Comments
 (0)