Skip to content

Commit

Permalink
Ignore large tool results when condensing message history
Browse files Browse the repository at this point in the history
  • Loading branch information
smathot committed Jul 26, 2024
1 parent 543fc99 commit 7dc8a90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sigmund/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""AI-based chatbot that provides sensible answers based on documentation"""

__version__ = '0.24.4'
__version__ = '0.24.5'
3 changes: 3 additions & 0 deletions sigmund/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def _condense_message_history(self):
condense_messages = []
while condense_length < config.condense_chunk_length:
role, content = self._condensed_message_history.pop(0)
if role == 'tool' and \
len(content) > config.large_tool_result_length:
continue
condense_length += len(content)
condense_messages.insert(0, (role, content))
logger.info(f'condensing {len(condense_messages)} messages')
Expand Down

0 comments on commit 7dc8a90

Please sign in to comment.