This is a simple example to make API call to Google Gemini using OkHttpUtils2 and Json libraries.
Streaming is not implemented.
Get API Key: https://aistudio.google.com/api-keys
Learn more: https://ai.google.dev/gemini-api/docs/quickstart#java
Basic code is provided by Gemini but I added features for:
1. reading API key from text file and
2. save the response to a text file.
GitHub: https://github.com/pyhoon/Gemini_UI
Streaming is not implemented.
Get API Key: https://aistudio.google.com/api-keys
Learn more: https://ai.google.dev/gemini-api/docs/quickstart#java
Basic code is provided by Gemini but I added features for:
1. reading API key from text file and
2. save the response to a text file.
GitHub: https://github.com/pyhoon/Gemini_UI
Attachments
Last edited: