In this talk, I quickly walk through the basics of Google Gemini. We then play with AI Studio to test Gemini using a pre-built UI. Finally, we create our own web service using Project IDX as our IDE and then deploy it to Google Cloud Run using Google Cloud Build.
- Open Project IDX
- Click the Import a repo button
- Paste the URL of this repo (or your forked instance of it)
- Open the Terminal in your IDX
- run
npm install
- Get your AI Studio API key (see slide 17)
- Create a new file at the root of the project named .env
- Add a new line to the file as follows
API_KEY=[YOUR_KEY_GOES_HERE]
- Hard Restart the IDX Preview window from its refresh icon menu
- Test a GET on your web service by passing in a prompt URL parameter
- Open the Command Pallet and choose: Project IDX: Generate Access Token
- Open the Terminal in IDX
- Enter
export ACCESS_TOKEN=[YOUR_ACCESS_TOKEN]
- If you don't know your port, click on the Output view in the Panel and select IDX in the dropdown
- In the Terminal enter
curl -H "Content-Type: application/json" -H "Authorization: Bearer $ACCESS_TOKEN" -d '{ "model": "gemini-1.5-pro", "prompt": "What is the capital of Nevada"}' -X POST https://9002-$WEB_HOST