Hi there, is there anyone who is successfully usin...
# agents
f
Hi there, is there anyone who is successfully using the Gemini Live API. Here is my experience with Gemini Live models 1. gemini-2.0-flash-exp I initially started testing with the gemini-2.0-flash-exp Pros • This model was able to able to properly
generate_reply
when user joins room. Meaning it was able to conversationally greet user. • Had good latency & would respond quickly in a short period of time Cons • Very poor in Tool calling. • Hallucination. It starts to make things up especially when it fails the tool calls 2. gemini-2.5-flash-preview Currently testing this. I want to find a way to improve on this model. Pros • GREAT at tool/function calling. It's able to amazingly perform and execute tools very well with not many failures Cons • Doesn't
generate_reply
when user joins the room. It expects the user to initiate the talk. • Poor Latency. Sometimes takes long to reply and even sometimes doesn't respond until I repeat multiple times 3. gemini-2.5-flash-preview-native-audio-dialog and gemini-2.5-flash-exp-native-audio-thinking-dialog Pros • ?? - Nothing (Didn't satisfy what I'm looking fro) Cons • NO Tool calling. Couldn't successfully calls my available tools • Hallucination. Makes things up when it fails to execute tools • Doesn't
generate_reply
when user joins the room. It expects the user to initiate the talk. • Poor Latency. Sometimes takes long to reply and even sometimes doesn't respond until I repeat multiple times ---------- What I'm looking for • Good Tool calling. I'm looking for a model that's able to do great tool calling. This is very important because my agent will be taking financial action for the user through voice commands. • Can
generate_reply
when user joins room. I want the agent to greet the user when user joins room • Low latency. The model shouldn't take long to reply back to the user • NO Hallucination. The model shouldn't make things up when for example it fails to call a tool • Good user conversation. It should be able to normally converse with the user with a good tone & attitude. I'm liking the gemini-2.5-flash-preview model because it's amazing in tool calling. But don't like it coz it can't
generate_reply
and has some poor latency. ------------- For those who have had success with Gemini Live AI, please recommend the gemini models that have worked well for you. Any advice is highly appreciated.
n
Have you tried using MCP?
m
For generate reply part I notice livekit-agents and livekit-(name of plugin) ahould be at 1.1.6 instead of 1.2.2 which is last release so far and it works.
j
there was a bug in
generate_reply
for gemini realtime model in 1.2.2, it’s fixed in this pr and will be released in next version
w
Great analysis of gemini. I think once they fix the Tool calling in gemini-2.5-flash-preview-native-audio-dialog and lower the price a little bit this would be the GOTO model for everything
n
@worried-waitress-27519 Why is that? Is it very affordable? How many concurrent users can it handle?
f
@narrow-chef-82684 No, I haven't yet started testing an MCP because the APIs I'm calling are internal and it's much easy for me to create tools in livekit agent consuming the APIs
@jolly-air-155 I have looked at the PR solving the
generate_reply
issue & retested the agent, but I'm still facing the issue of the gemini model not generating reply when
generate_reply
. I have updated the livekit-agents to 1.2.2 as you can see in the attached image; When I retested, I still face the face of reply not being generated when participant joins room. The gemini models of 'gemini-live-2.5-flash-preview-native-audio' and 'gemini-live-2.5-flash-preview' got the below error(I have also attached the image); While the models of 'gemini-2.5-flash-preview-native-audio-dialog'and 'gemini-2.0-flash-live-001' didn't get an error, but they need me to initiate the conversation and only respond when I first speak. Here is how my code looks like;
Copy code
from dotenv import load_dotenv
from livekit import agents
from livekit.agents import AgentSession, Agent, RoomInputOptions
from livekit.plugins import (
    google,
    noise_cancellation,
)

load_dotenv()


class Assistant(Agent):
    def __init__(self) -> None:
        super().__init__(instructions="You are a helpful voice AI assistant.")

async def entrypoint(ctx: agents.JobContext):
    session = AgentSession(
    llm=google.beta.realtime.RealtimeModel(
        model="gemini-2.5-flash-preview-native-audio-dialog",
        # model="gemini-live-2.5-flash-preview-native-audio",
        # model="gemini-live-2.5-flash-preview",
        # model="gemini-2.0-flash-live-001",
        voice="Puck",
        temperature=0.8,
        instructions="You are a helpful assistant",
    ),
  )

    await session.start(
        room=ctx.room,
        agent=Assistant(),
        room_input_options=RoomInputOptions(
            # LiveKit Cloud enhanced noise cancellation
            # - If self-hosting, omit this parameter
            # - For telephony applications, use `BVCTelephony` for best results
            noise_cancellation=noise_cancellation.BVC(),
        ),
    )
    await session.generate_reply(
        instructions="Greet the user and offer your assistance."
    )

if __name__ == "__main__":
    agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint))
What am I doing wrong? What is the correct gemini model that does support
generate_reply
. Please help
j
the fix is included in 1.2.3 just released
👍 2
f
Thanks @jolly-air-155, version 1.2.3 works fine and is able to
generate_reply
.