Groq-Unity is an open-source Unity integration for Groq's AI APIs.
๐ Built on top of jgravelle/GroqApiLibrary, fully adapted for Unity with samples and MonoBehaviour support.
- โ Chat Completion with Mixtral / LLaMA models
- ๐๏ธ Speech Synthesis (TTS) using
playai-ttsvoices - ๐งพ Transcription using
whisper-large-v3 - ๐งฎ Function Calling & Tool Use from within Unity
- ๐ Built-in audio player for TTS & transcription demos
- ๐ง Simple MonoBehaviour components for easy use in scenes
- Unity 6+(tested)
- A valid Groq API Key
- Clone or download this repository
- (Optional) If you want are integrating these scripts into your project, install NuGet for Unity and the packages: "System.Net.Http.Json"
- Add your Groq API Key in the relevant script or config field
- Open the sample scene, enable one of the 5 sample gameobjects, hit play.
- For TTS sample, go to https://console.groq.com/playground?model=playai-tts and accept the terms.
| Feature | Scene / Script | Description |
|---|---|---|
| ๐ก Chat | GroqChat.cs |
Simple text prompt and response using Mixtral |
| ๐ฃ๏ธ TTS | GroqTTS.cs |
Uses playai-tts to generate speech from text and play it |
| ๐ง Transcription | WhisperTranscriber.cs |
Record mic input and transcribe with whisper-large-v3 |
| ๐งฐ Tool Calling | GroqToolSample.cs |
Run a tool (e.g. spawn colored cubes) via structured function call |
| ๐๏ธ Voice Enum | GroqTTS.cs |
Enum of all available voices for TTS selection in the Editor |