toMap method

Map<String, dynamic> toMap()

This is used to convert a OpenAIChatCompletionModel object to a Map<String, dynamic> object.

Implementation

Map<String, dynamic> toMap() {
  return {
    "id": id,
    "created": created.millisecondsSinceEpoch,
    "choices": choices.map((e) => e.toMap()).toList(),
    "usage": usage.toMap(),
  };
}