chore: remove lodash
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
import { streamText } from 'ai'
|
import { streamText } from 'ai'
|
||||||
import { compact } from 'lodash-es'
|
|
||||||
import pLimit from 'p-limit'
|
import pLimit from 'p-limit'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import { parseStreamingJson, type DeepPartial } from '~/utils/json'
|
import { parseStreamingJson, type DeepPartial } from '~/utils/json'
|
||||||
@ -136,7 +135,7 @@ function processSearchResult({
|
|||||||
),
|
),
|
||||||
})
|
})
|
||||||
const jsonSchema = JSON.stringify(zodToJsonSchema(schema))
|
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),
|
(content) => trimPrompt(content, 25_000),
|
||||||
)
|
)
|
||||||
const prompt = [
|
const prompt = [
|
||||||
@ -267,7 +266,7 @@ export async function deepResearch({
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Collect URLs from this search
|
// 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({
|
onProgress({
|
||||||
type: 'search_complete',
|
type: 'search_complete',
|
||||||
urls: newUrls,
|
urls: newUrls,
|
||||||
|
@ -20,11 +20,9 @@
|
|||||||
"@pinia/nuxt": "^0.10.0",
|
"@pinia/nuxt": "^0.10.0",
|
||||||
"@tailwindcss/typography": "^0.5.16",
|
"@tailwindcss/typography": "^0.5.16",
|
||||||
"@tavily/core": "^0.0.3",
|
"@tavily/core": "^0.0.3",
|
||||||
"@types/lodash-es": "^4.17.12",
|
|
||||||
"ai": "^4.1.28",
|
"ai": "^4.1.28",
|
||||||
"html2pdf.js": "^0.9.3",
|
"html2pdf.js": "^0.9.3",
|
||||||
"js-tiktoken": "^1.0.18",
|
"js-tiktoken": "^1.0.18",
|
||||||
"lodash-es": "^4.17.21",
|
|
||||||
"marked": "^15.0.7",
|
"marked": "^15.0.7",
|
||||||
"nuxt": "^3.15.4",
|
"nuxt": "^3.15.4",
|
||||||
"p-limit": "^6.2.0",
|
"p-limit": "^6.2.0",
|
||||||
|
23
pnpm-lock.yaml
generated
23
pnpm-lock.yaml
generated
@ -38,9 +38,6 @@ importers:
|
|||||||
'@tavily/core':
|
'@tavily/core':
|
||||||
specifier: ^0.0.3
|
specifier: ^0.0.3
|
||||||
version: 0.0.3
|
version: 0.0.3
|
||||||
'@types/lodash-es':
|
|
||||||
specifier: ^4.17.12
|
|
||||||
version: 4.17.12
|
|
||||||
ai:
|
ai:
|
||||||
specifier: ^4.1.28
|
specifier: ^4.1.28
|
||||||
version: 4.1.28(react@19.0.0)(zod@3.24.1)
|
version: 4.1.28(react@19.0.0)(zod@3.24.1)
|
||||||
@ -50,9 +47,6 @@ importers:
|
|||||||
js-tiktoken:
|
js-tiktoken:
|
||||||
specifier: ^1.0.18
|
specifier: ^1.0.18
|
||||||
version: 1.0.18
|
version: 1.0.18
|
||||||
lodash-es:
|
|
||||||
specifier: ^4.17.21
|
|
||||||
version: 4.17.21
|
|
||||||
marked:
|
marked:
|
||||||
specifier: ^15.0.7
|
specifier: ^15.0.7
|
||||||
version: 15.0.7
|
version: 15.0.7
|
||||||
@ -1184,12 +1178,6 @@ packages:
|
|||||||
'@types/json-schema@7.0.15':
|
'@types/json-schema@7.0.15':
|
||||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||||
|
|
||||||
'@types/lodash-es@4.17.12':
|
|
||||||
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
|
|
||||||
|
|
||||||
'@types/lodash@4.17.15':
|
|
||||||
resolution: {integrity: sha512-w/P33JFeySuhN6JLkysYUK2gEmy9kHHFN7E8ro0tkfmlDOgxBDzWEZ/J8cWA+fHqFevpswDTFZnDx+R9lbL6xw==}
|
|
||||||
|
|
||||||
'@types/node@22.13.1':
|
'@types/node@22.13.1':
|
||||||
resolution: {integrity: sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==}
|
resolution: {integrity: sha512-jK8uzQlrvXqEU91UxiK5J7pKHyzgnI1Qnl0QDHIgVGuolJhRb9EEl28Cj9b3rGR8B2lhFCtvIm5os8lFnO/1Ew==}
|
||||||
|
|
||||||
@ -2797,9 +2785,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
|
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
lodash-es@4.17.21:
|
|
||||||
resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==}
|
|
||||||
|
|
||||||
lodash.castarray@4.4.0:
|
lodash.castarray@4.4.0:
|
||||||
resolution: {integrity: sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==}
|
resolution: {integrity: sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==}
|
||||||
|
|
||||||
@ -5806,12 +5791,6 @@ snapshots:
|
|||||||
|
|
||||||
'@types/json-schema@7.0.15': {}
|
'@types/json-schema@7.0.15': {}
|
||||||
|
|
||||||
'@types/lodash-es@4.17.12':
|
|
||||||
dependencies:
|
|
||||||
'@types/lodash': 4.17.15
|
|
||||||
|
|
||||||
'@types/lodash@4.17.15': {}
|
|
||||||
|
|
||||||
'@types/node@22.13.1':
|
'@types/node@22.13.1':
|
||||||
dependencies:
|
dependencies:
|
||||||
undici-types: 6.20.0
|
undici-types: 6.20.0
|
||||||
@ -7521,8 +7500,6 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
p-locate: 5.0.0
|
p-locate: 5.0.0
|
||||||
|
|
||||||
lodash-es@4.17.21: {}
|
|
||||||
|
|
||||||
lodash.castarray@4.4.0: {}
|
lodash.castarray@4.4.0: {}
|
||||||
|
|
||||||
lodash.defaults@4.2.0: {}
|
lodash.defaults@4.2.0: {}
|
||||||
|
Reference in New Issue
Block a user