diff --git a/src/agents/academicSearchAgent.ts b/src/agents/academicSearchAgent.ts index a64f9b9..a72e3a2 100644 --- a/src/agents/academicSearchAgent.ts +++ b/src/agents/academicSearchAgent.ts @@ -19,6 +19,7 @@ import formatChatHistoryAsString from '../utils/formatHistory'; import eventEmitter from 'events'; import computeSimilarity from '../utils/computeSimilarity'; import logger from '../utils/logger'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; const basicAcademicSearchRetrieverPrompt = ` You will be given a conversation below and a follow up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the web for information. diff --git a/src/agents/redditSearchAgent.ts b/src/agents/redditSearchAgent.ts index bbb4e92..9c2c443 100644 --- a/src/agents/redditSearchAgent.ts +++ b/src/agents/redditSearchAgent.ts @@ -19,6 +19,7 @@ import formatChatHistoryAsString from '../utils/formatHistory'; import eventEmitter from 'events'; import computeSimilarity from '../utils/computeSimilarity'; import logger from '../utils/logger'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; const basicRedditSearchRetrieverPrompt = ` You will be given a conversation below and a follow up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the web for information. diff --git a/src/agents/webSearchAgent.ts b/src/agents/webSearchAgent.ts index 9c0d97f..f7a6d7e 100644 --- a/src/agents/webSearchAgent.ts +++ b/src/agents/webSearchAgent.ts @@ -96,7 +96,7 @@ const basicWebSearchResponsePrompt = ` const strParser = new StringOutputParser(); const handleStream = async ( - stream: IterableReadableStream, + stream: IterableReadableStream, emitter: eventEmitter, ) => { for await (const event of stream) { diff --git a/src/agents/wolframAlphaSearchAgent.ts b/src/agents/wolframAlphaSearchAgent.ts index 07d8857..1de8d0f 100644 --- a/src/agents/wolframAlphaSearchAgent.ts +++ b/src/agents/wolframAlphaSearchAgent.ts @@ -18,6 +18,7 @@ import type { Embeddings } from '@langchain/core/embeddings'; import formatChatHistoryAsString from '../utils/formatHistory'; import eventEmitter from 'events'; import logger from '../utils/logger'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; const basicWolframAlphaSearchRetrieverPrompt = ` You will be given a conversation below and a follow up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the web for information. diff --git a/src/agents/writingAssistant.ts b/src/agents/writingAssistant.ts index 5fd1f36..7e275df 100644 --- a/src/agents/writingAssistant.ts +++ b/src/agents/writingAssistant.ts @@ -10,6 +10,7 @@ import eventEmitter from 'events'; import type { BaseChatModel } from '@langchain/core/language_models/chat_models'; import type { Embeddings } from '@langchain/core/embeddings'; import logger from '../utils/logger'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; const writingAssistantPrompt = ` You are Perplexica, an AI model who is expert at searching the web and answering user's queries. You are currently set on focus mode 'Writing Assistant', this means you will be helping the user write a response to a given query. diff --git a/src/agents/youtubeSearchAgent.ts b/src/agents/youtubeSearchAgent.ts index b0da25b..e9b6553 100644 --- a/src/agents/youtubeSearchAgent.ts +++ b/src/agents/youtubeSearchAgent.ts @@ -19,6 +19,7 @@ import formatChatHistoryAsString from '../utils/formatHistory'; import eventEmitter from 'events'; import computeSimilarity from '../utils/computeSimilarity'; import logger from '../utils/logger'; +import { IterableReadableStream } from '@langchain/core/utils/stream'; const basicYoutubeSearchRetrieverPrompt = ` You will be given a conversation below and a follow up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the web for information.