feat: optimize PER_REQ_CONFIG_MODIFIER
This commit is contained in:
@@ -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())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user