graphragzen.prompt_tuning.utils.generate_persona

graphragzen.prompt_tuning.utils.generate_persona(llm, domain, prompt='\nYou are an intelligent assistant that helps a human to analyze the information in a text document.\nGiven a specific type of task and sample text, help the user by generating a 3 to 4 sentence description of an expert who could help solve the problem.\nUse a format similar to the following:\nYou are an expert {{role}}. You are skilled at {{relevant skills}}. You are adept at helping people with {{specific task}}.\n\ntask: Identify the relations and structure of the community of interest, specifically within the {domain} domain.\npersona description:')[source]

Generate a persona relevant to a domain to use for GraphRAG prompts.

Parameters:
  • llm (LLM)

  • domain (str) – To base the persona on

  • prompt (str, optional) – Prompt to use for generating a persona. Defaults to graphragzen.prompts.prompt_tuning.persona.GENERATE_PERSONA_PROMPT.

Returns:

persona

Return type:

str