Skip to content

Commit 0387f1d

Browse files
committed
Fix: Lint
1 parent 67f6cf6 commit 0387f1d

2 files changed

Lines changed: 21 additions & 6 deletions

File tree

app/(api)/_utils/hackbot/stream/context.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ export async function fetchSessionAndDocs(
2525
}
2626

2727
if (docsResult.status === 'rejected') {
28-
console.error('[hackbot][stream] Context retrieval error', docsResult.reason);
28+
console.error(
29+
'[hackbot][stream] Context retrieval error',
30+
docsResult.reason
31+
);
2932
return Response.json(
3033
{ error: 'Search backend unavailable. Please contact an organizer.' },
3134
{ status: 500 }
@@ -38,7 +41,9 @@ export async function fetchSessionAndDocs(
3841
};
3942
}
4043

41-
export function buildProfileFromSession(session: unknown): HackerProfile | null {
44+
export function buildProfileFromSession(
45+
session: unknown
46+
): HackerProfile | null {
4247
const sessionUser = (session as any)?.user as any;
4348
if (!sessionUser) return null;
4449

@@ -49,7 +54,9 @@ export function buildProfileFromSession(session: unknown): HackerProfile | null
4954
};
5055
}
5156

52-
export function buildContextSummary(docs: HackbotSessionDocsResult['docs']): string {
57+
export function buildContextSummary(
58+
docs: HackbotSessionDocsResult['docs']
59+
): string {
5360
if (!docs.length) return 'No additional knowledge context found.';
5461

5562
return docs

app/(api)/_utils/hackbot/stream/responseStream.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { getDatabase } from '@utils/mongodb/mongoClient.mjs';
22

3-
export function createResponseStream(result: any, model: string): ReadableStream {
3+
export function createResponseStream(
4+
result: any,
5+
model: string
6+
): ReadableStream {
47
const enc = new TextEncoder();
58

69
return new ReadableStream({
@@ -46,7 +49,10 @@ export function createResponseStream(result: any, model: string): ReadableStream
4649
])}\n`
4750
);
4851
} else if (part?.type === 'error') {
49-
console.error('[hackbot][stream] OpenAI error in stream:', part.error);
52+
console.error(
53+
'[hackbot][stream] OpenAI error in stream:',
54+
part.error
55+
);
5056
streamError = (part.error as any)?.message ?? 'OpenAI server error';
5157
break;
5258
} else if (part?.type === 'finish') {
@@ -63,7 +69,9 @@ export function createResponseStream(result: any, model: string): ReadableStream
6369
}
6470

6571
if (streamError) {
66-
enq(`3:${JSON.stringify('Something went wrong. Please try again.')}\n`);
72+
enq(
73+
`3:${JSON.stringify('Something went wrong. Please try again.')}\n`
74+
);
6775
}
6876
controller.close();
6977
} catch (e) {

0 commit comments

Comments
 (0)