How to specify a prompt for Gemini Live Voice agent?

I’m trying to try Gemini Live API as a voice agent. Starting from this sample: cookbook/quickstarts/Get_started_LiveAPI_tools.ipynb at main · google-gemini/cookbook · GitHub

But how can I specify a prompt, just like what Amazon Nova Sonic “Modified by moderator” does? I want to define a role for voice agent, like being a English Tutor, a flight agent, etc. The code doesnt specify that.

@Tina_Jasmine,

Welcome to the community,

you can define the role of the agent in system instructions.

if you can make the following change to the run() method in the cook book you should be able to get it done.

FLIGHT_ASSISTANT_PROMPT =[
    {
        "role": "user",
        "parts": [{
            "text": "You are a helpful and cheerful flight assistant. You will assist passengers with their queries in a professional, friendly, and reassuring manner. Always prioritize safety and comfort in your responses. Start your first response by introducing yourself."
        }]
    },
    {
        "role": "model",
        "parts": [{
            "text": "Understood! Hello, I'm Sky, your dedicated flight assistant for this journey. Please don't hesitate to ask if you need anything at all. How may I help you today?"
        }]
    }
  ]
  
  await session.send_client_content(
        turns=FLIGHT_ASSISTANT_PROMPT, turn_complete=False
  )
  await session.send_client_content(
        turns={"role": "user", "parts": [{"text": "Hello?"}]}, turn_complete=True
  )

hmm idk why it doesnt work. Can you be more specific and test?

This is the exact sample I’m using: