"Groq" (Service Connection)
Connecting & Authenticating
Requests
"TestConnection" — returns Success for working connection, Failure otherwise
Text
"Chat" — create a response for the given chat conversation
| "Messages" | (required) | a list of messages in the conversation, each given as an association with "Role" and "Content" keys | |
| "FrequencyPenalty" | Automatic | penalize tokens based on their existing frequency in the text so far (between -2 and 2) | |
| "MaxTokens" | Automatic | maximum number of tokens to generate | |
| "Model" | Automatic | name of the model to use | |
| "N" | Automatic | number of completions to return | |
| "PresencePenalty" | Automatic | penalize new tokens based on whether they appear in the text so far (between -2 and 2) | |
| "StopTokens" | Automatic | strings where the API will stop generating further tokens | |
| "Stream" | False | return the result as server-sent events | |
| "Temperature" | Automatic | sampling temperature | |
| "ToolChoice" | Automatic | which (if any) tool is called by the model | |
| "Tools" | Automatic | one or more LLMTool objects available to the model | |
| "TotalProbabilityCutoff" | Automatic | an alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with the requested probability mass | |
| "User" | Automatic | unique identifier representing the end user |
Audio
"AudioTranscription" — transcribe an audio recording into the input language
| "Audio" | (required) | the Audio object to transcribe | |
| "Language" | Automatic | language of the input audio | |
| "Model" | Automatic | name of the model to use | |
| "Prompt" | None | optional text to guide the model's style or continue a previous audio segment | |
| "Temperature" | Automatic | sampling temperature (between 0 and 1) | |
| "TimestampGranularities" | Automatic | the timestamp granularity of transcription (either "word" or "segment") |
"AudioTranslation" — translate an audio recording into English
| "Audio" | (required) | the Audio object to translate | |
| "Model" | Automatic | name of the model to use | |
| "Prompt" | None | optional text to guide the model's style or continue a previous audio segment | |
| "Temperature" | Automatic | sampling temperature (between 0 and 1) |
Model Lists
"ChatModelList" — list models available for the "Chat" request
Examples
open all close allBasic Examples (1)
Scope (5)
Text (2)
Chat (1)
Respond to a chat containing multiple messages:
ServiceExecute["Groq", "Chat", {"Messages" -> {
<|"Role" -> "User", "Content" -> "What's the tallest mountain?"|>,
<|"Role" -> "Assistant", "Content" -> "The highest mountain in the world is Mount Everest."|>,
<|"Role" -> "User", "Content" -> "How tall is it?"|>
}}]Audio (2)
AudioTranscription (1)
Transcribe an Audio object:
ServiceExecute["Groq", "AudioTranscription", {"Audio" -> ExampleData[{"Audio", "MaleVoice"}]}]Use a prompt to provide context for the transcription:
ServiceExecute["Groq", "AudioTranscription", {"Audio" -> ExampleData[{"Audio", "MaleVoice"}], "Prompt" -> "in a welsh farm, just before noon"}]Transcribe a recording made in a different language:
ServiceExecute["Groq", "AudioTranscription", {"Audio" -> \!\(\*AudioBox[""]\), "Language" -> Entity["Language", "Italian::39fbj"]}]Increase the temperature used for the sampling:
ServiceExecute["Groq", "AudioTranscription", {"Audio" -> ExampleData[{"Audio", "MaleVoice"}], "Temperature" -> .9}]AudioTranslation (1)
Translate an Audio object into English:
ServiceExecute["Groq", "AudioTranslation", {"Audio" -> ExampleData[{"Audio", "MaleVoice"}]}]Use a prompt to provide context for the translation:
ServiceExecute["Groq", "AudioTranslation", {"Audio" -> \!\(\*AudioBox[""]\), "Prompt" -> "in a welsh farm, just before noon"}]Increase the temperature used for the sampling:
ServiceExecute["Groq", "AudioTranscription", {"Audio" -> ExampleData[{"Audio", "MaleVoice"}], "Temperature" -> 1}]See Also
ServiceExecute ▪ ServiceConnect ▪ LLMFunction ▪ LLMSynthesize ▪ ChatEvaluate ▪ LLMConfiguration
Service Connections: AlephAlpha ▪ Anthropic ▪ Cohere ▪ DeepSeek ▪ GoogleGemini ▪ MistralAI ▪ OpenAI ▪ TogetherAI
History
Introduced in 2024 (14.1)