diff --git a/tools/server/webui/src/lib/services/chat.service.ts b/tools/server/webui/src/lib/services/chat.service.ts index 9abe0515ff..0003875ce8 100644 --- a/tools/server/webui/src/lib/services/chat.service.ts +++ b/tools/server/webui/src/lib/services/chat.service.ts @@ -4,7 +4,13 @@ import { ATTACHMENT_LABEL_PDF_FILE, ATTACHMENT_LABEL_MCP_PROMPT } from '$lib/constants/attachment-labels'; -import { AttachmentType, ContentPartType, MessageRole, ReasoningFormat } from '$lib/enums'; +import { + AttachmentType, + ContentPartType, + MessageRole, + ReasoningFormat, + UrlPrefix +} from '$lib/enums'; import type { ApiChatMessageContentPart, ApiChatCompletionToolCall } from '$lib/types/api'; import type { DatabaseMessageExtraMcpPrompt } from '$lib/types'; import { modelsStore } from '$lib/stores/models.svelte'; @@ -427,7 +433,7 @@ export class ChatService { for (const line of lines) { if (abortSignal?.aborted) break; - if (line.startsWith('data: ')) { + if (line.startsWith(UrlPrefix.DATA)) { const data = line.slice(6); if (data === '[DONE]') { streamFinished = true;