GroqChat class

Constructors

GroqChat(String _model, String _apiKey, GroqChatSettings _settings)
GroqChat constructor model the model id apiKey the api key settings the chat settings

Properties

allMessages List<GroqConversationItem>
Returns a list of all messages in the conversation It is a list of GroqMessage objects and switches from request to response Example:
no setter
allMessagesContent List<String>
Returns a list of all messages content in the conversation It is a list of strings and switches from request to response Example:
no setter
hashCode int
The hash code for this object.
no setterinherited
latestResponse GroqResponse?
Returns the latest response in the conversation
no setter
latestUsage GroqUsage?
Returns the latest resource usage in the conversation
no setter
model String
Returns the model id
no setter
rateLimitInfo GroqRateLimitInformation?
Returns the rate limit information
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings GroqChatSettings
Returns the current chat settings
no setter
stream Stream<ChatEvent>
Returns the chat as a stream Example:
no setter
totalTokens int
Returns the total tokens used in the conversation
no setter

Methods

dispose() → void
Closes the stream
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendMessage(String prompt, {GroqMessageRole role = GroqMessageRole.user, String? username}) Future<(GroqResponse, GroqUsage)>
Sends a new request message to the chat prompt the message content role the message role DO NOT USE assistant, it is reserved for the AI username the username of the message sender (optional) Returns a tuple of the response and the resource usage Example:
switchModel(String modelId) → void
Switches the model of the current conversation dynamically modelId the new model id It is also possible to switch the model during the conversation Example:
switchSettings(GroqChatSettings settings) → void
Switches the settings of the current conversation dynamically settings the new chat settings It is also possible to switch the settings during the conversation Example:
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited