feat: optimize PER_REQ_CONFIG_MODIFIER

This commit is contained in:
martsforever
2026-03-31 16:57:32 +08:00
parent 32e62c0825
commit 77a5c547ed
+7 -1
View File
@@ -1,8 +1,14 @@
import uuid
async def PER_REQ_CONFIG_MODIFIER(config, request): async def PER_REQ_CONFIG_MODIFIER(config, request):
body = await request.json() body = await request.json()
return { return {
"configurable": { "configurable": {
"thread_id": "thread_id":
body.get("config", {}).get("configurable", {}).get("thread_id", "default") body
.get("config", {})
.get("configurable", {})
.get("thread_id", None) or str(uuid.uuid4())
} }
} }