fix: bug fix

This commit is contained in:
n4ze3m
2025-01-25 15:19:28 +05:30
parent 7b6b6751cc
commit 51804bc9ae
29 changed files with 133 additions and 136 deletions

View File

@@ -184,7 +184,6 @@ export const fetchChatModels = async ({
try {
const models = await getAllModels({ returnEmpty })
const chatModels = models
?.filter((model) => {
return (

View File

@@ -3,6 +3,7 @@ import { Storage } from "@plasmohq/storage"
import { getOllamaURL } from "./ollama"
import { cleanUrl } from "@/libs/clean-url"
import { HumanMessage } from "langchain/schema"
import { removeReasoning } from "@/libs/reasoning"
const storage = new Storage()
// this prompt is copied from the OpenWebUI codebase
@@ -64,9 +65,9 @@ export const generateTitle = async (model: string, query: string, fallBackTitle:
})
])
return title.content.toString()
return removeReasoning(title.content.toString())
} catch (error) {
console.log(`Error generating title: ${error}`)
console.error(`Error generating title: ${error}`)
return fallBackTitle
}
}