Skip to content

OpenAI.TokenEngine.Alternates

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

OpenAI.TokenEngine.Alternates

Method signature

Function Alternates(TokenIndex As Integer) As Dictionary

Parameters

Name Type Comment
TokenIndex Integer The index of the token to get alternate tokens for.

Return value

A Dictionary of "string":Double pairs containing the alternate tokens and their probabilities.

Example

This example gets the alternate tokens for the first token in the response.

 Dim reply As OpenAI.ChatCompletion = OpenAI.ChatCompletion.Create(chatlog, "user", "Who won the world series in 2020?")
 Dim alternates As Dictionary = reply.Tokens.Alternates(0)
Clone this wiki locally