refactor filter pipeline: introduce ResolvedFilterChain and FilterPipeline types

- Replace 4 separate filter params with single Arc<FilterPipeline> in llm_chat
- Add ResolvedFilterChain (filter_ids + agents) and FilterPipeline (input + output)
- Rename utils.rs to streaming.rs, extract STREAM_BUFFER_SIZE constant
- Deduplicate output filter logic via Box<dyn StreamProcessor>
- Rename upstream_path param to request_path for consistency

Made-with: Cursor
This commit is contained in:
Adil Hafeez 2026-03-18 16:47:16 -07:00
parent 15c6ce7d64
commit 1605d2caa6
7 changed files with 119 additions and 126 deletions

View file

@ -118,7 +118,7 @@ async def deanonymize(path: str, request: Request) -> Response:
body_str = raw_body.decode("utf-8", errors="replace")
if "data: " in body_str:
if "data: " in body_str or "event: " in body_str:
return deanonymize_sse(request_id, body_str, mapping, is_anthropic)
return deanonymize_json(request_id, raw_body, body_str, mapping, is_anthropic)