Commit
·
9d31b94
1
Parent(s):
6c81140
Fix IndentationError at line 378: correct indentation in _truncate_to_tokens method
Browse files- src/llm_router.py +3 -3
src/llm_router.py
CHANGED
|
@@ -375,7 +375,7 @@ class LLMRouter:
|
|
| 375 |
def _truncate_to_tokens(self, content: str, max_tokens: int) -> str:
|
| 376 |
"""Truncate content to fit within token limit"""
|
| 377 |
# Simple character-based truncation (1 token ≈ 4 chars)
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
return content[:max_chars - 3] + "..."
|
|
|
|
| 375 |
def _truncate_to_tokens(self, content: str, max_tokens: int) -> str:
|
| 376 |
"""Truncate content to fit within token limit"""
|
| 377 |
# Simple character-based truncation (1 token ≈ 4 chars)
|
| 378 |
+
max_chars = max_tokens * 4
|
| 379 |
+
if len(content) <= max_chars:
|
| 380 |
+
return content
|
| 381 |
return content[:max_chars - 3] + "..."
|