Skip to content

Commit

Permalink
[Bug fix]: Fix tool registration from a Tool (#835)
Browse files Browse the repository at this point in the history
* add register_function when registering for llm

Signed-off-by: Mark Sze <[email protected]>

* Handle Tool having _name and not __name__

Signed-off-by: Mark Sze <[email protected]>

* Update conversable_agent.py

---------

Signed-off-by: Mark Sze <[email protected]>
  • Loading branch information
marklysze authored Feb 6, 2025
1 parent cfc1e68 commit 84cf10d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autogen/agentchat/conversable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def _add_single_function(self, func: Callable, name: Optional[str] = None, descr
"""
if name:
func._name = name
else:
elif not hasattr(func, "_name"):
func._name = func.__name__

if description:
Expand Down

0 comments on commit 84cf10d

Please sign in to comment.