mirror of
https://github.com/jina-ai/node-DeepResearch.git
synced 2026-03-22 07:29:35 +08:00
chore: first commit
This commit is contained in:
12
src/agent.ts
12
src/agent.ts
@@ -25,7 +25,7 @@ type ResponseSchema = {
|
|||||||
enum: string[];
|
enum: string[];
|
||||||
description: string;
|
description: string;
|
||||||
};
|
};
|
||||||
searchQuery: {
|
keywordsQuery: {
|
||||||
type: SchemaType.STRING;
|
type: SchemaType.STRING;
|
||||||
description: string;
|
description: string;
|
||||||
};
|
};
|
||||||
@@ -99,7 +99,7 @@ function getSchema(allowReflect: boolean): ResponseSchema {
|
|||||||
description: "Only required when choosing 'reflect' action, list of most important questions to answer to fill the knowledge gaps.",
|
description: "Only required when choosing 'reflect' action, list of most important questions to answer to fill the knowledge gaps.",
|
||||||
maxItems: 2
|
maxItems: 2
|
||||||
} : undefined,
|
} : undefined,
|
||||||
searchQuery: {
|
keywordsQuery: {
|
||||||
type: SchemaType.STRING,
|
type: SchemaType.STRING,
|
||||||
description: "Only required when choosing 'search' action, must be a short, keyword-based query that BM25, tf-idf based search engines can understand.",
|
description: "Only required when choosing 'search' action, must be a short, keyword-based query that BM25, tf-idf based search engines can understand.",
|
||||||
},
|
},
|
||||||
@@ -163,8 +163,8 @@ When uncertain or needing additional information, select one of these actions:
|
|||||||
|
|
||||||
**search**:
|
**search**:
|
||||||
- Query external sources using a public search engine
|
- Query external sources using a public search engine
|
||||||
- Optimize for concise, keyword-based searches
|
- Focus on solving one specific aspect of the question
|
||||||
- Use for recent information (post-training data) or missing domain knowledge
|
- Only give keywords search query, not full sentences
|
||||||
|
|
||||||
**readURL**:
|
**readURL**:
|
||||||
- Access the full content behind specific URLs
|
- Access the full content behind specific URLs
|
||||||
@@ -256,8 +256,8 @@ async function getResponse(question: string) {
|
|||||||
|
|
||||||
// Rest of the action handling remains the same
|
// Rest of the action handling remains the same
|
||||||
try {
|
try {
|
||||||
if (action.action === 'search' && action.searchQuery) {
|
if (action.action === 'search' && action.keywordsQuery) {
|
||||||
const results = await search(action.searchQuery, jinaToken);
|
const results = await search(action.keywordsQuery, jinaToken);
|
||||||
context.push({
|
context.push({
|
||||||
step,
|
step,
|
||||||
question: currentQuestion,
|
question: currentQuestion,
|
||||||
|
|||||||
Reference in New Issue
Block a user