Update package version and add hideEditAndRegenerate prop

This commit is contained in:
n4ze3m
2024-03-16 14:28:32 +05:30
parent 78c44e13b0
commit 4aff7f991a
4 changed files with 32 additions and 18 deletions

View File

@@ -1,6 +1,15 @@
import { getWebSearchPrompt } from "~services/ollama"
import { webSearch } from "./local-google"
const getHostName = (url: string) => {
try {
const hostname = new URL(url).hostname
return hostname
} catch (e) {
return ""
}
}
export const getSystemPromptForWeb = async (query: string) => {
try {
const search = await webSearch(query)
@@ -18,7 +27,7 @@ export const getSystemPromptForWeb = async (query: string) => {
source: search.map((result) => {
return {
url: result.url,
name: new URL(result.url).hostname,
name: getHostName(result.url),
type: "url",
}
})