finishReason property

String? finishReason
final

The reason why the conversation ended
It can be finished or aborted
Example:

final choice = response.choices.first;
print(choice.finishReason); //prints the reason why the conversation ended

Implementation

final String? finishReason;