mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-09-17 23:01:32 +00:00
feat(tavily): integrate Tavily search engine with configuration and UI support
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
getOllamaApiEndpoint,
|
||||
getOpenaiApiKey,
|
||||
getDeepseekApiKey,
|
||||
getSearchEngine,
|
||||
getTavilyApiKey,
|
||||
updateConfig,
|
||||
} from '@/lib/config';
|
||||
import {
|
||||
@@ -58,6 +60,8 @@ export const GET = async (req: Request) => {
|
||||
config['customOpenaiApiUrl'] = getCustomOpenaiApiUrl();
|
||||
config['customOpenaiApiKey'] = getCustomOpenaiApiKey();
|
||||
config['customOpenaiModelName'] = getCustomOpenaiModelName();
|
||||
config['searchEngine'] = getSearchEngine();
|
||||
config['tavilyApiKey'] = getTavilyApiKey();
|
||||
|
||||
return Response.json({ ...config }, { status: 200 });
|
||||
} catch (err) {
|
||||
@@ -99,6 +103,12 @@ export const POST = async (req: Request) => {
|
||||
MODEL_NAME: config.customOpenaiModelName,
|
||||
},
|
||||
},
|
||||
SEARCH: {
|
||||
ENGINE: config.searchEngine,
|
||||
},
|
||||
API_ENDPOINTS: {
|
||||
TAVILY: config.tavilyApiKey || '',
|
||||
},
|
||||
};
|
||||
|
||||
updateConfig(updatedConfig);
|
||||
|
Reference in New Issue
Block a user