Skip to content

Commit f434d25

Browse files
DeanChensjcopybara-github
authored andcommitted
chore: Change Pydantic model config to ignore extra fields in Event
Update the `model_config` for `Event` to set `extra='ignore'`. This allows the `Event` model to be initialized with fields not explicitly defined in the model, preventing errors when deserializing data that may contain additional, unneeded fields. This allows the session service to accept 2.0 events. Co-authored-by: Shangjie Chen <deanchen@google.com> PiperOrigin-RevId: 889327445
1 parent 2a90fbc commit f434d25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/google/adk/events/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Event(LlmResponse):
3636
"""
3737

3838
model_config = ConfigDict(
39-
extra='forbid',
39+
extra='ignore',
4040
ser_json_bytes='base64',
4141
val_json_bytes='base64',
4242
alias_generator=alias_generators.to_camel,

0 commit comments

Comments
 (0)