graphragzen.examples.autotune_custom_prompts

Description

Functions

create_custom_prompts()

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}}) 3. 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) 4. Examples: Using all of the above we ask the LLM to create some example document->entities extracted 5. Entity extraction prompt: We merge all of the above information in a prompt that can be used to extract entities.