-
-
Notifications
You must be signed in to change notification settings - Fork 7
OpenAI.TokenEngine
Andrew Lambert edited this page Jun 1, 2024
·
4 revisions
OpenAI.TokenEngine
Protected Class TokenEngine
This class represents the tokens of an API response. Not all endpoints provide token information.
This example gets the first token of the response, its probability, and a list of alternate tokens and their probabilities.
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)
Dim alternates() As String = chat.Tokens.AlternateTokens(0)
Dim altprobs() As Double = chat.Tokens.AlternateProbabilities(0)
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2023-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.