code: """Autoretriever prompts."""
  
  from llama_index.legacy.prompts.base import PromptTemplate
  from llama_index.legacy.prompts.prompt_type import PromptType
  from llama_index.legacy.vector_stores.types import (
      FilterOperator,
      MetadataFilter,
      MetadataInfo,
      VectorStoreInfo,
      VectorStoreQuerySpec,
  )
  
  # NOTE: these prompts are inspired from langchain's self-query prompt,
  # and adapted to our use case.
  # https://github.com/hwchase17/langchain/tree/main/langchain/chains/query_constructor/prompt.py
  
  
  PREFIX = """\
  Your goal is to structure the user's query to match the request schema provided below.
  
  << Structured Request Schema >>
  When responding use a markdown code snippet with a JSON object formatted in the \
  following schema:
  
  {schema_str}
  
  The query string should contain only text that is expected to match the contents of \
  documents. Any conditions in the filter should not be mentioned in the query as well.
  
  Make sure that filters only refer to attributes that exist in the data source.
  Make sure that filters take into account the descriptions of attributes.
  Make sure that filters are only used as needed. If there are no filters that should be \
  applied return [] for the filter value.\
  
  If the user's query explicitly mentions number of documents to retrieve, set top_k to \
  that number, otherwise do not set top_k.
  
  """
  
  example_info_1 = VectorStoreInfo(
      content_info="Lyrics of a song",
      metadata_info=[
          MetadataInfo(name="artist", type="str", description="Name of the song artist"),
          MetadataInfo(
              name="genre",
              type="str",
              description='The song genre, one of "pop", "rock" or "rap"',
          ),
      ],
  )
  
  example_query_1 = "What are songs by Taylor Swift or Katy Perry about teenage romance in the dance pop genre"
  
  example_output_1 = VectorStoreQuerySpec(
      query="what songs are about teenager love",
      filters=[
          MetadataFilter(key="artist", value="Taylor Swift"),
          MetadataFilter(key="artist", value="Katy Perry"),
          MetadataFilter(key="genre", value="pop"),
      ],
  )
  
  example_info_2 = VectorStoreInfo(
      content_info="Classic literature",
      metadata_info=[
          MetadataInfo(name="author", type="str", description="Author name"),
          MetadataInfo(
              name="book_title",
              type="str",
              description="Book title",
          ),
          MetadataInfo(
              name="year",
              type="int",
              description="Year Published",
          ),
          MetadataInfo(
              name="pages",
              type="int",
              description="Number of pages",
          ),
          MetadataInfo(
              name="summary",
              type="str",
              description="A short summary of the book",
          ),
      ],
  )
  
  example_query_2 = "What are some books by Jane Austen published after 1813 that explore the theme of marriage for social standing?"
  
  example_output_2 = VectorStoreQuerySpec(
      query="What books related to theme of marriage for social standing?",
      filters=[
          MetadataFilter(key="year", value="1813", operator=FilterOperator.GT),
          MetadataFilter(key="author", value="Jane Austen"),
      ],
  )
  
  EXAMPLES = f"""\
  << Example 1. >>
  Data Source:
  ```json
  {example_info_1.json(indent=4)}
  ```
  
  User Query:
  {example_query_1}
  
  Structured Request:
  ```json
  {example_output_1.json()}
  
  
  << Example 2. >>
  Data Source:
  ```json
  {example_info_2.json(indent=4)}
  ```
  
  User Query:
  {example_query_2}
  
  Structured Request:
  ```json
  {example_output_2.json()}
  
  ```
  """.replace(
      "{", "{{"
  ).replace(
      "}", "}}"
  )
  
  
  SUFFIX = """
  << Example 3. >>
  Data Source:
  ```json
  {info_str}
  ```
  
  User Query:
  {query_str}
  
  Structured Request:
  """
  
  DEFAULT_VECTARA_QUERY_PROMPT_TMPL = PREFIX + EXAMPLES + SUFFIX
  
  
  # deprecated, kept for backwards compatibility
  """Vector store query prompt."""
  VectorStoreQueryPrompt = PromptTemplate
  
  DEFAULT_VECTARA_QUERY_PROMPT = PromptTemplate(
      template=DEFAULT_VECTARA_QUERY_PROMPT_TMPL,
      prompt_type=PromptType.VECTOR_STORE_QUERY,
  )
  
apis: llama_index.legacy.vector_stores.types.MetadataInfo llama_index.legacy.prompts.base.PromptTemplate llama_index.legacy.vector_stores.types.MetadataFilter
extract_api: [((3927, 4033), 'llama_index.legacy.prompts.base.PromptTemplate', 'PromptTemplate', ([], {'template': 'DEFAULT_VECTARA_QUERY_PROMPT_TMPL', 'prompt_type': 'PromptType.VECTOR_STORE_QUERY'}), '(template=DEFAULT_VECTARA_QUERY_PROMPT_TMPL, prompt_type=\n    PromptType.VECTOR_STORE_QUERY)\n', (3941, 4033), False, 'from llama_index.legacy.prompts.base import PromptTemplate\n'), ((1451, 1529), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""artist"""', 'type': '"""str"""', 'description': '"""Name of the song artist"""'}), "(name='artist', type='str', description='Name of the song artist')\n", (1463, 1529), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((1539, 1643), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""genre"""', 'type': '"""str"""', 'description': '"""The song genre, one of "pop", "rock" or "rap\\""""'}), '(name=\'genre\', type=\'str\', description=\n    \'The song genre, one of "pop", "rock" or "rap"\')\n', (1551, 1643), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((1919, 1969), 'llama_index.legacy.vector_stores.types.MetadataFilter', 'MetadataFilter', ([], {'key': '"""artist"""', 'value': '"""Taylor Swift"""'}), "(key='artist', value='Taylor Swift')\n", (1933, 1969), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((1979, 2027), 'llama_index.legacy.vector_stores.types.MetadataFilter', 'MetadataFilter', ([], {'key': '"""artist"""', 'value': '"""Katy Perry"""'}), "(key='artist', value='Katy Perry')\n", (1993, 2027), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((2037, 2077), 'llama_index.legacy.vector_stores.types.MetadataFilter', 'MetadataFilter', ([], {'key': '"""genre"""', 'value': '"""pop"""'}), "(key='genre', value='pop')\n", (2051, 2077), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((2190, 2256), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""author"""', 'type': '"""str"""', 'description': '"""Author name"""'}), "(name='author', type='str', description='Author name')\n", (2202, 2256), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((2266, 2335), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""book_title"""', 'type': '"""str"""', 'description': '"""Book title"""'}), "(name='book_title', type='str', description='Book title')\n", (2278, 2335), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((2392, 2459), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""year"""', 'type': '"""int"""', 'description': '"""Year Published"""'}), "(name='year', type='int', description='Year Published')\n", (2404, 2459), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((2516, 2585), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""pages"""', 'type': '"""int"""', 'description': '"""Number of pages"""'}), "(name='pages', type='int', description='Number of pages')\n", (2528, 2585), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((2642, 2730), 'llama_index.legacy.vector_stores.types.MetadataInfo', 'MetadataInfo', ([], {'name': '"""summary"""', 'type': '"""str"""', 'description': '"""A short summary of the book"""'}), "(name='summary', type='str', description=\n    'A short summary of the book')\n", (2654, 2730), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((3054, 3122), 'llama_index.legacy.vector_stores.types.MetadataFilter', 'MetadataFilter', ([], {'key': '"""year"""', 'value': '"""1813"""', 'operator': 'FilterOperator.GT'}), "(key='year', value='1813', operator=FilterOperator.GT)\n", (3068, 3122), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n'), ((3132, 3181), 'llama_index.legacy.vector_stores.types.MetadataFilter', 'MetadataFilter', ([], {'key': '"""author"""', 'value': '"""Jane Austen"""'}), "(key='author', value='Jane Austen')\n", (3146, 3181), False, 'from llama_index.legacy.vector_stores.types import FilterOperator, MetadataFilter, MetadataInfo, VectorStoreInfo, VectorStoreQuerySpec\n')]