-
Notifications
You must be signed in to change notification settings - Fork 493
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Got the following error when testing the deepresearch agent,
Traceback (most recent call last):
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/research.py", line 52, in <module>
agent = DeepResearchAgent(
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/autogen/agents/experimental/deep_research/deep_research.py", line 44, in __init__
self.tool = DeepResearchTool(
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/autogen/tools/experimental/deep_research/deep_research.py", line 157, in __init__
super().__init__(
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/autogen/tools/tool.py", line 51, in __init__
self._chat_context_param_names = get_context_params(func_or_tool, subclass=ChatContext)
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/autogen/tools/dependency_injection.py", line 116, in get_context_params
return [p.name for p in sig.parameters.values() if _is_context_param(p, subclass=subclass)]
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/autogen/tools/dependency_injection.py", line 116, in <listcomp>
return [p.name for p in sig.parameters.values() if _is_context_param(p, subclass=subclass)]
File "/Users/qingyunwu/Documents/github/ag2ai/ag2/autogen/tools/dependency_injection.py", line 137, in _is_context_param
return isinstance(param_annotation, type) and issubclass(param_annotation, subclass)
File "/Users/qingyunwu/miniconda3/envs/ag2/lib/python3.10/abc.py", line 123, in __subclasscheck__
return _abc_subclasscheck(cls, subclass)
TypeError: issubclass() arg 1 must be a classI hacked a workaround by replacing this line of code with the following, but not sure if this is the right approach.
if not isinstance(param.annotation, type):
return False
try:
result = issubclass(param, subclass)
return result
except Exception as e:
return FalseSteps to reproduce
No response
Model Used
No response
Expected Behavior
No response
Screenshots and logs
No response
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done