Hello! I am making an app with the Gemini API in Unity, and I thought I’d share the code I used to interact with the Gemini API!
UGemini is a free and open-source Unity package available on OpenUPM and GitHub which allows you to interface the Gemini API through C# code without handling the requests themselves!
The package supports both versions of the API, the general support is listed below:
-
models
endpoint
-
cachedContents
endpoint
-
corpora
endpoint
-
files
endpoint
-
media
endpoint
-
tunedModels
endpoint
-
operations
endpoint
- Not all methods/features are supported
- Using the v1beta API
Any and all feedback is appreciated!
OpenUPM Package
you kiddin me, have you tried it?
you kiddin me, have you tried it?
I see that Gemini is improving and that it’s cheaper than GPT, so I’m using the package in some of my in-development apps. I’ve also included some samples in the package to help.
Since my last update here, I’ve added a lot of new features!
-
models
endpoint
-
get
method
-
list
method
-
streamGenerateContent
method
-
files
endpoint
-
delete
method
-
get
method
-
list
method
-
media
endpoint
- Using the v1beta API
The documentation is also available here: UGemini/UGemini/Packages/com.uralstech.ugemini/Documentation~/README.md at master · Uralstech/UGemini · GitHub
See UGemini: Main Page for reference manual.
Update! The whole models
endpoint should now be supported in the preview! Also, I forgot to mention that tunedModels.generateContent
is supported.
Update: I’ve restructured the classes in the package and have updated the existing endpoints to match the recent updates to the Gemini API, including support for Code Execution! The updates are still in preview and have not been tested yet.
All of cachedContents
and Code Execution is now supported, in production! I’ve also added in full support for tunedModels
, but that’s in preview right now and is unstable.
Full tunedModels
support has been released. The operations
and tunedModels.operations
endpoints are also supported through package dependency UCloud.Operations.