langchain.js
    Preparing search index...

    Interface defining the parameters for the Perplexity chat model.

    interface PerplexityChatInput {
        apiKey?: string;
        disableSearch?: boolean;
        enableSearchClassifier?: boolean;
        frequencyPenalty?: number;
        lastUpdatedAfterFilter?: string;
        lastUpdatedBeforeFilter?: string;
        maxTokens?: number;
        model: string;
        presencePenalty?: number;
        reasoningEffort?: "low" | "medium" | "high";
        returnImages?: boolean;
        returnRelatedQuestions?: boolean;
        searchAfterDateFilter?: string;
        searchBeforeDateFilter?: string;
        searchDomainFilter?: unknown[];
        searchMode?: "academic" | "web";
        searchRecencyFilter?: string;
        streaming?: boolean;
        temperature?: number;
        timeout?: number;
        topK?: number;
        topP?: number;
        webSearchOptions?: WebSearchOptions;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    apiKey?: string

    API key for Perplexity. Defaults to the value of PERPLEXITY_API_KEY environment variable.

    disableSearch?: boolean

    When set to true, disables web search completely and the model will only use its training data to respond. This is useful when you want deterministic responses without external information.

    enableSearchClassifier?: boolean

    Enables a classifier that decides if web search is needed based on your query.

    frequencyPenalty?: number

    Frequency penalty greater than 0

    lastUpdatedAfterFilter?: string

    Filters search results to only include content last updated after this date.

    lastUpdatedBeforeFilter?: string

    Filters search results to only include content last updated before this date.

    maxTokens?: number

    Maximum number of tokens to generate

    model: string

    Model name to use

    presencePenalty?: number

    Presence penalty between -2 and 2

    reasoningEffort?: "low" | "medium" | "high"

    Controls how much computational effort the AI dedicates to each query for deep research models. Only applicable for sonar-deep-research.

    returnImages?: boolean

    Whether to return images

    returnRelatedQuestions?: boolean

    Determines whether or not a request to an online model should return related questions.

    searchAfterDateFilter?: string

    Filters search results to only include content published after this date.

    searchBeforeDateFilter?: string

    Filters search results to only include content published before this date.

    searchDomainFilter?: unknown[]

    Search domain filter - limit the citations used by the online model to URLs from the specified domains.

    searchMode?: "academic" | "web"

    Controls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources.

    searchRecencyFilter?: string

    Returns search results within the specified time interval - does not apply to images. Values include month, week, day, hour.

    streaming?: boolean

    Whether to stream the results or not

    temperature?: number

    Temperature parameter between 0 and 2

    timeout?: number

    Timeout for requests to Perplexity

    topK?: number

    Top K parameter between 1 and 2048

    topP?: number

    Top P parameter between 0 and 1

    webSearchOptions?: WebSearchOptions

    Configuration for using web search in model responses.