mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-13 15:14:50 -06:00
Add handling for None param.annotation.
This is the case for function tools that have no return value. PiperOrigin-RevId: 763306054
This commit is contained in:
parent
74a331f1fb
commit
55cb36edfe
@ -289,6 +289,13 @@ def _parse_schema_from_parameter(
|
||||
)
|
||||
_raise_if_schema_unsupported(variant, schema)
|
||||
return schema
|
||||
if param.annotation is None:
|
||||
# https://swagger.io/docs/specification/v3_0/data-models/data-types/#null
|
||||
# null is not a valid type in schema, use object instead.
|
||||
schema.type = types.Type.OBJECT
|
||||
schema.nullable = True
|
||||
_raise_if_schema_unsupported(variant, schema)
|
||||
return schema
|
||||
raise ValueError(
|
||||
f'Failed to parse the parameter {param} of function {func_name} for'
|
||||
' automatic function calling. Automatic function calling works best with'
|
||||
|
Loading…
Reference in New Issue
Block a user