Closed Mookse closed 1 month ago
async function chat(ctx){
ctx.state.chatMessage = ctx.request.body
ctx.state.thread = ctx.state.MemberSession.thread
const message = ctx.request.body?.message ?? false /* body has all the nodes sent by fe */
if(!message?.length)
ctx.throw(400, 'missing `message` content')
const response = await ctx.state.avatar.chatRequest(ctx)
ctx.body = response
}
async function chat(ctx){
ctx.state.chatMessage = ctx.request.body
ctx.state.thread = ctx.state.MemberSession.thread
const message = ctx.request.body?.message ?? false /* body has all the nodes sent by fe */
if(!message?.length)
ctx.throw(400, 'missing `message` content')
const response = await ctx.state.avatar.chatRequest(ctx)
ctx.body = response
}
async function chat(ctx){
const message = ctx.request.body?.message
?? false /* body has all the nodes sent by fe */
if(!message?.length)
ctx.throw(400, 'missing `message` content')
const response = await ctx.state.avatar.chatRequest(message)
ctx.body = response
}
See file alterations in branch for fix. Entire handshake was broken between frontend (sending null) to backend not pre-creating conversations it knew it could undertake from thread ids found in bots.
Thread is getting lost (new one created) every exchange at local dev - might have to do with save or if, correct asap
id=null