| external help file | PSOpenAI-help.xml |
|---|---|
| Module Name | PSOpenAI |
| online version | https://github.com/mkht/PSOpenAI/blob/main/Docs/ConvertFrom-Token.md |
| schema | 2.0.0 |
Decode tokens to original text.
ConvertFrom-Token
[-Token] <Int32[]>
[[-Encoding] <String>]
[-AsArray]
[<CommonParameters>]
ConvertFrom-Token
[-Token] <Int32[]>
[-Model] <String>
[-AsArray]
[<CommonParameters>]
Decode tokens to original text.
$Tokens = (9906, 11, 1917, 0)
ConvertFrom-Token -Token $Tokens -Model 'gpt-4'
# Output: Hello, world!(102415, 230, 102415, 240, 102415, 239) | ConvertFrom-Token -Encoding 'o200k_base'
# Output: 🍈🍒🍑Specifies the token array to be decoded.
Type: Int32[]
Parameter Sets: (All)
Required: True
Position: 0
Accept pipeline input: True (ByValue)Specifies the encoding name. Currently cl100k_base and o200k_base are supported.
It cannot be specified with the model name.
Type: String
Parameter Sets: encoding
Accepted values: cl100k_base, o200k_base
Required: False
Position: 1
Default value: cl100k_baseSpecifies the model name. such like gpt-4 or text-embedding-3-small.
It cannot be specified with the encoding name.
Type: String
Parameter Sets: model
Required: True
Position: 1
Default value: NoneIf set, output as an array of strings decoded token by token.
Type: SwitchParameter
Required: False
Position: Named
Default value: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.