tryParse static method

GroqMessageRole? tryParse(
  1. String role
)

Implementation

static GroqMessageRole? tryParse(String role) {
  switch (role) {
    case 'system':
      return GroqMessageRole.system;
    case 'user':
      return GroqMessageRole.user;
    case 'assistant':
      return GroqMessageRole.assistant;
    default:
      return null;
  }
}