15 lines
284 B
Python
15 lines
284 B
Python
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", None) or str(uuid.uuid4())
|
|
}
|
|
}
|