DecisionLiquidModel
Namespace: Vercel.AI.Liquid
public sealed class DecisionLiquidModel : IDecisionCallerAnswers questions through the Liquid Decisions API (POST {base}/decisions/v1/systemone). Boolean questions are sent as
native noul questions. Image and audio file parts are sent as base64 data URLs. Maps to DecisionLiquidModel.
Inheritance: object
Implements: IDecisionCaller
Constructors
Section titled “Constructors”DecisionLiquidModel(LiquidProvider, string)
Section titled “DecisionLiquidModel(LiquidProvider, string)”public DecisionLiquidModel(LiquidProvider provider, string modelId)Creates a decision model. <code class=“paramref”>modelId</code> may be a model id this library does not know yet.
Parameters
| Name | Type | Description |
|---|---|---|
provider |
LiquidProvider | |
modelId |
string |
Properties
Section titled “Properties”ModelId
Section titled “ModelId”public string ModelId { get; }Model id.
Value: string
Provider
Section titled “Provider”public string Provider { get; }Provider id.
Value: string
SpecificationVersion
Section titled “SpecificationVersion”public string SpecificationVersion { get; }Specification version. Only v4 is accepted.
Value: string
SupportedQuestionTypes
Section titled “SupportedQuestionTypes”public IReadOnlyList<string> SupportedQuestionTypes { get; }Question types this model can answer.
Value: IReadOnlyList<string>
Methods
Section titled “Methods”Deserialize(SerializedModelOptions, HttpClient?)
Section titled “Deserialize(SerializedModelOptions, HttpClient?)”public static DecisionLiquidModel 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: DecisionLiquidModel
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>
Serialize()
Section titled “Serialize()”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
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product