groq library

Groq Generative AI The Groq AI SDK for Dart allows developers to use Large Language Models (LLMs) to build language applications. final groq = Groq(apiKey: const String.fromEnvironment('groqApiKey'));

groq.startChat();

try {

GroqResponse response = await groq.sendMessage(text);

print(response.choices.first.message.content)

} on GroqException catch (error) { print(error.message) }

Classes

Groq
GroqResponse

Exceptions / Errors

APIConnectionError
Exception thrown when the API failed
AuthenticationError
Exception thrown when authentication fails
BadRequestError
Exception thrown when the user have a bad request
GroqException
Exception thrown when generating content fails.
InternalServerError
Exception thrown when the server failed to generate content
NotFoundError
Exception thrown when the API is not found
PermissionDeniedError
Exception thrown when the user does not have permissions
RateLimitError
Exception thrown when the user hit the limit
UnprocessableEntityError
Exception thrown when entity is unprocessable