From 77a5c547ed99fa36bd450ebe746bde0d11d33c2d Mon Sep 17 00:00:00 2001 From: martsforever Date: Tue, 31 Mar 2026 16:57:32 +0800 Subject: [PATCH] feat: optimize PER_REQ_CONFIG_MODIFIER --- app/utils/PER_REQ_CONFIG_MODIFIER.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/utils/PER_REQ_CONFIG_MODIFIER.py b/app/utils/PER_REQ_CONFIG_MODIFIER.py index 6f944db..ec6ee93 100644 --- a/app/utils/PER_REQ_CONFIG_MODIFIER.py +++ b/app/utils/PER_REQ_CONFIG_MODIFIER.py @@ -1,8 +1,14 @@ +import uuid + + async def PER_REQ_CONFIG_MODIFIER(config, request): body = await request.json() return { "configurable": { "thread_id": - body.get("config", {}).get("configurable", {}).get("thread_id", "default") + body + .get("config", {}) + .get("configurable", {}) + .get("thread_id", None) or str(uuid.uuid4()) } }