A Unity C# wrapper for the Google Gemini API.
This should work on any reasonably modern Unity version. Built and tested in Unity 2022.3.29f1.
- Open project settings
- Select
Package Manager
- Add the OpenUPM package registry:
- Name:
OpenUPM
- URL:
https://package.openupm.com
- Scope(s)
com.uralstech
com.utilities
*
- Name:
- Open the Unity Package Manager window (
Window
->Package Manager
) - Change the registry from
Unity
toMy Registries
- Add the
UGemini
,Utilities.Async
* andUtilities.Encoder.Wav
* packages
- Open the Unity Package Manager window (
Window
->Package Manager
) - Select the
+
icon andAdd package from git URL...
- Paste the UPM branch URL and press enter:
https://github.com/Uralstech/UGemini.git#upm
Adding additional dependencies:
Follow the steps detailed in the OpenUPM installation method and only install the Utilities.Async
* and Utilities.Encoder.Wav
* packages.
- Clone or download the repository from the desired branch (master, preview/unstable)
- Drag the package folder
UGemini/UGemini/Packages/com.uralstech.ugemini
into your Unity project'sPackages
folder - In the
Packages
folder of your project, add the following line to the list inmanifest.json
:"com.uralstech.ugemini": "1.x.x",
Adding additional dependencies:
Follow the steps detailed in the OpenUPM installation method and only install the Utilities.Async
* and Utilities.Encoder.Wav
* packages.
*Optional, but Utilities.Async
is required for streaming content and Utilities.Encoder.Wav
is recommended if you don't want to bother with encoding your AudioClips into Base64 strings manually.
-
models
endpoint-
batchEmbedContents
method -
countTokens
method -
embedContent
method -
generateAnswer
method 🧪 -
generateContent
method -
get
method -
list
method -
streamGenerateContent
method
-
-
cachedContents
endpoint 🧪 -
corpora
endpoint 🧪 -
files
endpoint 🧪-
delete
method -
get
method -
list
method
-
-
media
endpoint 🧪-
upload
method
-
-
tunedModels
endpoint⚠️ -
generateContent
method
-
-
operations
endpoint
🚧 - The feature is being worked on and is unstable
🧪 - Using the v1beta API
See https://uralstech.github.io/UGemini/ or refman.pdf
in the package documentation for reference manual w/ tutorial.