Skip to content

OpenAICompatibleUsage

Namespace: Vercel.AI.OpenAICompatible

public sealed class OpenAICompatibleUsage

Chat usage plus prediction-token counts stored as provider metadata.

Inheritance: object

View source

OpenAICompatibleUsage(LanguageModelUsage, int?, int?)

Section titled “OpenAICompatibleUsage(LanguageModelUsage, int?, int?)”
public OpenAICompatibleUsage(LanguageModelUsage usage, int? acceptedPredictionTokens, int? rejectedPredictionTokens)

Creates converted usage.

Parameters

Name Type Description
usage LanguageModelUsage
acceptedPredictionTokens int?
rejectedPredictionTokens int?

View source

public int? AcceptedPredictionTokens { get; }

Accepted prediction tokens, when reported.

Value: int?

View source

public static OpenAICompatibleUsage Missing { get; }

Usage when the provider omitted the object.

Value: OpenAICompatibleUsage

View source

public int? RejectedPredictionTokens { get; }

Rejected prediction tokens, when reported.

Value: int?

View source

public LanguageModelUsage Usage { get; }

Token counts.

Value: LanguageModelUsage

View source

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