Generate Audio with Google Live API
Promptfoo example evaluating audio generation through Google's Live API with Gemini models.
Why it matters
Leverage Google's Live API and Gemini models to generate audio content. This prompt chain facilitates the creation of audio outputs through a structured process.
Outcomes
What it gets done
Generate audio using Google's Live API
Utilize Gemini models for audio creation
Process audio through a prompt chain
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-google-live-audio | bash Steps
Steps in the chain
Overview
Google Live Audio
This promptfoo example evaluates audio generation through Google's Live API with Gemini models, using a minimal ready-to-run config. Use it when you need to test Gemini's Live API audio-generation capability with promptfoo; not applicable to text-only Gemini evaluation.
What it does
This promptfoo example demonstrates using Google's Live API for audio generation with Gemini models, evaluating speech output through promptfoo's standard eval flow.
When to use - and when NOT to
Use it when you want to test Gemini's Live API audio-generation capability with promptfoo. Do not use it if you need text-only Gemini evaluation - this example is scoped specifically to Live API audio generation.
Inputs and outputs
Requires a GOOGLE_API_KEY environment variable, obtainable from the Google AI Studio website. Running promptfoo eval -c promptfooconfig.yaml generates audio outputs from the configured test cases; results are viewable with promptfoo view.
Integrations
Runs via npx promptfoo@latest init --example google-live-audio, then promptfoo eval -c promptfooconfig.yaml and promptfoo view.
Who it's for
Developers evaluating Gemini's Live API for audio and speech generation who need a minimal working promptfoo config to start from.
Source README
google-live-audio (Google Live API Audio with Gemini)
This example demonstrates how to use promptfoo with Google's Live API for audio generation using Gemini models.
You can run this example with:
npx promptfoo@latest init --example google-live-audio
cd google-live-audio
Prerequisites
- Google AI Studio API key set as the environment variable
GOOGLE_API_KEY
You can obtain a Google AI Studio API key from the Google AI Studio website.
Running the Example
promptfoo eval -c promptfooconfig.yaml
View the results:
promptfoo view
For more information about the Google Live API, see the Google AI Speech Generation documentation.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.