mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-06-19 00:08:43 +00:00
feat(agents): replace LLMs with chat LLMs
This commit is contained in:
@ -17,16 +17,11 @@ import type { StreamEvent } from '@langchain/core/tracers/log_stream';
|
||||
import formatChatHistoryAsString from '../utils/formatHistory';
|
||||
import eventEmitter from 'events';
|
||||
|
||||
const chatLLM = new ChatOpenAI({
|
||||
const llm = new ChatOpenAI({
|
||||
modelName: process.env.MODEL_NAME,
|
||||
temperature: 0.7,
|
||||
});
|
||||
|
||||
const llm = new OpenAI({
|
||||
temperature: 0,
|
||||
modelName: process.env.MODEL_NAME,
|
||||
});
|
||||
|
||||
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.
|
||||
If it is a writing task or a simple hi, hello rather than a question, you need to return \`not_needed\` as the response.
|
||||
@ -169,7 +164,7 @@ const basicWolframAlphaSearchAnsweringChain = RunnableSequence.from([
|
||||
new MessagesPlaceholder('chat_history'),
|
||||
['user', '{query}'],
|
||||
]),
|
||||
chatLLM,
|
||||
llm,
|
||||
strParser,
|
||||
]).withConfig({
|
||||
runName: 'FinalResponseGenerator',
|
||||
|
Reference in New Issue
Block a user