U
    “öhÐ  ã                   @  s8   d Z ddlmZ ddlZddlmZ dddœdd	„ZdS )
z!Utilities for processing prompts.é    )ÚannotationsN)ÚAbstractSetÚstrzAbstractSet[str])ÚpromptÚreturnc                 C  s:   g }t  ¡  | ¡D ]\}}}}|dk	r| |¡ qt|ƒS )zûReturns the placeholders for `prompt`.

  E.g. Given "A for {word_one} B for {word_two}", returns {"word_one",
  "word_two"}.

  Args:
    prompt: A prompt template with optional placeholders.

  Returns:
    A sequence of placeholders in `prompt`.
  N)ÚstringÚ	FormatterÚparseÚappendÚ	frozenset)r   ZplaceholdersÚ_Ú
field_name© r   úQ/tmp/pip-unpacked-wheel-doshhd5e/google/generativeai/notebook/lib/prompt_utils.pyÚget_placeholders   s
    r   )Ú__doc__Ú
__future__r   r   Útypingr   r   r   r   r   r   Ú<module>   s   