Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yiranwu0 committed Nov 17, 2024
1 parent 15b565a commit 6024f29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/agentchat/test_function_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_number():

user = UserProxyAgent("user", function_map={"get_number": get_number})
func_call = {"name": "get_number", "arguments": "{}"}
assert user.execute_function(func_call)[1]["content"] == "42"
assert user.execute_function(func_call)[1]["content"] == 42

# 4. test with a non-existent function
user = UserProxyAgent(name="test", function_map={})
Expand Down Expand Up @@ -185,9 +185,9 @@ async def add_num(num_to_be_added):
correct_args = {"name": "add_num", "arguments": '{ "num_to_be_added": 5 }'}

# Asset coroutine doesn't match.
assert user.execute_function(func_call=correct_args)[1]["content"] != "15"
assert user.execute_function(func_call=correct_args)[1]["content"] != 15
# Asset awaited coroutine does match.
assert (await user.a_execute_function(func_call=correct_args))[1]["content"] == "15"
assert (await user.a_execute_function(func_call=correct_args))[1]["content"] == 15

# function name called is wrong or doesn't exist
wrong_func_name = {"name": "subtract_num", "arguments": '{ "num_to_be_added": 5 }'}
Expand Down

0 comments on commit 6024f29

Please sign in to comment.