Skip to content

PerplexityDecisionModel

Namespace: Vercel.AI.Perplexity

public sealed class PerplexityDecisionModel : IDecisionCaller

Answers questions through the Perplexity Decisions API (POST {base}/v1/decisions). Boolean questions are sent as native noul questions. Probabilities and scores keep full precision. Provider options are not supported.

Inheritance: object

Implements: IDecisionCaller

View source

PerplexityDecisionModel(PerplexityProvider, string)

Section titled “PerplexityDecisionModel(PerplexityProvider, string)”
public PerplexityDecisionModel(PerplexityProvider provider, string modelId)

Creates a decision model.

Parameters

Name Type Description
provider PerplexityProvider
modelId string

View source

public string ModelId { get; }

Model id.

Value: string

View source

public string Provider { get; }

Provider id.

Value: string

View source

public string SpecificationVersion { get; }

Specification version. Only v4 is accepted.

Value: string

View source

public IReadOnlyList<string> SupportedQuestionTypes { get; }

Question types this model can answer.

Value: IReadOnlyList<string>

View source

Deserialize(SerializedModelOptions, HttpClient?)

Section titled “Deserialize(SerializedModelOptions, HttpClient?)”
public static PerplexityDecisionModel Deserialize(SerializedModelOptions options, HttpClient? httpClient = null)

Restores a model from Serialize(). Maps to [WORKFLOW_DESERIALIZE]. Pass <code class=“paramref”>httpClient</code> to send the requests through a custom handler.

Parameters

Name Type Description
options SerializedModelOptions
httpClient HttpClient

Returns: PerplexityDecisionModel

View source

DoDecideAsync(DecisionModelCall, CancellationToken)

Section titled “DoDecideAsync(DecisionModelCall, CancellationToken)”
public Task<DecisionModelResult> DoDecideAsync(DecisionModelCall call, CancellationToken cancellationToken = default)

Sends every question in one Decisions request.

Parameters

Name Type Description
call DecisionModelCall
cancellationToken CancellationToken

Returns: Task<DecisionModelResult>

View source

public SerializedModelOptions Serialize()

Serializes the model id, the endpoint, and the resolved request headers (including authentication) for a workflow boundary. Maps to [WORKFLOW_SERIALIZE]. The HTTP client is not serialized.

Returns: SerializedModelOptions

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product