Skip to content

ReasoningMap

Namespace: Vercel.AI.ProviderUtils

public static class ReasoningMap

Maps reasoning levels onto provider effort and token budgets.

Inheritance: object

View source

public static bool IsCustomReasoning(string? reasoning)

True for every reasoning value except omitted and provider-default. Maps to isCustomReasoning.

Parameters

Name Type Description
reasoning string

Returns: bool

View source

MapReasoningToProviderBudget(string, int, int, IList<ModelWarning>, int, IReadOnlyDictionary<string, double>?)

Section titled “MapReasoningToProviderBudget(string, int, int, IList<ModelWarning>, int, IReadOnlyDictionary<string, double>?)”
public static int? MapReasoningToProviderBudget(string reasoning, int maxOutputTokens, int maxReasoningBudget, IList<ModelWarning> warnings, int minReasoningBudget = 1024, IReadOnlyDictionary<string, double>? budgetPercentages = null)

Maps a reasoning level to a token budget. Maps to mapReasoningToProviderBudget.

Parameters

Name Type Description
reasoning string
maxOutputTokens int
maxReasoningBudget int
warnings IList<ModelWarning>
minReasoningBudget int
budgetPercentages IReadOnlyDictionary<string, double>

Returns: int?

View source

MapReasoningToProviderEffort(string, IReadOnlyDictionary<string, string>, IList<ModelWarning>)

Section titled “MapReasoningToProviderEffort(string, IReadOnlyDictionary<string, string>, IList<ModelWarning>)”
public static string? MapReasoningToProviderEffort(string reasoning, IReadOnlyDictionary<string, string> effortMap, IList<ModelWarning> warnings)

Maps a reasoning level through <code class=“paramref”>effortMap</code>. Maps to mapReasoningToProviderEffort.

Parameters

Name Type Description
reasoning string
effortMap IReadOnlyDictionary<string, string>
warnings IList<ModelWarning>

Returns: string

View source

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