o
    /if                     @   s   d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 G dd deZ
e	 Zejdd	 e jd
ed
efddZdZejdeddd ZdS )    N)
BaseMetric)LLMTestCase)assert_test)EvaluationDatasetc                   @   sL   e Zd ZddefddZdefddZdefdd	Zd
d Ze	dd Z dS )
FakeMetric      ?	thresholdc                 C   s
   || _ d S N)r   )selfr    r   N/var/www/html/corbot_env/lib/python3.10/site-packages/tests/test_deployment.py__init__   s   
zFakeMetric.__init__	test_casec                 C   s(   t dd| _| j| jk| _d| _| jS )Nr         ?zThis metric looking good!randomuniformscorer   successreasonr
   r   r   r   r   measure   s   zFakeMetric.measurec                    s*   t dd| _| j| jk| _d| _| jS )Nr   r   zThis async metric looking good!r   r   r   r   r   	a_measure   s
   zFakeMetric.a_measurec                 C   s   | j S r	   )r   r
   r   r   r   is_successful!   s   zFakeMetric.is_successfulc                 C   s   dS )N	Coherencer   r   r   r   r   __name__$   s   zFakeMetric.__name__N)r   )
r   
__module____qualname__floatr   r   r   r   r   propertyr   r   r   r   r      s    	r   test)aliasr   c                 C   s   t  }t| |g d S r	   )r   r   )r   fake_metricr   r   r   test_customer_chatbot/   s   r$   zlYou are a helpful assistant, answer the following question in a non-judgemental tone.

Question:
{question}
zgpt-4)modelprompt_templatec                   C   s
   dddS )Ni  r   )
chunk_sizetemperaturer   r   r   r   r   hyperparameters?   s   r)   )pytestr   deepevaldeepeval.metricsr   deepeval.test_caser   r   deepeval.datasetr   r   datasetpullmarkparametrizer$   r&   log_hyperparametersr)   r   r   r   r   <module>   s$    