make_remove_function

make_remove_function(tool_msgs_to_remove: list[str]) -> Callable[[list[dict[str, Any]]], list[dict[str, Any]]]

Create a function to remove messages with tool calls from the messages list.
The returned function can be registered as a hook to “process_all_messages_before_reply"" to remove messages with tool calls.

Parameters:
NameDescription
tool_msgs_to_removeType: list[str]