a
    •˜ëjÚ  ã                   @   sl   d dl mZ d dlmZ d dlmZ G dd„ deeeef  ƒZ	dZ
ee
g d¢d�Zd	Zeeg d
¢d�ZdS )é    )ÚBaseOutputParser)ÚPromptTemplate)Úoverridec                   @   s:   e Zd ZU dZdZeed< eeeee	f dœdd„ƒZ
dS )ÚFinishedOutputParserz4Output parser that checks if the output is finished.ÚFINISHEDÚfinished_value)ÚtextÚreturnc                 C   s$   |  ¡ }| j|v }| | jd¡|fS )NÚ )Ústripr   Úreplace)Úselfr   ÚcleanedÚfinished© r   ú]/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/langchain/chains/flare/prompts.pyÚparse   s    
zFinishedOutputParser.parseN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚstrÚ__annotations__r   ÚtupleÚboolr   r   r   r   r   r      s   
r   zùRespond to the user message using any relevant context. If context is provided, you should ground your answer in that context. Once you're done responding return FINISHED.

>>> CONTEXT: {context}
>>> USER INPUT: {user_input}
>>> RESPONSE: {response})Ú
user_inputÚcontextÚresponse)ÚtemplateZinput_variablesa&  Given a user input and an existing partial response as context, ask a question to which the answer is the given term/entity/phrase:

>>> USER INPUT: {user_input}
>>> EXISTING PARTIAL RESPONSE: {current_response}

The question to which the answer is the term/entity/phrase "{uncertain_span}" is:)r   Zcurrent_responseZuncertain_spanN)Zlangchain_core.output_parsersr   Zlangchain_core.promptsr   Ztyping_extensionsr   r   r   r   r   ZPROMPT_TEMPLATEZPROMPTZ"QUESTION_GENERATOR_PROMPT_TEMPLATEZQUESTION_GENERATOR_PROMPTr   r   r   r   Ú<module>   s   
þþ