Optional
apiAPI key for Perplexity. Defaults to the value of PERPLEXITY_API_KEY environment variable.
Optional
cacheOptional
callbackOptional
callbacksOptional
disableWhether to disable streaming.
If streaming is bypassed, then stream()
will defer to
invoke()
.
Optional
frequencyFrequency penalty greater than 0
Optional
maxThe maximum number of concurrent calls that can be made.
Defaults to Infinity
, which means no limit.
Optional
maxThe maximum number of retries that can be made for a single call, with an exponential backoff between each attempt. Defaults to 6.
Optional
maxMaximum number of tokens to generate
Optional
metadataModel name to use
Optional
onCustom handler to handle failed attempts. Takes the originally thrown error object as input, and should itself throw an error if the input error is not retryable.
Optional
presencePresence penalty between -2 and 2
Optional
reasoningControls how much computational effort the AI dedicates to each query for deep research models. Only applicable for sonar-deep-research.
Optional
returnWhether to return images
Optional
returnDetermines whether or not a request to an online model should return related questions.
Optional
searchFilters search results to only include content published after this date.
Optional
searchFilters search results to only include content published before this date.
Optional
searchSearch domain filter - limit the citations used by the online model to URLs from the specified domains.
Optional
searchControls the search mode used for the request. When set to 'academic', results will prioritize scholarly sources.
Optional
searchReturns search results within the specified time interval - does not apply to images. Values include month, week, day, hour.
Optional
streamingWhether to stream the results or not
Optional
tagsOptional
temperatureTemperature parameter between 0 and 2
Optional
timeoutTimeout for requests to Perplexity
Optional
topKTop K parameter between 1 and 2048
Optional
topPTop P parameter between 0 and 1
Optional
verboseOptional
webConfiguration for using web search in model responses.
Interface defining the parameters for the Perplexity chat model.