[Feature Request]: Handle Tool Calls and Responses in Context Handling
Is your feature request related to a problem? Please describe.
Current implementation of TransformChatHistory does not handle tool calls and responses.
Describe the solution you'd like
No response
Additional context
No response
@dkirsche would be fun to add this feature! I'll submit a PR soon for review unless you'd like to take a stab!
@WaelKarkoub you maybe interested in this issue as well. Can #1923 address this?
@gagb I'm not fully familiar with how tool calls and responses are treated, but the PR should handle that case as well (I hope I'm not overconfident :) ). You have to implement the logic as a MessageTransform to handle the logic (which I don't have an example implemented). Something that comes to mind is maybe you want to drop all tool responses:
class DropToolResponses:
def apply_transform(self, messages: List[Dict]) -> List[Dict]:
return [message for message in messages if "tool_responses" not in message]
Same thing with truncating tool responses, just need to have MessageTransform for that use case
Strongly approve that :) It would be way easier to use AutoGen with that feature.
@clemlesne you maybe interested in PR #1923
Just so I have a better understanding, the idea is to include tool calls and responses in the token count when we are truncating?