
    qi
                         d Z ddlmZ ddlmZ  G d de      Z G d de      Z G d d	e      Z G d
 de      Z G d de      Z	 G d de      Z
 G d de      Zy)zMetrics data models for Pipecat framework.

This module defines Pydantic models for various types of metrics data
collected throughout the pipeline, including timing, token usage, and
processing statistics.
    )Optional)	BaseModelc                   0    e Zd ZU dZeed<   dZee   ed<   y)MetricsDatazBase class for all metrics data.

    Parameters:
        processor: Name of the processor generating the metrics.
        model: Optional model name associated with the metrics.
    	processorNmodel)__name__
__module____qualname____doc__str__annotations__r   r        j/home/ccuser/rateright-growth/voice-assistant/venv/lib/python3.12/site-packages/pipecat/metrics/metrics.pyr   r      s     NE8C=r   r   c                       e Zd ZU dZeed<   y)TTFBMetricsDataziTime To First Byte (TTFB) metrics data.

    Parameters:
        value: TTFB measurement in seconds.
    valueNr	   r
   r   r   floatr   r   r   r   r   r           Lr   r   c                       e Zd ZU dZeed<   y)ProcessingMetricsDatazrGeneral processing time metrics data.

    Parameters:
        value: Processing time measurement in seconds.
    r   Nr   r   r   r   r   r   )   r   r   r   c                   l    e Zd ZU dZeed<   eed<   eed<   dZee   ed<   dZee   ed<   dZ	ee   ed<   y)	LLMTokenUsagea  Token usage statistics for LLM operations.

    Parameters:
        prompt_tokens: Number of tokens in the input prompt.
        completion_tokens: Number of tokens in the generated completion.
        total_tokens: Total number of tokens used (prompt + completion).
        cache_read_input_tokens: Number of tokens read from cache, if applicable.
        cache_creation_input_tokens: Number of tokens used to create cache entries, if applicable.
    prompt_tokenscompletion_tokenstotal_tokensNcache_read_input_tokenscache_creation_input_tokensreasoning_tokens)
r	   r
   r   r   intr   r   r   r    r!   r   r   r   r   r   3   sH     -1Xc]115#5&*hsm*r   r   c                       e Zd ZU dZeed<   y)LLMUsageMetricsDatazpLLM token usage metrics data.

    Parameters:
        value: Token usage statistics for the LLM operation.
    r   N)r	   r
   r   r   r   r   r   r   r   r$   r$   F   s     r   r$   c                       e Zd ZU dZeed<   y)TTSUsageMetricsDataznText-to-Speech usage metrics data.

    Parameters:
        value: Number of characters processed by TTS.
    r   N)r	   r
   r   r   r"   r   r   r   r   r&   r&   P   s     Jr   r&   c                   D    e Zd ZU dZeed<   eed<   eed<   eed<   eed<   y)SmartTurnMetricsDataa  Metrics data for smart turn predictions.

    Parameters:
        is_complete: Whether the turn is predicted to be complete.
        probability: Confidence probability of the turn completion prediction.
        inference_time_ms: Time taken for inference in milliseconds.
        server_total_time_ms: Total server processing time in milliseconds.
        e2e_processing_time_ms: End-to-end processing time in milliseconds.
    is_completeprobabilityinference_time_msserver_total_time_mse2e_processing_time_msN)r	   r
   r   r   boolr   r   r   r   r   r(   r(   Z   s'     !!r   r(   N)r   typingr   pydanticr   r   r   r   r   r$   r&   r(   r   r   r   <module>r1      sf     	 ) 	 k K +I +&+ + "; "r   