Fix types
This commit is contained in:
parent
f3e846955f
commit
5de9ae612d
2 changed files with 2 additions and 2 deletions
|
|
@ -40,7 +40,7 @@ export async function POST(req: Request) {
|
|||
const stream = OpenAIStream(res, {
|
||||
async onCompletion(completion) {
|
||||
const title = json.messages[0].content.substring(0, 100)
|
||||
const userId = session.user.id
|
||||
const userId = session.user?.id
|
||||
const id = json.id ?? nanoid()
|
||||
const createdAt = Date.now()
|
||||
const path = `/chat/${id}`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue