
    qi                         d Z ddlmZmZ ddlmZmZ ddlmZ e G d d             Z	e G d d             Z
e G d	 d
e             Zy)a  Google AI service frames for search and grounding functionality.

This module defines specialized frame types for handling search results
and grounding metadata from Google AI models, particularly for Gemini
models that support web search and fact grounding capabilities.
    )	dataclassfield)ListOptional)	DataFramec                   >    e Zd ZU dZeed<    ee      Ze	e
   ed<   y)LLMSearchResultzRepresents a single search result with confidence scores.

    Parameters:
        text: The search result text content.
        confidence: List of confidence scores associated with the result.
    textdefault_factory
confidenceN)__name__
__module____qualname____doc__str__annotations__r   listr   r   float     P/opt/pipecat/venv/lib/python3.12/site-packages/pipecat/services/google/frames.pyr	   r	      s!     I#D9JU9r   r	   c                   \    e Zd ZU dZdZee   ed<   dZee   ed<    e	e
      Zee   ed<   y)LLMSearchOriginzRepresents the origin source of search results.

    Parameters:
        site_uri: URI of the source website.
        site_title: Title of the source website.
        results: List of search results from this origin.
    Nsite_uri
site_titler   results)r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   !   s9     #Hhsm" $J$%*4%@GT/"@r   r   c                   b    e Zd ZU dZdZee   ed<   dZee   ed<    e	e
      Zee   ed<   d Zy)LLMSearchResponseFramea*  Frame containing search results and grounding information from Google AI models.

    This frame is used to convey search results and grounding metadata
    from Google AI models that support web search capabilities. It includes
    the search result text, rendered content, and detailed origin information
    with confidence scores.

    Parameters:
        search_result: The main search result text.
        rendered_content: Rendered content from the search entry point.
        origins: List of search result origins with detailed information.
    Nsearch_resultrendered_contentr   originsc                 <    d| j                    d| j                   dS )zReturn string representation of the search response frame.

        Returns:
            String representation showing search result and origins.
        z%LLMSearchResponseFrame(search_result=z
, origins=))r    r"   )selfs    r   __str__zLLMSearchResponseFrame.__str__C   s)     7t7I7I6J*UYUaUaTbbcddr   )r   r   r   r   r    r   r   r   r!   r   r   r"   r   r   r&   r   r   r   r   r   0   s@     $(M8C='&*hsm*%*4%@GT/"@er   r   N)r   dataclassesr   r   typingr   r   pipecat.frames.framesr   r	   r   r   r   r   r   <module>r*      sh    ) ! + 	: 	: 	: A A A eY e er   