π§ Creating an Agent
An agent in UnityNeuroSpeech is a Unity object that can listen, talk, and respond using LLMs.
Once you create your first agent, youβll be able to speak with your AI!
π How to Create an Agent
Go to UnityNeuroSpeech β Create Agent.
You will see the window with these settings:
π€ Agent Parameters
Setting | Description |
---|---|
Model name | Name of the LLM you downloaded via Ollama. |
Agent name | Internal name for your agent. Avoid spaces or dashes. |
System prompt | Base prompt used to control the AIβs behavior and tone. |
β Final Setup in Scene
- Create a
Canvas
in your scene. - Add a
Dropdown
with at least three options and aButton
. - Add an
AudioSource
to your scene. - Create an empty
GameObject
and attach the following scripts: WhisperManager
MicrophoneRecord
YourAgentNameController
SetupWhisperPath
- Configure the scripts:
π§ WhisperManager
- Leave
Model Path
empty. - Turn off:
Is Model Path In StreamingAssets
Init On Awake
Use VAD
- Set
Language
toauto
.
π MicrophoneRecord
- Turn off
Use VAD
- Assign the
Dropdown
toMicrophone Dropdown
.
π€ YourAgentNameController
Agent Settings
: assign theAgent_YourAgentName
ScriptableObject.WhisperManager
,MicrophoneRecord
: assign the same GameObject.- Assign your
Button
,Enable Mic Sprite
,Disable Mic Sprite
, andAudioSource
.
π SetupWhisperPath
- Drag the GameObject into
Whisper
. - For
Model Path
, use:
UnityNeuroSpeech/Whisper/ggml-medium.bin
(replace with your actual file name and folder if moved).
π Start the TTS Server
Run the run_server.bat
file.
β οΈ It must be in the same directory as the Server
folder (i.e., not inside it).
π Thatβs it! When you run the game:
- Select a microphone in the dropdown
- Click the button to start recording
- Speak β click again
- AI responds with voice
β Note
If you want to add more than one agent in one scene, after creating new empty GameObject
, add only YourAgentNameController
script.
π§ Tip
The response delay depends on:
- LLM model size
- Whisper model speed
- TTS processing time