feat(config): add searxngURL

This commit is contained in:
ItzCrazyKns
2025-10-15 13:02:08 +05:30
parent 626cb646e2
commit b67ca79e2a
3 changed files with 8 additions and 2 deletions

View File

@@ -10,3 +10,5 @@ export const getConfiguredModelProviderById = (
): ConfigModelProvider | undefined => {
return getConfiguredModelProviders().find((p) => p.id === id) ?? undefined;
};
export const getSearxngURL = () => configManager.getConfig('search.searxngURL', '')

View File

@@ -55,6 +55,9 @@ type Config = {
[key: string]: any;
};
modelProviders: ConfigModelProvider[];
search: {
[key: string]: any
}
};
type EnvMap = {
@@ -73,6 +76,7 @@ type ModelProviderUISection = {
type UIConfigSections = {
general: UIConfigField[];
modelProviders: ModelProviderUISection[];
search: UIConfigField[];
};
export type {

View File

@@ -1,5 +1,5 @@
import axios from 'axios';
import { getSearxngApiEndpoint } from './config';
import { getSearxngURL } from './config/serverRegistry';
interface SearxngSearchOptions {
categories?: string[];
@@ -23,7 +23,7 @@ export const searchSearxng = async (
query: string,
opts?: SearxngSearchOptions,
) => {
const searxngURL = getSearxngApiEndpoint();
const searxngURL = getSearxngURL();
const url = new URL(`${searxngURL}/search?format=json`);
url.searchParams.append('q', query);