Skip to content

Commit

Permalink
fix(agent): provide result for non-existing tool calls (#48) (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgaroche authored Feb 26, 2025
1 parent 9e8b37c commit 17c163a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__
4 changes: 3 additions & 1 deletion libertai_agents/libertai_agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ def __execute_tool_calls(
function_name = call.function.name
tool = find(lambda x: x.name == function_name, self.tools)
if tool is None:
# TODO: handle error
future = asyncio.Future()
future.set_result(None)
executed_calls.append(future)
continue

function_to_call = tool.function
Expand Down

0 comments on commit 17c163a

Please sign in to comment.