
    i                        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e      Z G d	 d
e      Z eddd eddd      d e	d  e
dddd      d      g      Z e ed  edddd e edd       edd       edd        ed!d"       ed#d$      gd$%      &      d      gdddd eddd      '      Zeed(<    G d) d*e j$                        Zed+k(  r e j*                          yy),    N   )*convert_to_parsed_chat_completion_responseParsedChatCompletionResponseParsedChatCompletionChoiceParsedAssistantMessage   )ChatCompletionResponse	UsageInfoChatCompletionChoiceAssistantMessage)	BaseModelc                   "    e Zd ZU eed<   eed<   y)ExplanationexplanationoutputN)__name__
__module____qualname__str__annotations__     d/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/mistralai/extra/tests/test_struct_chat.pyr   r      s    Kr   r   c                   (    e Zd ZU ee   ed<   eed<   y)MathDemonstrationstepsfinal_answerN)r   r   r   listr   r   r   r   r   r   r   r      s    r   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)r3   r2   r.   r0   r/   r1   expected_responsec                       e Zd Zd Zy))TestConvertToParsedChatCompletionResponsec                 X    t        t        t              }| j                  |t               y )N)r   mock_cc_responser   assertEqualr5   )selfr   s     r   /test_convert_to_parsed_chat_completion_responsezYTestConvertToParsedChatCompletionResponse.test_convert_to_parsed_chat_completion_response_   s%    ;/
 	!23r   N)r   r   r   r<   r   r   r   r7   r7   ^   s    4r   r7   __main__)unitteststruct_chatr   r   r   r   modelsr	   r
   r   r   pydanticr   r   r   r9   r5   r   TestCaser7   r   mainr   r   r   <module>rD      sv      ) 
	 
 *)
 
"#
N$ @
 	 !		
 * 3O"* @
 (#(H#1 $(`#1 $(R#- $(P#0 $(X#+#, "*/> !C"	
$J )
 
"#
NU+3 / +\40A0A 4 zHMMO r   