@langchain/community
Version:
Third-party integrations for LangChain.js
1 lines • 4.54 kB
Source Map (JSON)
{"version":3,"file":"searxng_search.d.cts","names":["Tool","SearxngCustomHeaders","SearxngSearchParams","SearxngSearch","P","apiBase","params","headers","Promise"],"sources":["../../src/tools/searxng_search.d.ts"],"sourcesContent":["import { Tool } from \"@langchain/core/tools\";\n/**\n * Interface for custom headers used in the Searxng search.\n */\ninterface SearxngCustomHeaders {\n [key: string]: string;\n}\ninterface SearxngSearchParams {\n /**\n * @default 10\n * Number of results included in results\n */\n numResults?: number;\n /** Comma separated list, specifies the active search categories\n * https://docs.searxng.org/user/configured_engines.html#configured-engines\n */\n categories?: string;\n /** Comma separated list, specifies the active search engines\n * https://docs.searxng.org/user/configured_engines.html#configured-engines\n */\n engines?: string;\n /** Code of the language. */\n language?: string;\n /** Search page number. */\n pageNumber?: number;\n /**\n * day / month / year\n *\n * Time range of search for engines which support it. See if an engine supports time range search in the preferences page of an instance.\n */\n timeRange?: number;\n /**\n * Throws Error if format is set anything other than \"json\"\n * Output format of results. Format needs to be activated in search:\n */\n format?: \"json\";\n /** Open search results on new tab. */\n resultsOnNewTab?: 0 | 1;\n /** Proxy image results through SearXNG. */\n imageProxy?: boolean;\n autocomplete?: string;\n /**\n * Filter search results of engines which support safe search. See if an engine supports safe search in the preferences page of an instance.\n */\n safesearch?: 0 | 1 | 2;\n}\n/**\n * SearxngSearch class represents a meta search engine tool.\n * Use this class when you need to answer questions about current events.\n * The input should be a search query, and the output is a JSON array of the query results.\n *\n * note: works best with *agentType*: `structured-chat-zero-shot-react-description`\n * https://github.com/searxng/searxng\n * @example\n * ```typescript\n * const executor = AgentExecutor.fromAgentAndTools({\n * agent,\n * tools: [\n * new SearxngSearch({\n * params: {\n * format: \"json\",\n * engines: \"google\",\n * },\n * headers: {},\n * }),\n * ],\n * });\n * const result = await executor.invoke({\n * input: `What is Langchain? Describe in 50 words`,\n * });\n * ```\n */\nexport declare class SearxngSearch extends Tool {\n static lc_name(): string;\n name: string;\n description: string;\n protected apiBase?: string;\n protected params?: SearxngSearchParams;\n protected headers?: SearxngCustomHeaders;\n get lc_secrets(): {\n [key: string]: string;\n } | undefined;\n /**\n * Constructor for the SearxngSearch class\n * @param apiBase Base URL of the Searxng instance\n * @param params SearxNG parameters\n * @param headers Custom headers\n */\n constructor({ apiBase, params, headers }: {\n /** Base URL of Searxng instance */\n apiBase?: string;\n /** SearxNG Paramerters\n *\n * https://docs.searxng.org/dev/search_api.html check here for more details\n */\n params?: SearxngSearchParams;\n /**\n * Custom headers\n * Set custom headers if you're using a api from RapidAPI (https://rapidapi.com/iamrony777/api/searxng)\n * No headers needed for a locally self-hosted instance\n */\n headers?: SearxngCustomHeaders;\n });\n /**\n * Builds the URL for the Searxng search.\n * @param path The path for the URL.\n * @param parameters The parameters for the URL.\n * @param baseUrl The base URL.\n * @returns The complete URL as a string.\n */\n protected buildUrl<P extends SearxngSearchParams>(path: string, parameters: P, baseUrl: string): string;\n _call(input: string): Promise<string>;\n}\nexport {};\n//# sourceMappingURL=searxng_search.d.ts.map"],"mappings":";;;;;;AAA6C;AAIf,UAApBC,oBAAAA,CAGmB;EAiERE,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,MAAa;;UAjExBD,mBAAAA,CAuEcD;EAUNI;;;;EAaAJ,UAAAA,CAAAA,EAAAA,MAAAA;EASeC;;;EAtCUF,UAAAA,CAAAA,EAAAA,MAAAA;EAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAA1BG,aAAAA,SAAsBH,IAAAA;;;;;qBAKpBE;sBACCD;;;;;;;;;;;;;;;;;;;;;aAiBPC;;;;;;cAMCD;;;;;;;;;+BASeC,+CAA+CE;wBACtDI"}