Skip to content

TokenCounts

Namespace: Vercel.AI.GenerateText

public static class TokenCounts

Token-count helpers. Maps to sumTokenCounts.

Inheritance: object

View source

public static int? SumTokenCounts(int? tokenCount1, int? tokenCount2)

Adds token counts. An unknown count is treated as 0 when the other count is known. Returns null when both counts are unknown.

Parameters

Name Type Description
tokenCount1 int?
tokenCount2 int?

Returns: int?

View source

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