Skip to content

Commit f36b618

Browse files
committed
chore: Improve docstring
1 parent bd7ecc3 commit f36b618

File tree

1 file changed

+5
-0
lines changed
  • packages/toolbox-core/src/toolbox_core

1 file changed

+5
-0
lines changed

packages/toolbox-core/src/toolbox_core/tool.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,13 +335,18 @@ async def resolve_value(
335335
"""
336336
Asynchronously or synchronously resolves a given source to its value.
337337
338+
If the `source` is a coroutine function, it will be awaited.
339+
If the `source` is a regular callable, it will be called.
340+
Otherwise (if it's not a callable), the `source` itself is returned directly.
341+
338342
Args:
339343
source: The value, a callable returning a value, or a callable
340344
returning an awaitable value.
341345
342346
Returns:
343347
The resolved value.
344348
"""
349+
345350
if asyncio.iscoroutinefunction(source):
346351
return await source()
347352
elif callable(source):

0 commit comments

Comments
 (0)