Skip to content

OpenAI.Response.FinishReason

Andrew Lambert edited this page Mar 12, 2023 · 3 revisions

OpenAI.Response.FinishReason

Method signature

 Function FinishReason(Index As Integer = 0) As String

Parameters

Name Type Comment
Index Integer Optional. The index of the result to retrieve if there are more than one. If the index is invalid then an OutOfBoundsException will be raised.

Return value

A String containing the stop reason.

Remarks

Returns the reason for finishing the result at Index, as a String. Not all endpoints supply this information.

Typical finish reasons include "length" meaning the token limit was reached, and "stop" meaning the AI reached a natural stopping point.

Clone this wiki locally