mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2025-12-25 22:16:49 +08:00
feat: update search query handling and enhance serpCluster schema
This commit is contained in:
parent
74f521bec8
commit
0bbcf9ca85
@ -305,7 +305,8 @@ async function executeSearchQueries(
|
||||
switch (searchProvider || SEARCH_PROVIDER) {
|
||||
case 'jina':
|
||||
case 'arxiv':
|
||||
results = (await search(query, searchProvider, 30, meta, context.tokenTracker)).response.results || [];
|
||||
const num = meta ? undefined : 30;
|
||||
results = (await search(query, searchProvider, num, meta, context.tokenTracker)).response.results || [];
|
||||
break;
|
||||
case 'duck':
|
||||
results = (await duckSearch(query.q, { safeSearch: SafeSearchType.STRICT })).results;
|
||||
|
||||
@ -29,6 +29,7 @@ export async function serpCluster(results: SearchSnippet[], trackers: TrackerCon
|
||||
system: prompt.system,
|
||||
prompt: prompt.user,
|
||||
});
|
||||
trackers?.actionTracker.trackThink(result.object.think);
|
||||
const clusters = result.object.clusters;
|
||||
logInfo(TOOL_NAME, { clusters });
|
||||
return clusters;
|
||||
|
||||
@ -176,6 +176,7 @@ export class Schemas {
|
||||
|
||||
getSerpClusterSchema(): z.ZodObject<any> {
|
||||
return z.object({
|
||||
think: z.string().describe(`Short explain of why you group the search results like this. ${this.getLanguagePrompt()}`).max(500),
|
||||
clusters: z.array(
|
||||
z.object({
|
||||
insight: z.string().describe('Summary and list key numbers, data, soundbites, and insights that worth to be highlighted. End with an actionable advice such as "Visit these URLs if you want to understand [what...]". Do not use "This cluster..."').max(200),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user