U
    DAf                     @   s.   d dl mZ d dlmZ eG dd dZdS )    )Optional)	componentc                   @   sD   e Zd ZdZdedddZejeeddeee dd	d
Z	dS )	Thresholdz
    Redirects the value, along a different connection whether the value is above or below the given threshold.

    :param threshold: the number to compare the input value against. This is also a parameter.
    
   	thresholdc                 C   s
   || _ dS )zR
        :param threshold: the number to compare the input value against.
        Nr   )selfr    r	   P/tmp/pip-unpacked-wheel-z752163x/haystack/testing/sample_components/threshold.py__init__   s    zThreshold.__init__)abovebelowN)valuer   c                 C   s&   |dkr| j }||k rd|iS d|iS )z
        Redirects the value, along a different connection whether the value is above or below the given threshold.

        :param threshold: the number to compare the input value against. This is also a parameter.
        Nr   r   r   )r   r   r   r	   r	   r
   run   s
    zThreshold.run)r   )N)
__name__
__module____qualname____doc__intr   r   Zoutput_typesr   r   r	   r	   r	   r
   r   
   s   r   N)typingr   Zhaystack.core.componentr   r   r	   r	   r	   r
   <module>   s   