SearxngSearch class represents a meta search engine tool. Use this class when you need to answer questions about current events. The input should be a search query, and the output is a JSON array of the query results.

note: works best with agentType: structured-chat-zero-shot-react-description https://github.com/searxng/searxng

Example

const executor = AgentExecutor.fromAgentAndTools({
agent,
tools: [
new SearxngSearch({
params: {
format: "json",
engines: "google",
},
headers: {},
}),
],
});
const result = await executor.invoke({
input: `What is Langchain? Describe in 50 words`,
});

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

description: string = "A meta search engine. Useful for when you need to answer questions about current events. Input should be a search query. Output is a JSON array of the query results"
name: string = "searxng-search"
apiBase?: string
headers?: SearxngCustomHeaders
params?: SearxngSearchParams = ...

Methods

  • Builds the URL for the Searxng search.

    Type Parameters

    • P extends SearxngSearchParams

    Parameters

    • path: string

      The path for the URL.

    • parameters: P

      The parameters for the URL.

    • baseUrl: string

      The base URL.

    Returns string

    The complete URL as a string.

Generated using TypeDoc