Skip to content

Commit 94768e0

Browse files
committed
improve typing
1 parent 68f4770 commit 94768e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pydantic_ai_slim/pydantic_ai/models/google.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,11 @@ async def _generate_content(
398398
return await func(model=self._model_name, contents=contents, config=config) # type: ignore
399399
except errors.APIError as e:
400400
if (status_code := e.code) >= 400:
401-
raise ModelHTTPError(status_code=status_code, model_name=self._model_name, body=e.details) from e # pyright: ignore[reportUnknownArgumentType, reportUnknownMemberType]
401+
raise ModelHTTPError(
402+
status_code=status_code,
403+
model_name=self._model_name,
404+
body=cast(Any, e.details), # pyright: ignore[reportUnknownMemberType]
405+
) from e
402406
raise # pragma: lax no cover
403407

404408
async def _build_content_and_config(

0 commit comments

Comments
 (0)