chore: remove lodash

This commit is contained in:
AnotiaWang
2025-02-12 15:46:11 +08:00
parent 6d6124d4ef
commit 9f2760d8b8
3 changed files with 2 additions and 28 deletions

View File

@ -1,5 +1,4 @@
import { streamText } from 'ai'
import { compact } from 'lodash-es'
import pLimit from 'p-limit'
import { z } from 'zod'
import { parseStreamingJson, type DeepPartial } from '~/utils/json'
@ -136,7 +135,7 @@ function processSearchResult({
),
})
const jsonSchema = JSON.stringify(zodToJsonSchema(schema))
const contents = compact(result.results.map((item) => item.content)).map(
const contents = result.results.map((item) => item.content).filter(Boolean).map(
(content) => trimPrompt(content, 25_000),
)
const prompt = [
@ -267,7 +266,7 @@ export async function deepResearch({
)
// Collect URLs from this search
const newUrls = compact(result.results.map((item) => item.url))
const newUrls = result.results.map((item) => item.url).filter(Boolean)
onProgress({
type: 'search_complete',
urls: newUrls,