o
    i                     @   s@  U d dl Z ddlmZmZmZmZ ddlmZmZm	Z	m
Z
 d dlmZ G dd deZG d	d
 d
eZedddeddddde	d e
dddddddgdZeed eddddeedddedddedd ded!d"ded#d$dgd$d%d&ddgddddeddddd'Zeed(< G d)d* d*e jZed+kre   dS dS ),    N   )*convert_to_parsed_chat_completion_responseParsedChatCompletionResponseParsedChatCompletionChoiceParsedAssistantMessage   )ChatCompletionResponse	UsageInfoChatCompletionChoiceAssistantMessage)	BaseModelc                   @   s   e Zd ZU eed< eed< dS )ExplanationexplanationoutputN)__name__
__module____qualname__str__annotations__ r   r   l/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/mistralai/extra/tests/test_struct_chat.pyr      s   
 r   c                   @   s"   e Zd ZU ee ed< eed< dS )MathDemonstrationstepsfinal_answerN)r   r   r   listr   r   r   r   r   r   r   r      s   
 r    c0271b2098954c6094231703875ca0bczchat.completionzmistral-large-latestK      i'  )prompt_tokenscompletion_tokenstotal_tokensiFgaM  {
  "final_answer": "x = -4",
  "steps": [
    {
      "explanation": "Start with the given equation.",
      "output": "8x + 7 = -23"
    },
    {
      "explanation": "Subtract 7 from both sides to isolate the term with x.",
      "output": "8x = -23 - 7"
    },
    {
      "explanation": "Simplify the right side of the equation.",
      "output": "8x = -30"
    },
    {
      "explanation": "Divide both sides by 8 to solve for x.",
      "output": "x = -30 / 8"
    },
    {
      "explanation": "Simplify the fraction to get the final answer.",
      "output": "x = -4"
    }
  ]
}F	assistant)content
tool_callsprefixrolestop)indexmessagefinish_reason)idobjectmodelusagecreatedchoiceszStart with the given equation.z8x + 7 = -23)r   r   z6Subtract 7 from both sides to isolate the term with x.z8x = -23 - 7z(Simplify the right side of the equation.z8x = -30z&Divide both sides by 8 to solve for x.zx = -30 / 8z.Simplify the fraction to get the final answer.zx = -4)r   r   )r"   r#   r$   r%   parsed)r/   r.   r*   r,   r+   r-   expected_responsec                   @   s   e Zd Zdd ZdS ))TestConvertToParsedChatCompletionResponsec                 C   s   t tt}| |t d S )N)r   mock_cc_responser   assertEqualr1   )selfr   r   r   r   /test_convert_to_parsed_chat_completion_response_   s   zYTestConvertToParsedChatCompletionResponse.test_convert_to_parsed_chat_completion_responseN)r   r   r   r6   r   r   r   r   r2   ^   s    r2   __main__)unitteststruct_chatr   r   r   r   modelsr   r	   r
   r   pydanticr   r   r   r3   r1   r   TestCaser2   r   mainr   r   r   r   <module>   s   
 %.