PerplexityConfig

org.llm4s.llmconnect.config.PerplexityConfig
See thePerplexityConfig companion object
@Experimental
final case class PerplexityConfig extends ProviderConfig

Configuration for Perplexity's Agent API (POST /v1/agent).

Build one with PerplexityConfig.fromValues; a provider = "perplexity" section builds one for you.

Value parameters

apiKey

the Perplexity API key, sent as a bearer token; redacted in toString.

apiKeyProvider

asked for the key on every request instead of apiKey: a section's apiKeyFile sets one.

baseUrl

the API host, https://api.perplexity.ai by default; requests go to <baseUrl>/v1/agent (or <baseUrl>/agent when the base already ends in /v1).

contextWindow

the model's context window in tokens.

headers

extra HTTP headers sent with every request: the section's headers.

model

the Agent API model, in its provider/model form, e.g. "perplexity/sonar" or "openai/gpt-5.6-sol".

network

proxy and TLS settings.

reserveCompletion

tokens held back from the prompt for the reply; also the max_output_tokens sent to an anthropic/ model when the request sets none, since the Agent API requires one for them.

timeouts

how long a request and a stream may take: the section's timeouts block.

webSearch

whether each request offers the model Perplexity's web_search tool. Each search the model runs is billed per invocation.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def agentUrl: String

The Agent API endpoint requests are posted to.

The Agent API endpoint requests are posted to.

Attributes

override def endpointUrl: Option[String]

The endpoint this config will contact, when it is known statically.

The endpoint this config will contact, when it is known statically.

Used by policy checks and diagnostics that need to know where traffic will go without knowing which provider it belongs to. None means the config carries no single URL — not that it makes no network calls.

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any

The same config, its client asking provider for the key on each request, so a rotated key is used without rebuilding the client.

The same config, its client asking provider for the key on each request, so a rotated key is used without rebuilding the client.

The loader calls this for a section that sets apiKeyFile. The default returns this: a config whose client cannot take a provider ignores it, and its apiKeyProvider stays None - which the loader reports as an error for apiKeyFile and code setting a provider should check. A config that supports it overrides this with its own return type.

Attributes

Definition Classes
def withHeaders(headers: Map[String, String]): PerplexityConfig
override def withModel(model: String): PerplexityConfig

The same provider and credentials, pointed at a different model.

The same provider and credentials, pointed at a different model.

Attributes

Definition Classes

The same config with the given proxy and TLS settings.

The same config with the given proxy and TLS settings.

The loader calls this on every config a descriptor builds, as it does withTimeouts, so a descriptor does not read the http block itself. The default returns this: a config that does not carry the setting ignores it. A config that does overrides this with its own return type.

Attributes

Definition Classes

The same config with the given timeouts.

The same config with the given timeouts.

The loader calls this on every config a descriptor builds, passing the section's timeouts block, so a descriptor does not read the block itself. The default returns this: a config that does not carry timeouts, such as one supplied by another module, ignores them. A config that does overrides this with its own return type.

Attributes

Definition Classes
def withWebSearch(webSearch: Boolean): PerplexityConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

override val providerId: ProviderId

Canonical id of the provider this config addresses, e.g. ProviderId("openai").

Canonical id of the provider this config addresses, e.g. ProviderId("openai").

Attributes