Skip to content

Commit 1731816

Browse files
committed
🔧 Enhance error handling in ModelRequestHandler to include message length validation
1 parent d44cc7b commit 1731816

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎main.py

+2
Original file line numberDiff line numberDiff line change
@@ -1212,6 +1212,8 @@ async def request_model(self, request: Union[RequestModel, ImageGenerationReques
12121212
status_code = 413
12131213
if "must be less than max_seq_len" in error_message:
12141214
status_code = 413
1215+
if "Please reduce the length of the messages or completion" in error_message:
1216+
status_code = 413
12151217

12161218
logger.error(f"Error {status_code} with provider {channel_id} API key: {current_api}: {error_message}")
12171219
if is_debug:

0 commit comments

Comments
 (0)