Skip to content

Commit 4fffc66

Browse files
committed
Lint
1 parent a3159bc commit 4fffc66

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

apps/sim/app/api/copilot/chat/route.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ IMPORTANT: Always provide complete, helpful responses. If you add citations, con
242242
})
243243

244244
// Store citations for later use in the main streaming handler
245+
245246
;(streamResponse as any)._citations = responseCitations
246247

247248
return streamResponse
@@ -435,7 +436,12 @@ export async function POST(req: NextRequest) {
435436
const assistantMessage = {
436437
id: crypto.randomUUID(),
437438
role: 'assistant',
438-
content: typeof response === 'string' ? response : (typeof response === 'object' && 'content' in response ? response.content : '[Error generating response]') || '[Error generating response]',
439+
content:
440+
typeof response === 'string'
441+
? response
442+
: (typeof response === 'object' && 'content' in response
443+
? response.content
444+
: '[Error generating response]') || '[Error generating response]',
439445
timestamp: new Date().toISOString(),
440446
citations: citations.length > 0 ? citations : undefined,
441447
}
@@ -464,7 +470,12 @@ export async function POST(req: NextRequest) {
464470

465471
return NextResponse.json({
466472
success: true,
467-
response: typeof response === 'string' ? response : (typeof response === 'object' && 'content' in response ? response.content : '[Error generating response]') || '[Error generating response]',
473+
response:
474+
typeof response === 'string'
475+
? response
476+
: (typeof response === 'object' && 'content' in response
477+
? response.content
478+
: '[Error generating response]') || '[Error generating response]',
468479
chatId: currentChat?.id,
469480
citations: extractCitationsFromResponse(response),
470481
metadata: {

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) {
4848
if (!citations || citations.length === 0) return text
4949

5050
let processedText = text
51-
51+
5252
// Replace [1], [2], [3] etc. with clickable citation icons
5353
processedText = processedText.replace(/\[(\d+)\]/g, (match, num) => {
5454
const citationIndex = Number.parseInt(num) - 1

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export const Copilot = forwardRef<CopilotRef, CopilotProps>(
277277
// Reload chats in background to get the updated list
278278
loadChats()
279279
}
280-
280+
281281
// Mark stream as complete to exit outer loop
282282
streamComplete = true
283283
break

0 commit comments

Comments
 (0)