|
@@ -215,9 +215,17 @@ class ThreadRunner:
|
|
|
self.event_handler.pub_run_step_created(new_run_step)
|
|
|
self.event_handler.pub_run_step_in_progress(new_run_step)
|
|
|
|
|
|
- internal_tool_calls = list(
|
|
|
- filter(lambda _tool_calls: _tool_calls[0] is not None, tool_calls)
|
|
|
- )
|
|
|
+ # internal_tool_calls = list(
|
|
|
+ # filter(lambda _tool_calls: _tool_calls[0] is not None, tool_calls)
|
|
|
+ # )
|
|
|
+ seen = set()
|
|
|
+ internal_tool_calls = []
|
|
|
+ for _tool_call in tool_calls:
|
|
|
+ tool_obj = _tool_call[0]
|
|
|
+ if tool_obj is not None and tool_obj not in seen:
|
|
|
+ seen.add(tool_obj)
|
|
|
+ internal_tool_calls.append(_tool_call)
|
|
|
+
|
|
|
external_tool_call_dict = [
|
|
|
tool_call_dict for tool, tool_call_dict in tool_calls if tool is None
|
|
|
]
|