@@ -281,8 +281,8 @@ def add_auth_token_getters(
281
281
auth_token_getters : Mapping [str , Callable [[], str ]],
282
282
) -> "ToolboxTool" :
283
283
"""
284
- Registers an auth token getter function that is used for AuthServices when tools
285
- are invoked.
284
+ Registers auth token getter functions that are used for AuthServices
285
+ when tools are invoked.
286
286
287
287
Args:
288
288
auth_token_getters: A mapping of authentication service names to
@@ -292,9 +292,9 @@ def add_auth_token_getters(
292
292
A new ToolboxTool instance with the specified authentication token
293
293
getters registered.
294
294
295
- Raises
296
- ValueError: If the auth source has already been registered either
297
- to the tool or to the corresponding client.
295
+ Raises:
296
+ ValueError: If an auth source has already been registered either to
297
+ the tool or to the corresponding client.
298
298
"""
299
299
300
300
# throw an error if the authentication source is already registered
@@ -350,7 +350,7 @@ def add_auth_token_getter(
350
350
self , auth_source : str , get_id_token : Callable [[], str ]
351
351
) -> "ToolboxTool" :
352
352
"""
353
- Registers auth token getter functions that are used for AuthServices
353
+ Registers an auth token getter function that is used for AuthServices
354
354
when tools are invoked.
355
355
356
356
Args:
@@ -359,11 +359,11 @@ def add_auth_token_getter(
359
359
360
360
Returns:
361
361
A new ToolboxTool instance with the specified authentication token
362
- getters registered.
362
+ getter registered.
363
363
364
- Raises
365
- ValueError: If the auth source has already been registered either
366
- to the tool or to the corresponding client.
364
+ Raises:
365
+ ValueError: If the auth source has already been registered either to
366
+ the tool or to the corresponding client.
367
367
368
368
"""
369
369
return self .add_auth_token_getters ({auth_source : get_id_token })
@@ -380,6 +380,11 @@ def bind_params(
380
380
381
381
Returns:
382
382
A new ToolboxTool instance with the specified parameters bound.
383
+
384
+ Raises:
385
+ ValueError: If a parameter is already bound or is not defined by the
386
+ tool's definition.
387
+
383
388
"""
384
389
param_names = set (p .name for p in self .__params )
385
390
for name in bound_params .keys ():
@@ -411,14 +416,19 @@ def bind_param(
411
416
param_value : Union [Callable [[], Any ], Any ],
412
417
) -> "ToolboxTool" :
413
418
"""
414
- Binds a parameter to the value or callables that produce it .
419
+ Binds a parameter to the value or callable that produce the value .
415
420
416
421
Args:
417
422
param_name: The name of the bound parameter.
418
423
param_value: The value of the bound parameter, or a callable that
419
424
returns the value.
420
425
421
426
Returns:
422
- A new ToolboxTool instance with the specified parameters bound.
427
+ A new ToolboxTool instance with the specified parameter bound.
428
+
429
+ Raises:
430
+ ValueError: If the parameter is already bound or is not defined by
431
+ the tool's definition.
432
+
423
433
"""
424
434
return self .bind_params ({param_name : param_value })
0 commit comments