BaseContextCreator
.
This class provides a strategy to generate a conversational context from
a list of chat history records while ensuring the total token count of
the context does not exceed a specified limit. It prunes messages based
on their score if the total token count exceeds the limit.
Parameters:
tool_call_id
.
This improved logic robustly gathers all messages (assistant requests
and tool responses, including chunks) that share a tool_call_id
.
Parameters:
tool_call_id
to a
list of related units.
_ContextUnit
, if valid; otherwise,
None
._ContextUnit
representing a conversation record.