toPublic method

FinishReason? toPublic()

Maps the internal FinishReason? enum to the external FinishReason? enum.

Implementation

public_types.FinishReason? toPublic() {
  switch (this) {
    case null:
      return null;
    case InternalFinishReason.MAX_TOKENS:
      return public_types.FinishReason.MAX_TOKENS;
    case InternalFinishReason.RECITATION:
      return public_types.FinishReason.RECITATION;
    case InternalFinishReason.SAFETY:
      return public_types.FinishReason.SAFETY;
    case InternalFinishReason.STOP:
      return public_types.FinishReason.STOP;
    case InternalFinishReason.OTHER:
      return public_types.FinishReason.OTHER;
    case InternalFinishReason.UNSPECIFIED:
      return public_types.FinishReason.UNSPECIFIED;
    case InternalFinishReason.UNKNOWN:
      return public_types.FinishReason.UNKNOWN;
  }
}