
Google Colab
- Prompt Gemini to generate a transcript of the audio recording.
- Trace Gemini API calls and send the traces to the Arize AX platform with links to audio file for playback.
- Evaluate the transcription output from Gemini for sentiment analysis using Phoenix Evals and Gemini LLM (LLM as a Judge).
Install dependencies
Configure your Gemini API key
To run the following cell, your API key must be stored it in a Colab Secret namedGEMINI_API_KEY. If you don’t already have an API key, or you’re not sure how to create a Colab Secret, see Authentication for an example.
Load an audio file sample and set the URL
Tracing setup
You’ll need to set Arize AX variables (Space id, API key and Developer Key) below to send traces to the Arize AX Platform. Sign up for free here.Configure prompt
Call Gemini
Evaluate Gemini’s output transcript for sentiment analysis
First, export spans from Arize AX that contain transcript output from Arize AXEvaluation Template
Evaluate transcriptions using Gemini as a LLM as a Judge
Send evaluations to Arize AX
Next Steps
Useful API references:
More details about Gemini API’s vision capabilities in the documentation. If you want to know about the File API, check its API reference or the File API quickstart.Related examples
Check this example using the audio files to give you more ideas on what the gemini API can do with them:- Share Voice memos with Gemini API and brainstorm ideas