Creating Snippets
Create code snippets with one click.
Once you've added your models or voices to the library, you can create reusable code snippets using the "Create Snippets" button located at the bottom of the Model Library or Voice Library window.
How to Create a Snippet

Add at least one model or voice to your library (if you haven’t already)
Click the “Create Snippets” button
Snippets will be automatically generated and saved as C# files in your project (usually under
Assets/AIDevKit/Snippets/
)
Using Snippets
Once created, you can call your saved model or voice like this:
"My prompt here"
.GENResponse()
.SetModel(OpenAIModels.GPT4o)
.ExecuteAsync();
"Hello!"
.GENSpeech()
.SetVoice(ElevenLabsVoices.Rachel)
.ExecuteAsync();
These snippets are especially useful for:
Auto-complete
Reducing errors
Keeping your AI calls consistent across your project
Last updated