Removed compact mode

This commit is contained in:
Willie Zutz
2025-04-19 13:36:50 -06:00
parent b2da9faeed
commit 73b5e8832e
11 changed files with 15 additions and 160 deletions

View File

@@ -6,7 +6,6 @@ export const searchHandlers: Record<string, MetaSearchAgent> = {
activeEngines: [],
queryGeneratorPrompt: prompts.webSearchRetrieverPrompt,
responsePrompt: prompts.webSearchResponsePrompt,
preciseResponsePrompt: prompts.preciseWebSearchResponsePrompt,
rerank: true,
rerankThreshold: 0.3,
searchWeb: true,
@@ -16,7 +15,6 @@ export const searchHandlers: Record<string, MetaSearchAgent> = {
activeEngines: ['arxiv', 'google scholar', 'pubmed'],
queryGeneratorPrompt: prompts.academicSearchRetrieverPrompt,
responsePrompt: prompts.academicSearchResponsePrompt,
preciseResponsePrompt: prompts.academicSearchResponsePrompt,
rerank: true,
rerankThreshold: 0,
searchWeb: true,
@@ -26,7 +24,6 @@ export const searchHandlers: Record<string, MetaSearchAgent> = {
activeEngines: [],
queryGeneratorPrompt: '',
responsePrompt: prompts.writingAssistantPrompt,
preciseResponsePrompt: prompts.writingAssistantPrompt,
rerank: true,
rerankThreshold: 0,
searchWeb: false,
@@ -36,7 +33,6 @@ export const searchHandlers: Record<string, MetaSearchAgent> = {
activeEngines: ['wolframalpha'],
queryGeneratorPrompt: prompts.wolframAlphaSearchRetrieverPrompt,
responsePrompt: prompts.wolframAlphaSearchResponsePrompt,
preciseResponsePrompt: prompts.wolframAlphaSearchResponsePrompt,
rerank: false,
rerankThreshold: 0,
searchWeb: true,
@@ -46,7 +42,6 @@ export const searchHandlers: Record<string, MetaSearchAgent> = {
activeEngines: ['youtube'],
queryGeneratorPrompt: prompts.youtubeSearchRetrieverPrompt,
responsePrompt: prompts.youtubeSearchResponsePrompt,
preciseResponsePrompt: prompts.youtubeSearchResponsePrompt,
rerank: true,
rerankThreshold: 0.3,
searchWeb: true,
@@ -56,7 +51,6 @@ export const searchHandlers: Record<string, MetaSearchAgent> = {
activeEngines: ['reddit'],
queryGeneratorPrompt: prompts.redditSearchRetrieverPrompt,
responsePrompt: prompts.redditSearchResponsePrompt,
preciseResponsePrompt: prompts.redditSearchResponsePrompt,
rerank: true,
rerankThreshold: 0.3,
searchWeb: true,

View File

@@ -34,7 +34,6 @@ export interface MetaSearchAgentType {
optimizationMode: 'speed' | 'balanced' | 'quality',
fileIds: string[],
systemInstructions: string,
isCompact?: boolean,
) => Promise<eventEmitter>;
}
@@ -45,7 +44,6 @@ interface Config {
rerankThreshold: number;
queryGeneratorPrompt: string;
responsePrompt: string;
preciseResponsePrompt: string;
activeEngines: string[];
}
@@ -240,10 +238,7 @@ class MetaSearchAgent implements MetaSearchAgentType {
embeddings: Embeddings,
optimizationMode: 'speed' | 'balanced' | 'quality',
systemInstructions: string,
isCompact?: boolean,
) {
console.log("compact mode", isCompact);
console.log("optimization mode", optimizationMode);
return RunnableSequence.from([
RunnableMap.from({
@@ -290,9 +285,7 @@ class MetaSearchAgent implements MetaSearchAgentType {
ChatPromptTemplate.fromMessages([
[
'system',
isCompact
? this.config.preciseResponsePrompt
: this.config.responsePrompt,
this.config.responsePrompt
],
new MessagesPlaceholder('chat_history'),
['user', '{query}'],
@@ -483,7 +476,6 @@ class MetaSearchAgent implements MetaSearchAgentType {
optimizationMode: 'speed' | 'balanced' | 'quality',
fileIds: string[],
systemInstructions: string,
isCompact?: boolean,
) {
const emitter = new eventEmitter();
@@ -492,8 +484,7 @@ class MetaSearchAgent implements MetaSearchAgentType {
fileIds,
embeddings,
optimizationMode,
systemInstructions,
isCompact,
systemInstructions
);
const stream = answeringChain.streamEvents(