From 6d6651acbe752a4df03e93b3d33f8682ac4dfbc0 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sat, 18 Oct 2025 13:10:09 +0800 Subject: [PATCH] fix: max_tokens as string should not work --- routstr/proxy.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routstr/proxy.py b/routstr/proxy.py index 89660837..38b8fc45 100644 --- a/routstr/proxy.py +++ b/routstr/proxy.py @@ -636,6 +636,12 @@ async def proxy( if request_body: try: request_body_dict = json.loads(request_body) + + if "max_tokens" in request_body_dict: + raise HTTPException( + status_code=400, + detail={"error": "max_tokens must be an integer (without quotes)"}, + ) logger.debug( "Request body parsed", extra={