toMap method

Map<String, dynamic> toMap()

This method used to convert the OpenAIChatCompletionChoiceModel to a Map<String, dynamic> object.

Implementation

Map<String, dynamic> toMap() {
  return {
    "index": index,
    "message": message.toMap(),
    "finish_reason": finishReason,
  };
}