mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-13 07:04:51 -06:00
fix: Use inspect.cleandoc on function docstrings in generate_function_declaration.
This creates proper indent of the doc. PiperOrigin-RevId: 766285907
This commit is contained in:
parent
11b504c808
commit
f7cb66620b
@ -46,14 +46,14 @@ class FunctionTool(BaseTool):
|
||||
|
||||
# Get documentation (prioritize direct __doc__ if available)
|
||||
if hasattr(func, '__doc__') and func.__doc__:
|
||||
doc = func.__doc__
|
||||
doc = inspect.cleandoc(func.__doc__)
|
||||
elif (
|
||||
hasattr(func, '__call__')
|
||||
and hasattr(func.__call__, '__doc__')
|
||||
and func.__call__.__doc__
|
||||
):
|
||||
# For callable objects, try to get docstring from __call__ method
|
||||
doc = func.__call__.__doc__
|
||||
doc = inspect.cleandoc(func.__call__.__doc__)
|
||||
|
||||
super().__init__(name=name, description=doc)
|
||||
self.func = func
|
||||
|
Loading…
Reference in New Issue
Block a user