Choices.fromMap constructor

Choices.fromMap(
  1. Map<String, dynamic> map
)

Create the object from a Map<String, dynamic>

Implementation

factory Choices.fromMap(Map<String, dynamic> map) {
  return Choices(
    text: map['text'] as String,
    index: map['index'] as int,
    logprobs: map['logprobs'] != null ? map['logprobs'] as int : null,
    finishReason: map['finish_reason'] as String,
  );
}