File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ from google.genai import types
249
249
250
250
def get_auth_request_function_call (event : Event) -> types.FunctionCall:
251
251
# Get the special auth request function call from the event
252
- if not event.content or event.content.parts:
252
+ if not event.content or not event.content.parts:
253
253
return
254
254
for part in event.content.parts:
255
255
if (
@@ -264,9 +264,11 @@ def get_auth_request_function_call(event: Event) -> types.FunctionCall:
264
264
265
265
def get_auth_config (auth_request_function_call : types.FunctionCall) -> AuthConfig:
266
266
# Extracts the AuthConfig object from the arguments of the auth request function call
267
- if not auth_request_function_call.args or not (auth_config := auth_request_function_call.args.get(' auth_config ' )):
267
+ if not auth_request_function_call.args or not (auth_config := auth_request_function_call.args.get(' authConfig ' )):
268
268
raise ValueError (f ' Cannot get auth config from function call: { auth_request_function_call} ' )
269
- if not isinstance (auth_config, AuthConfig):
269
+ if isinstance (auth_config, dict ):
270
+ auth_config = AuthConfig.model_validate(auth_config)
271
+ elif not isinstance (auth_config, AuthConfig):
270
272
raise ValueError (f ' Cannot get auth config { auth_config} is not an instance of AuthConfig. ' )
271
273
return auth_config
272
274
```
Original file line number Diff line number Diff line change @@ -78740,7 +78740,7 @@ from google.genai import types
78740
78740
78741
78741
def get_auth_request_function_call(event: Event) -> types.FunctionCall:
78742
78742
# Get the special auth request function call from the event
78743
- if not event.content or event.content.parts:
78743
+ if not event.content or not event.content.parts:
78744
78744
return
78745
78745
for part in event.content.parts:
78746
78746
if (
@@ -78755,9 +78755,11 @@ def get_auth_request_function_call(event: Event) -> types.FunctionCall:
78755
78755
78756
78756
def get_auth_config(auth_request_function_call: types.FunctionCall) -> AuthConfig:
78757
78757
# Extracts the AuthConfig object from the arguments of the auth request function call
78758
- if not auth_request_function_call.args or not (auth_config := auth_request_function_call.args.get('auth_config ')):
78758
+ if not auth_request_function_call.args or not (auth_config := auth_request_function_call.args.get('authConfig ')):
78759
78759
raise ValueError(f'Cannot get auth config from function call: {auth_request_function_call}')
78760
- if not isinstance(auth_config, AuthConfig):
78760
+ if isinstance(auth_config, dict):
78761
+ auth_config = AuthConfig.model_validate(auth_config)
78762
+ elif not isinstance(auth_config, AuthConfig):
78761
78763
raise ValueError(f'Cannot get auth config {auth_config} is not an instance of AuthConfig.')
78762
78764
return auth_config
78763
78765
You can’t perform that action at this time.
0 commit comments