Module livekit.plugins.google.tools

Classes

class FileSearch (file_search_store_names: list[str],
top_k: int | None = None,
metadata_filter: str | None = None)
Expand source code
@dataclass
class FileSearch(GeminiTool):
    file_search_store_names: list[str]
    top_k: Optional[int] = None
    metadata_filter: Optional[str] = None

    def to_tool_config(self) -> types.Tool:
        return types.Tool(
            file_search=types.FileSearch(
                file_search_store_names=self.file_search_store_names,
                top_k=self.top_k,
                metadata_filter=self.metadata_filter,
            )
        )

FileSearch(file_search_store_names: list[str], top_k: Optional[int] = None, metadata_filter: Optional[str] = None)

Ancestors

  • GeminiTool
  • livekit.agents.llm.tool_context.ProviderTool
  • livekit.agents.llm.tool_context.Tool
  • abc.ABC

Instance variables

var file_search_store_names : list[str]
var metadata_filter : str | None
var top_k : int | None

Methods

def to_tool_config(self) ‑> google.genai.types.Tool
Expand source code
def to_tool_config(self) -> types.Tool:
    return types.Tool(
        file_search=types.FileSearch(
            file_search_store_names=self.file_search_store_names,
            top_k=self.top_k,
            metadata_filter=self.metadata_filter,
        )
    )
class GeminiTool
Expand source code
class GeminiTool(llm.ProviderTool, ABC):
    @abstractmethod
    def to_tool_config(self) -> types.Tool: ...

Tool that provided by the LLM provider.

Ancestors

  • livekit.agents.llm.tool_context.ProviderTool
  • livekit.agents.llm.tool_context.Tool
  • abc.ABC

Subclasses

Methods

def to_tool_config(self) ‑> google.genai.types.Tool
Expand source code
@abstractmethod
def to_tool_config(self) -> types.Tool: ...
class GoogleMaps (auth_config: google.genai.types.AuthConfig | None = None,
enable_widget: bool | None = None)
Expand source code
@dataclass
class GoogleMaps(GeminiTool):
    auth_config: Optional[types.AuthConfig] = None
    enable_widget: Optional[bool] = None

    def to_tool_config(self) -> types.Tool:
        return types.Tool(
            google_maps=types.GoogleMaps(
                auth_config=self.auth_config,
                enable_widget=self.enable_widget,
            )
        )

GoogleMaps(auth_config: Optional[google.genai.types.AuthConfig] = None, enable_widget: Optional[bool] = None)

Ancestors

  • GeminiTool
  • livekit.agents.llm.tool_context.ProviderTool
  • livekit.agents.llm.tool_context.Tool
  • abc.ABC

Instance variables

var auth_config : google.genai.types.AuthConfig | None
var enable_widget : bool | None

Methods

def to_tool_config(self) ‑> google.genai.types.Tool
Expand source code
def to_tool_config(self) -> types.Tool:
    return types.Tool(
        google_maps=types.GoogleMaps(
            auth_config=self.auth_config,
            enable_widget=self.enable_widget,
        )
    )
class GoogleSearch (exclude_domains: list[str] | None = None,
blocking_confidence: google.genai.types.PhishBlockThreshold | None = None,
time_range_filter: google.genai.types.Interval | None = None)
Expand source code
@dataclass
class GoogleSearch(GeminiTool):
    exclude_domains: Optional[list[str]] = None
    blocking_confidence: Optional[types.PhishBlockThreshold] = None
    time_range_filter: Optional[types.Interval] = None

    def to_tool_config(self) -> types.Tool:
        return types.Tool(
            google_search=types.GoogleSearch(
                exclude_domains=self.exclude_domains,
                blocking_confidence=self.blocking_confidence,
                time_range_filter=self.time_range_filter,
            )
        )

GoogleSearch(exclude_domains: Optional[list[str]] = None, blocking_confidence: Optional[google.genai.types.PhishBlockThreshold] = None, time_range_filter: Optional[google.genai.types.Interval] = None)

Ancestors

  • GeminiTool
  • livekit.agents.llm.tool_context.ProviderTool
  • livekit.agents.llm.tool_context.Tool
  • abc.ABC

Instance variables

var blocking_confidence : google.genai.types.PhishBlockThreshold | None
var exclude_domains : list[str] | None
var time_range_filter : google.genai.types.Interval | None

Methods

def to_tool_config(self) ‑> google.genai.types.Tool
Expand source code
def to_tool_config(self) -> types.Tool:
    return types.Tool(
        google_search=types.GoogleSearch(
            exclude_domains=self.exclude_domains,
            blocking_confidence=self.blocking_confidence,
            time_range_filter=self.time_range_filter,
        )
    )
class ToolCodeExecution
Expand source code
class ToolCodeExecution(GeminiTool):
    def to_tool_config(self) -> types.Tool:
        return types.Tool(
            code_execution=types.ToolCodeExecution(),
        )

Tool that provided by the LLM provider.

Ancestors

  • GeminiTool
  • livekit.agents.llm.tool_context.ProviderTool
  • livekit.agents.llm.tool_context.Tool
  • abc.ABC

Methods

def to_tool_config(self) ‑> google.genai.types.Tool
Expand source code
def to_tool_config(self) -> types.Tool:
    return types.Tool(
        code_execution=types.ToolCodeExecution(),
    )
class URLContext
Expand source code
class URLContext(GeminiTool):
    def to_tool_config(self) -> types.Tool:
        return types.Tool(
            url_context=types.UrlContext(),
        )

Tool that provided by the LLM provider.

Ancestors

  • GeminiTool
  • livekit.agents.llm.tool_context.ProviderTool
  • livekit.agents.llm.tool_context.Tool
  • abc.ABC

Methods

def to_tool_config(self) ‑> google.genai.types.Tool
Expand source code
def to_tool_config(self) -> types.Tool:
    return types.Tool(
        url_context=types.UrlContext(),
    )