Skip to content

Commit

Permalink
Fixed types in token handler (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik authored Feb 9, 2025
1 parent 089520d commit ef63fca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ols/utils/token_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,10 @@ def truncate_rag_context(

def limit_conversation_history(
self, history: list[BaseMessage], model: str, limit: int = 0
) -> tuple[list[str], bool]:
) -> tuple[list[BaseMessage], bool]:
"""Limit conversation history to specified number of tokens."""
total_length = 0
formatted_history: list[str] = []
formatted_history: list[BaseMessage] = []

for original_message in reversed(history):
# Restructure messages as per model
Expand Down

0 comments on commit ef63fca

Please sign in to comment.