Chat Choice Chunk
The OpenAI API returns a list of ChatChoiceChunk. The "new content" is saved to the delta property. To access everything that is currently generated, use message.
By default, only 1 ChatChoiceChunk is generated (since ChatRequest.n == 1). When you increase n
, more options are generated. The more options you generate, the more tokens you use. In general, it is best to ONLY generate 1 response, and to let the user regenerate the response.
Since
1.2.0
See also
Functions
Returns true
if this message chunk is complete. Once complete, no more tokens will be generated, and ChatChoiceChunk.message will contain the complete message.
Properties
The newly generated tokens (can be empty!)
The reason the bot stopped generating tokens.
The index in the array... 0 if ChatRequest.n=1.
All tokens that are currently generated.