mirror of
				https://github.com/ItzCrazyKns/Perplexica.git
				synced 2025-10-31 03:18:16 +00:00 
			
		
		
		
	Add config for multiple search engines
This commit is contained in:
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -2,6 +2,7 @@ | ||||
| node_modules/ | ||||
| npm-debug.log | ||||
| yarn-error.log | ||||
| package-lock.json | ||||
|  | ||||
| # Build output | ||||
| /.next/ | ||||
|   | ||||
| @@ -2,6 +2,7 @@ | ||||
| PORT = 3001 # Port to run the server on | ||||
| SIMILARITY_MEASURE = "cosine" # "cosine" or "dot" | ||||
| KEEP_ALIVE = "5m" # How long to keep Ollama models loaded into memory. (Instead of using -1 use "-1m") | ||||
| SEARCH_ENGINE_BACKEND = "google" # "google" | "searxng" | "ddg" | "bing" | "brave" | ||||
|  | ||||
| [MODELS.OPENAI] | ||||
| API_KEY = "" | ||||
| @@ -22,5 +23,15 @@ API_URL = "" | ||||
| [MODELS.OLLAMA] | ||||
| API_URL = "" # Ollama API URL - http://host.docker.internal:11434 | ||||
|  | ||||
| [API_ENDPOINTS] | ||||
| SEARXNG = "http://localhost:32768" # SearxNG API URL | ||||
| [SEARCH_ENGINES.GOOGLE] | ||||
| API_KEY = "" | ||||
| CSE_ID = "" | ||||
|  | ||||
| [SEARCH_ENGINES.SEARXNG] | ||||
| ENDPOINT = "" | ||||
|  | ||||
| [SEARCH_ENGINES.BING] | ||||
| SUBSCRIPTION_KEY = "" | ||||
|  | ||||
| [SEARCH_ENGINES.BRAVE] | ||||
| API_KEY = "" | ||||
|   | ||||
| @@ -9,6 +9,7 @@ interface Config { | ||||
|     PORT: number; | ||||
|     SIMILARITY_MEASURE: string; | ||||
|     KEEP_ALIVE: string; | ||||
|     SEARCH_ENGINE_BACKEND: string; | ||||
|   }; | ||||
|   MODELS: { | ||||
|     OPENAI: { | ||||
| @@ -32,8 +33,20 @@ interface Config { | ||||
|       MODEL_NAME: string; | ||||
|     }; | ||||
|   }; | ||||
|   API_ENDPOINTS: { | ||||
|     SEARXNG: string; | ||||
|   SEARCH_ENGINES: { | ||||
|     GOOGLE: { | ||||
|       API_KEY: string; | ||||
|       CSE_ID: string; | ||||
|     }; | ||||
|     SEARXNG: { | ||||
|       ENDPOINT: string; | ||||
|     }; | ||||
|     BING: { | ||||
|       SUBSCRIPTION_KEY: string; | ||||
|     }; | ||||
|     BRAVE: { | ||||
|       API_KEY: string; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
|  | ||||
| @@ -61,8 +74,18 @@ export const getAnthropicApiKey = () => loadConfig().MODELS.ANTHROPIC.API_KEY; | ||||
|  | ||||
| export const getGeminiApiKey = () => loadConfig().MODELS.GEMINI.API_KEY; | ||||
|  | ||||
| export const getSearchEngineBackend = () => loadConfig().GENERAL.SEARCH_ENGINE_BACKEND; | ||||
|  | ||||
| export const getGoogleApiKey = () => loadConfig().SEARCH_ENGINES.GOOGLE.API_KEY; | ||||
|  | ||||
| export const getGoogleCseId = () => loadConfig().SEARCH_ENGINES.GOOGLE.CSE_ID; | ||||
|  | ||||
| export const getBraveApiKey = () => loadConfig().SEARCH_ENGINES.BRAVE.API_KEY; | ||||
|  | ||||
| export const getBingSubscriptionKey = () => loadConfig().SEARCH_ENGINES.BING.SUBSCRIPTION_KEY; | ||||
|  | ||||
| export const getSearxngApiEndpoint = () => | ||||
|   process.env.SEARXNG_API_URL || loadConfig().API_ENDPOINTS.SEARXNG; | ||||
|   process.env.SEARXNG_API_URL || loadConfig().SEARCH_ENGINES.SEARXNG.ENDPOINT; | ||||
|  | ||||
| export const getOllamaApiEndpoint = () => loadConfig().MODELS.OLLAMA.API_URL; | ||||
|  | ||||
|   | ||||
							
								
								
									
										1090
									
								
								ui/yarn.lock
									
									
									
									
									
								
							
							
						
						
									
										1090
									
								
								ui/yarn.lock
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Reference in New Issue
	
	Block a user