chore: first commit

This commit is contained in:
Han Xiao
2025-01-26 23:39:09 +08:00
parent 74716eea13
commit f038095d29

View File

@@ -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,