graphragzen.examples.autotune_custom_prompts.create_custom_prompts

graphragzen.examples.autotune_custom_prompts.create_custom_prompts()[source]

Use an LLM to generate a prompt for entity extraction comprises the following steps. 1. Domain: We fist ask the LLM to create the domains that the documents span 2. Persona: with the domains the LLM can create a persona (e.g. You are an expert {{role}}.

You are skilled at {{relevant skills}})

  1. Entity categories: using the domain and persona we ask the LLM to extract from the documents

    the categories a node could get (e.g. person, school of thought, ML)

  2. Examples: Using all of the above we ask the LLM to create some example document->entities

    extracted

  3. Entity extraction prompt: We merge all of the above information in a prompt that can be

    used to extract entities

Note: Each function’s optional parameters have sane defaults. Check out their docstrings for their desrciptions and see if you want to overwrite any

Return type:

str