Skip to content

Support for gemini file search? #4376

Description

@johnkwaters

I want to use gemini file search RAG pipeline in my llm in my python agent but can't find the correct syntax. What do you suggest?

`
import os
from livekit.plugins import google
from google.genai import types

def create_llm():
if os.environ.get("GOOGLE_API_KEY"):
# File search store ID usually looks like 'fileSearchStores/...'
store_id = os.environ.get("GEMINI_STORE_ID")

    return google.LLM(
        model="gemini-2.0-flash-exp", 
        # This is the correct parameter for built-in tools like RAG
        _gemini_tools=[
            types.Tool(
                file_search=types.FileSearch(
                    file_search_store_names=[store_id]
                )
            )
        ]
    )
return None

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions