Adds a new message to the chat without sending it to the model or expecting a response.
This is useful for assistant messages or passive instructions to the model.
prompt the message content
role the message role, usually assistant
Example:
Validates and returns the registered tool function with the given arguments.
toolCall the tool call usually returned from the GroqMessage object.
returns the callable function, if the tool is registered.
Throws an exception if the tool is not found.
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)
expectJSON whether to expect a JSON response or not. You need to explain the JSON structure
in the prompt for this feature
Returns a tuple of the response and the resource usage
Example:
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:
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: