get sess_id correctly
This commit is contained in:
@@ -94,7 +94,7 @@ async def application_responses(
|
|||||||
|
|
||||||
# Prefer path params
|
# Prefer path params
|
||||||
req_app_id = app_id or body.get("app_id")
|
req_app_id = app_id or body.get("app_id")
|
||||||
req_session_id = session_id or body.get("session_id")
|
req_session_id = session_id or body['input'].get("session_id")
|
||||||
|
|
||||||
# Normalize messages
|
# Normalize messages
|
||||||
messages = body.get("messages")
|
messages = body.get("messages")
|
||||||
@@ -113,7 +113,7 @@ async def application_responses(
|
|||||||
if stream is None:
|
if stream is None:
|
||||||
stream = body.get("parameters", {}).get("stream", True)
|
stream = body.get("parameters", {}).get("stream", True)
|
||||||
|
|
||||||
thread_id = body.get("thread_id", 3)
|
thread_id = body['input'].get("session_id")
|
||||||
|
|
||||||
# Extract latest user message
|
# Extract latest user message
|
||||||
user_msg = None
|
user_msg = None
|
||||||
@@ -175,7 +175,7 @@ async def application_completion(
|
|||||||
try:
|
try:
|
||||||
body = await request.json()
|
body = await request.json()
|
||||||
|
|
||||||
req_session_id = body.get("session_id")
|
req_session_id = body['input'].get("session_id")
|
||||||
|
|
||||||
# Normalize messages
|
# Normalize messages
|
||||||
messages = body.get("messages")
|
messages = body.get("messages")
|
||||||
@@ -193,7 +193,7 @@ async def application_completion(
|
|||||||
if stream is None:
|
if stream is None:
|
||||||
stream = body.get("parameters", {}).get("stream", True)
|
stream = body.get("parameters", {}).get("stream", True)
|
||||||
|
|
||||||
thread_id = body.get("thread_id", 3)
|
thread_id = body['input'].get("session_id")
|
||||||
|
|
||||||
user_msg = None
|
user_msg = None
|
||||||
for m in reversed(messages):
|
for m in reversed(messages):
|
||||||
|
|||||||
Reference in New Issue
Block a user