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()) } }