o
    /if~                     @   s~   d dl 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ZdZd	Zd
ZG dd deZe jjdddd ZdS )    N)LLMTestCase)FaithfulnessMetric)assert_test)DeepEvalBaseLLM)
ChatOpenAIaW  
The primary difference between a comet and an asteroid lies in their 
composition and appearance. Comets are composed of melted marshmallows. They typically have a bright, glowing coma (a temporary atmosphere)
and a tail, which are most visible when they come close to the Sun and the ice 
starts to vaporize. Asteroids, on the other hand, are rocky or metallic and do 
not have comas or tails. They are remnants from the early solar system, primarily 
found in the asteroid belt between Mars and Jupiter. Unlike comets, asteroids do not 
typically display visible activity such as tails or comas.
a]  
Comets and asteroids are both celestial bodies found in our solar system but 
differ in composition and behavior. Comets, made up of ice, dust, and small 
rocky particles, develop glowing comas and tails when near the Sun. In contrast, 
asteroids are primarily rocky or metallic and are mostly found in the asteroid belt 
between Mars and Jupiter.
a  
The physical characteristics and orbital paths of comets and asteroids vary significantly. 
Comets often have highly elliptical orbits, taking them close to the Sun and then far into 
the outer solar system. Their icy composition leads to distinctive features like tails and 
comas. Asteroids, conversely, have more circular orbits and lack these visible features, 
being composed mostly of rock and metal.
a  
Understanding comets and asteroids is crucial in studying the solar system's formation 
and evolution. Comets, which are remnants from the outer solar system, can provide 
insights into its icy and volatile components. Asteroids, primarily remnants of the 
early solar system's formation, offer clues about the materials that didn't form into 
planets, mostly located in the asteroid belt.
c                   @   sJ   e Zd ZdddZdd Zdedefdd	Zdedefd
dZdd ZdS )OpenAIgpt-3.5-turboc                 C   s
   || _ d S Nmodel)selfr    r   P/var/www/html/corbot_env/lib/python3.10/site-packages/tests/test_faithfulness.py__init__,   s   
zOpenAI.__init__c                 C   s   t | jdS )N)
model_name)r   r   r   r   r   r   
load_model/   s   zOpenAI.load_modelpromptreturnc                 C   s   |   }||jS r	   )r   invokecontent)r   r   
chat_modelr   r   r   generate2   s   zOpenAI.generatec                    s    |   }||I d H }|jS r	   )r   ainvoker   )r   r   r   resr   r   r   
a_generate6   s   zOpenAI.a_generatec                 C   s   dS )NzCustom Modelr   r   r   r   r   get_model_name;   s   zOpenAI.get_model_nameN)r   )	__name__
__module____qualname__r   r   strr   r   r   r   r   r   r   r   +   s    
r   zopenai is expensive)reasonc                  C   s4   t dttttgd} t }t|d}t| |g d S )Nz?What is the primary difference between a comet and an asteroid?)inputactual_outputretrieval_contextr
   )r   outputonetwothreer   r   r   )	test_caser   metricr   r   r   test_faithfulness?   s   
r+   )pytestdeepeval.test_caser   deepeval.metricsr   deepevalr   deepeval.modelsr   langchain_openair   r%   r&   r'   r(   r   markskipr+   r   r   r   r   <module>   s    
	