From 456c89429a8f8520d604a73bf37146efccbaec7f Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sat, 14 Dec 2024 02:25:36 +0530 Subject: [PATCH] fix: removed context optimization temporarily, to be moved to optional from menu --- app/commit.json | 2 +- app/lib/.server/llm/stream-text.ts | 7 ++++--- app/utils/constants.ts | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/commit.json b/app/commit.json index 2a5e31eee..5a4a53964 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "d1fa70fc97dc7839ea8cd005feb03266f201cf4f" } +{ "commit": "8c4397a19f3eab2382082a39526d66385e9d2a49" } diff --git a/app/lib/.server/llm/stream-text.ts b/app/lib/.server/llm/stream-text.ts index b178cc465..11ac99bd5 100644 --- a/app/lib/.server/llm/stream-text.ts +++ b/app/lib/.server/llm/stream-text.ts @@ -38,7 +38,7 @@ type Dirent = File | Folder; export type FileMap = Record; -function simplifyBoltActions(input: string): string { +export function simplifyBoltActions(input: string): string { // Using regex to match boltAction tags that have type="file" const regex = /(]*type="file"[^>]*>)([\s\S]*?)(<\/boltAction>)/g; @@ -156,8 +156,9 @@ export async function streamText(props: { return { ...message, content }; } else if (message.role == 'assistant') { - let content = message.content; - content = simplifyBoltActions(content); + const content = message.content; + + // content = simplifyBoltActions(content); return { ...message, content }; } diff --git a/app/utils/constants.ts b/app/utils/constants.ts index 1e516193b..3247fb293 100644 --- a/app/utils/constants.ts +++ b/app/utils/constants.ts @@ -462,7 +462,6 @@ async function getOpenRouterModels(): Promise { } async function getLMStudioModels(_apiKeys?: Record, settings?: IProviderSetting): Promise { - try { const baseUrl = settings?.baseUrl || import.meta.env.LMSTUDIO_API_BASE_URL || 'http://localhost:1234'; const response = await fetch(`${baseUrl}/v1/models`);