mirror of
				https://github.com/ItzCrazyKns/Perplexica.git
				synced 2025-11-04 12:48:14 +00:00 
			
		
		
		
	feat(agents): Use LLM name from env
This commit is contained in:
		@@ -2,3 +2,4 @@ PORT=3001
 | 
				
			|||||||
OPENAI_API_KEY=
 | 
					OPENAI_API_KEY=
 | 
				
			||||||
SIMILARITY_MEASURE=cosine # cosine or dot
 | 
					SIMILARITY_MEASURE=cosine # cosine or dot
 | 
				
			||||||
SEARXNG_API_URL= # no need to fill this if using docker
 | 
					SEARXNG_API_URL= # no need to fill this if using docker
 | 
				
			||||||
 | 
					MODEL_NAME=gpt-3.5-turbo
 | 
				
			||||||
@@ -19,13 +19,13 @@ import eventEmitter from 'events';
 | 
				
			|||||||
import computeSimilarity from '../utils/computeSimilarity';
 | 
					import computeSimilarity from '../utils/computeSimilarity';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const chatLLM = new ChatOpenAI({
 | 
					const chatLLM = new ChatOpenAI({
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
  temperature: 0.7,
 | 
					  temperature: 0.7,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const llm = new OpenAI({
 | 
					const llm = new OpenAI({
 | 
				
			||||||
  temperature: 0,
 | 
					  temperature: 0,
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const embeddings = new OpenAIEmbeddings({
 | 
					const embeddings = new OpenAIEmbeddings({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,7 @@ import { searchSearxng } from '../core/searxng';
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
const llm = new OpenAI({
 | 
					const llm = new OpenAI({
 | 
				
			||||||
  temperature: 0,
 | 
					  temperature: 0,
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const imageSearchChainPrompt = `
 | 
					const imageSearchChainPrompt = `
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,13 +19,13 @@ import eventEmitter from 'events';
 | 
				
			|||||||
import computeSimilarity from '../utils/computeSimilarity';
 | 
					import computeSimilarity from '../utils/computeSimilarity';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const chatLLM = new ChatOpenAI({
 | 
					const chatLLM = new ChatOpenAI({
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
  temperature: 0.7,
 | 
					  temperature: 0.7,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const llm = new OpenAI({
 | 
					const llm = new OpenAI({
 | 
				
			||||||
  temperature: 0,
 | 
					  temperature: 0,
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const embeddings = new OpenAIEmbeddings({
 | 
					const embeddings = new OpenAIEmbeddings({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,13 +19,13 @@ import eventEmitter from 'events';
 | 
				
			|||||||
import computeSimilarity from '../utils/computeSimilarity';
 | 
					import computeSimilarity from '../utils/computeSimilarity';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const chatLLM = new ChatOpenAI({
 | 
					const chatLLM = new ChatOpenAI({
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
  temperature: 0.7,
 | 
					  temperature: 0.7,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const llm = new OpenAI({
 | 
					const llm = new OpenAI({
 | 
				
			||||||
  temperature: 0,
 | 
					  temperature: 0,
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const embeddings = new OpenAIEmbeddings({
 | 
					const embeddings = new OpenAIEmbeddings({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,13 +19,13 @@ import eventEmitter from 'events';
 | 
				
			|||||||
import computeSimilarity from '../utils/computeSimilarity';
 | 
					import computeSimilarity from '../utils/computeSimilarity';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const chatLLM = new ChatOpenAI({
 | 
					const chatLLM = new ChatOpenAI({
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
  temperature: 0.7,
 | 
					  temperature: 0.7,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const llm = new OpenAI({
 | 
					const llm = new OpenAI({
 | 
				
			||||||
  temperature: 0,
 | 
					  temperature: 0,
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const embeddings = new OpenAIEmbeddings({
 | 
					const embeddings = new OpenAIEmbeddings({
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ import type { StreamEvent } from '@langchain/core/tracers/log_stream';
 | 
				
			|||||||
import eventEmitter from 'events';
 | 
					import eventEmitter from 'events';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const chatLLM = new ChatOpenAI({
 | 
					const chatLLM = new ChatOpenAI({
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
  temperature: 0.7,
 | 
					  temperature: 0.7,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,13 +19,13 @@ import eventEmitter from 'events';
 | 
				
			|||||||
import computeSimilarity from '../utils/computeSimilarity';
 | 
					import computeSimilarity from '../utils/computeSimilarity';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const chatLLM = new ChatOpenAI({
 | 
					const chatLLM = new ChatOpenAI({
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
  temperature: 0.7,
 | 
					  temperature: 0.7,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const llm = new OpenAI({
 | 
					const llm = new OpenAI({
 | 
				
			||||||
  temperature: 0,
 | 
					  temperature: 0,
 | 
				
			||||||
  modelName: 'gpt-3.5-turbo',
 | 
					  modelName: process.env.MODEL_NAME,
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const embeddings = new OpenAIEmbeddings({
 | 
					const embeddings = new OpenAIEmbeddings({
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user