API Reference
Learn about the NeoCortex Unity SDK methods and events
After setting up the Neocortex SDK in your Unity project, you can start using the APIs to interact with the Neocortex project.
Neocortex Smart Agent Component
The Neocortex Smart Agent
component is the main component that allows you to interact with the Neocortex project.
Methods
TextToText
Send a text message to the Neocortex project, and expect a text response.
- Parameters:
- message: The text message to send.
TextToAudio
Send a text message to the Neocortex project, and expect a audio response.
- Parameters:
- message: The text message to send.
AudioToText
Sends an audio clip to the Neocortex project. This method is used with NeocortexAudioReceiver
component to send audio data.
- Parameters:
- audioClip: The audio clip to send.
AudioToAudio
Sends an audio clip to the Neocortex project and expects an audio response. This method is used with NeocortexAudioReceiver
component to send audio data.
- Parameters:
- audioClip: The audio clip to send.
Events
OnChatResponseReceived
Event that is triggered when the Neocortex project responds to a text message.
- Arguements:
- response: The response from the Neocortex project.
OnTranscriptionReceived
Event that is triggered when the Neocortex project transcribes an audio message to text.
- Arguements:
- message: The transcribed audio message.
OnAudioResponseReceived
Event that is triggered when the Neocortex project responds with an audio message.
- Arguements:
- audioClip: The audio clip received from the Neocortex project.
OnRequestFailed
Event that is triggered when a request to the Neocortex project fails.
- Arguements:
- error: The error message.
Neocortex Audio Receiver Component
The NeocortexAudioReceiver
component is used to record audio data from the microphone via loudness of the souned, so you can have a hands free chat with the smart agent. On this component you can:
- pick the microphone device to use
- set the amplitude threshold for when to start and stop recording
- set the max wait time for the recording to automatically stop if no sound is detected
Methods
StartMicrophone
Starts recording audio from the microphone.
StopMicrophone
Stops recording audio from the microphone
Events
OnAudioRecorded
Event that is triggered when audio data is recorded from the microphone.
- Arguements:
- audioClip: The recorded audio clip.