Skip to content

OpenAI.TokenEngine

Andrew Lambert edited this page Jun 1, 2024 · 4 revisions

OpenAI.TokenEngine

Class Declaration

 Protected Class TokenEngine

Remarks

This class represents the tokens of an API response. Not all endpoints provide token information.

Methods

Properties

Example

This example gets the first token of the response and its probability.

 Dim reply As OpenAI.ChatCompletion = OpenAI.ChatCompletion.Create(chatlog, "user", "Who won the world series in 2020?")
 Dim token As String = chat.Tokens.Token(0)
 Dim probability As Double = chat.Tokens.Probability(0)
Clone this wiki locally