Fix ChunkTokenLimitExceededError message formatting
- Prevent passes two separate string objects to __init__ - Maintain same error output
This commit is contained in:
parent
f988a22652
commit
6fea68bff9
1 changed files with 2 additions and 1 deletions
|
|
@ -118,10 +118,11 @@ class ChunkTokenLimitExceededError(ValueError):
|
|||
preview = chunk_preview.strip() if chunk_preview else None
|
||||
truncated_preview = preview[:80] if preview else None
|
||||
preview_note = f" Preview: '{truncated_preview}'" if truncated_preview else ""
|
||||
super().__init__(
|
||||
message = (
|
||||
f"Chunk token length {chunk_tokens} exceeds chunk_token_size {chunk_token_limit}."
|
||||
f"{preview_note}"
|
||||
)
|
||||
super().__init__(message)
|
||||
self.chunk_tokens = chunk_tokens
|
||||
self.chunk_token_limit = chunk_token_limit
|
||||
self.chunk_preview = truncated_preview
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue