diff --git a/packages/backend/src/utils/playground.ts b/packages/backend/src/utils/playground.ts index 11c5ada5..17b39f7c 100644 --- a/packages/backend/src/utils/playground.ts +++ b/packages/backend/src/utils/playground.ts @@ -109,6 +109,7 @@ export async function handleStream( res = { choices, + citations: part.citations, // perplexity models return an array of citations links usage: { completion_tokens: tokens, }, @@ -421,7 +422,7 @@ export async function runAImodel( let res = await openai.chat.completions.create({ model, messages, - stream: stream, + stream, temperature: extra?.temperature, max_tokens: extra?.max_tokens, top_p: extra?.top_p, diff --git a/packages/frontend/components/SmartViewer/Message.tsx b/packages/frontend/components/SmartViewer/Message.tsx index 0148aefc..18c05205 100644 --- a/packages/frontend/components/SmartViewer/Message.tsx +++ b/packages/frontend/components/SmartViewer/Message.tsx @@ -224,10 +224,10 @@ function TextMessage({ }) { const text = data.content || data.text; - return ( - - - {editable ? ( + if (editable) { + return ( + +