langchain.js
    Preparing search index...

    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

    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 (View Summary)

    Index

    Constructors

    • Constructor for the SearxngSearch class

      Parameters

      • __namedParameters: {
            apiBase?: string;
            headers?: SearxngCustomHeaders;
            params?: SearxngSearchParams;
        }

      Returns SearxngSearch

    Properties

    apiBase?: string
    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"
    headers?: SearxngCustomHeaders
    name: string = "searxng-search"
    params?: SearxngSearchParams = ...

    Accessors

    • get lc_secrets(): undefined | { [key: string]: string }

      Returns undefined | { [key: string]: string }

    Methods

    • Parameters

      • input: string

      Returns Promise<string>

    • 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.

    • Returns string