Ë
    ±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)zITogether.ai LLM service implementation using OpenAI-compatible interface.é    )Ú	dataclass)ÚOptional)Úlogger)ÚOpenAILLMSettings)ÚOpenAILLMService)Ú_warn_deprecated_paramc                   ó   — e Zd ZdZy)ÚTogetherLLMSettingsz Settings for TogetherLLMService.N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úO/opt/pipecat/venv/lib/python3.12/site-packages/pipecat/services/together/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 )ÚTogetherLLMServicea  A service for interacting with Together.ai's API using the OpenAI-compatible interface.

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

        Args:
            api_key: The API key for accessing Together.ai's API.
            base_url: The base URL for Together.ai API. Defaults to "https://api.together.xyz/v1".
            model: The model identifier to use. Defaults to "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo".

                .. 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+meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo)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TogetherLLMService.__init__$   s`   ø€ ô0 /Ð5bÔcÐð ÐÜ" 7Ô,?ÀÔIØ%*ÐÔ"ð
 ÐØ×)Ñ)¨(Ô3ä‰ÑÐa °8ÐFVÑaÐZ`Óar   c                 óV   •— t        j                  d|› «       t        ‰|   ||fi |¤ŽS )a¸  Create OpenAI-compatible client for Together.ai API endpoint.

        Args:
            api_key: The API key to use for the client. If None, uses instance api_key.
            base_url: The base URL for the API. If None, uses instance base_url.
            **kwargs: Additional keyword arguments passed to the parent create_client method.

        Returns:
            An OpenAI-compatible client configured for Together.ai's API.
        z%Creating Together.ai client with api )r   Údebugr   Úcreate_client)r   r   r   r   r    s       €r   r#   z TogetherLLMService.create_clientK   s0   ø€ ô 	‰Ð<¸X¸JÐGÔHÜ‰wÑ$ W¨hÑA¸&ÑAÐAr   )NN)r   r   r   r   r
   ÚSettingsÚ__annotations__Ústrr   r   r#   Ú__classcell__)r    s   @r   r   r      si   ø… ñð #€HØ"Ó"ð 6Ø#Ø26ò%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   ðñ På !Ý å å >Ý 8Ý <ð ô	Ð+ó 	ó ð	ô=BÐ)õ =Br   