Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions google/genai/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,10 @@ class BaseModel(pydantic.BaseModel):
ser_json_bytes='base64',
val_json_bytes='base64',
ignored_types=(typing.TypeVar,),
# Most of the ~770 models defined in `types` are never used by any single
# application, so build each model's validator and serializer the first time
# the model is actually used rather than when `google.genai` is imported.
defer_build=True,
)

@pydantic.model_validator(mode='before')
Expand Down