Ë
    ±q±iô  ã                   ó†   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ e G d„ d	e«      «       Z G d
„ de
«      Zy)zBGroq LLM Service implementation using OpenAI-compatible interface.é    )Ú	dataclass)ÚOptional)Úlogger)ÚOpenAILLMSettings)ÚOpenAILLMService)Ú_warn_deprecated_paramc                   ó   — e Zd ZdZy)ÚGroqLLMSettingszSettings for GroqLLMService.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úK/opt/pipecat/venv/lib/python3.12/site-packages/pipecat/services/groq/llm.pyr
   r
      s   „ á&àr   r
   c            
       óf   ‡ — e Zd ZU dZeZeed<   ddddœdededee   d	ee   fˆ fd
„Z	dˆ fd„	Z
ˆ xZS )ÚGroqLLMServicezöA service for interacting with Groq's API using the OpenAI-compatible interface.

    This service extends OpenAILLMService to connect to Groq's API endpoint while
    maintaining full compatibility with OpenAI's interface and functionality.
    Ú	_settingszhttps://api.groq.com/openai/v1N)Úbase_urlÚmodelÚsettingsÚapi_keyr   r   r   c                óž   •— t        d¬«      }|t        dt         d«       ||_        ||j                  |«       t	        ‰|   d|||dœ|¤Ž y)a  Initialize Groq LLM service.

        Args:
            api_key: The API key for accessing Groq's API.
            base_url: The base URL for Groq API. Defaults to "https://api.groq.com/openai/v1".
            model: The model identifier to use. Defaults to "llama-3.3-70b-versatile".

                .. deprecated:: 0.0.105
                    Use ``settings=OpenAILLMSettings(model=...)`` instead.

            settings: Runtime-updatable settings. When provided alongside deprecated
                parameters, ``settings`` values take precedence.
            **kwargs: Additional keyword arguments passed to OpenAILLMService.
        zllama-3.3-70b-versatile)r   Nr   )r   r   r   r   )r
   r   r   Úapply_updateÚsuperÚ__init__)Úselfr   r   r   r   ÚkwargsÚdefault_settingsÚ	__class__s          €r   r   zGroqLLMService.__init__$   s_   ø€ ô0 +Ð1JÔKÐð ÐÜ" 7¬O¸WÔEØ%*ÐÔ"ð
 ÐØ×)Ñ)¨(Ô3ä‰ÑÐa °8ÐFVÑaÐZ`Óar   c                 óV   •— t        j                  d|› «       t        ‰|   ||fi |¤ŽS )aŽ  Create OpenAI-compatible client for Groq API endpoint.

        Args:
            api_key: API key for authentication. If None, uses instance api_key.
            base_url: Base URL for the API. If None, uses instance base_url.
            **kwargs: Additional arguments passed to the client constructor.

        Returns:
            An OpenAI-compatible client configured for Groq's API.
        zCreating Groq client with api )r   Údebugr   Úcreate_client)r   r   r   r   r    s       €r   r#   zGroqLLMService.create_clientK   s0   ø€ ô 	‰Ð5°h°ZÐ@ÔAÜ‰wÑ$ W¨hÑA¸&ÑAÐAr   )NN)r   r   r   r   r
   ÚSettingsÚ__annotations__Ústrr   r   r#   Ú__classcell__)r    s   @r   r   r      sh   ø… ñð €HØÓð 9Ø#Ø.2ò%bð ð%bð ð	%bð
 ˜‰}ð%bð ˜?Ñ+õ%b÷NBñ Br   r   N)r   Údataclassesr   Útypingr   Úlogurur   Ú pipecat.services.openai.base_llmr   Úpipecat.services.openai.llmr   Úpipecat.services.settingsr   r
   r   r   r   r   ú<module>r.      sH   ðñ Iå !Ý å å >Ý 8Ý <ð ô	Ð'ó 	ó ð	ô=BÐ%õ =Br   