We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e582072 commit 3814b7eCopy full SHA for 3814b7e
python/packages/autogen-core/src/autogen_core/tools/_function_tool.py
@@ -1,6 +1,7 @@
1
import asyncio
2
import functools
3
import warnings
4
+import typing
5
from textwrap import dedent
6
from typing import Any, Callable, Sequence
7
@@ -87,6 +88,12 @@ def __init__(
87
88
) -> None:
89
self._func = func
90
self._global_imports = global_imports
91
+
92
+ # Validate type hints exist
93
+ hints = typing.get_type_hints(func)
94
+ if not hints:
95
+ raise TypeError(f"Function '{func.__name__}' has no type hints. All parameters must be annotated.")
96
97
signature = get_typed_signature(func)
98
func_name = name or func.__name__
99
args_model = args_base_model_from_signature(func_name + "args", signature)
0 commit comments