fix: context window overflow patch (#2053)

This commit is contained in:
Charles Packer
2024-11-18 15:21:11 -08:00
committed by GitHub
parent f57dc28552
commit a75dfd7907
6 changed files with 85 additions and 4 deletions

View File

@@ -1584,7 +1584,8 @@ class Agent(BaseAgent):
def count_tokens(self) -> int:
"""Count the tokens in the current context window"""
return self.get_context_window().context_window_size_current
context_window_breakdown = self.get_context_window()
return context_window_breakdown.context_window_size_current
def save_agent(agent: Agent, ms: MetadataStore):