File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929import os
3030import sys
3131import traceback
32+ import warnings
3233from typing import Any
3334
35+ # stdout MUST be pure JSON — route every warning to stderr so a stray
36+ # pandas/pyarrow DeprecationWarning can't corrupt the response.
37+ warnings .simplefilter ("ignore" )
38+ warnings .showwarning = lambda * a , ** kw : None
39+
3440# Hard caps — these protect the LLM context window
3541MAX_ROWS_PER_CALL = 200
3642MAX_TEXT_CHARS_PER_CALL = 8000
Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ public static void MapUploadEndpoints(this IEndpointRouteBuilder app)
7676 }
7777
7878 return Results . Ok ( new { files = results } ) ;
79- } ) . DisableAntiforgery ( ) ;
79+ } )
80+ . DisableAntiforgery ( )
81+ . WithMetadata ( new Microsoft . AspNetCore . Mvc . RequestSizeLimitAttribute ( MaxBytes + 10L * 1024 * 1024 ) ) ; // file cap + multipart overhead
8082
8183 app . MapGet ( "/api/uploads" , ( HttpContext ctx ) =>
8284 {
You can’t perform that action at this time.
0 commit comments