{"record":{"id":"19293306d56d665c","repo":"assafelovic/gpt-researcher","slug":"invalid-prompt-family-prompt-family-name-pleas","errorCode":null,"errorMessage":"Invalid prompt family: {prompt_family_name}.\nPlease use one of the following: {', '.join([enum_value for enum_value in prompt_family_mapping.keys()])}\nUsing default prompt family: {PromptFamilyEnum.Default.value} prompt.","messagePattern":"Invalid prompt family: (.+?)\\.\nPlease use one of the following: (.+?)\nUsing default prompt family: (.+?) prompt\\.","errorType":"console","errorClass":"UserWarning","httpStatus":null,"severity":"warning","filePath":"gpt_researcher/prompts.py","lineNumber":897,"sourceCode":"prompt_family_mapping = {\n    PromptFamilyEnum.Default.value: PromptFamily,\n    PromptFamilyEnum.Granite.value: GranitePromptFamily,\n    PromptFamilyEnum.Granite3.value: Granite3PromptFamily,\n    PromptFamilyEnum.Granite31.value: Granite3PromptFamily,\n    PromptFamilyEnum.Granite32.value: Granite3PromptFamily,\n    PromptFamilyEnum.Granite33.value: Granite33PromptFamily,\n}\n\n\ndef get_prompt_family(\n    prompt_family_name: PromptFamilyEnum | str, config: Config,\n) -> PromptFamily:\n    \"\"\"Get a prompt family by name or value.\"\"\"\n    if isinstance(prompt_family_name, PromptFamilyEnum):\n        prompt_family_name = prompt_family_name.value\n    if prompt_family := prompt_family_mapping.get(prompt_family_name):\n        return prompt_family(config)\n    warnings.warn(\n        f\"Invalid prompt family: {prompt_family_name}.\\n\"\n        f\"Please use one of the following: {', '.join([enum_value for enum_value in prompt_family_mapping.keys()])}\\n\"\n        f\"Using default prompt family: {PromptFamilyEnum.Default.value} prompt.\",\n        UserWarning,\n    )\n    return PromptFamily()\n","sourceCodeStart":879,"sourceCodeEnd":904,"githubUrl":"https://github.com/assafelovic/gpt-researcher/blob/6f998577d547b1e54ec662dac63583aa11e3b84b/gpt_researcher/prompts.py#L879-L904","documentation":"UserWarning from get_prompt_family: prompt_family_name is not a key in prompt_family_mapping, so the default PromptFamily is used instead of raising. Your custom prompt family's instructions are silently ignored and stock prompts are applied.","triggerScenarios":"Passing prompt_family=\"my_family\" to GPTResearcher when it isn't registered in prompt_family_mapping, or a typo/case mismatch of a known name; called from GPTResearcher.__init__.","commonSituations":"Custom prompt families not registered in the mapping after upgrade, renamed built-in families, or string typos; code that passes a class instead of a registered name/value.","solutions":["Pass a valid PromptFamilyEnum value (e.g. 'default', or whichever families are registered in gpt_researcher/prompts.py prompt_family_mapping).","For custom families, register your PromptFamily subclass in prompt_family_mapping or pass the family per its documented registration mechanism for your version.","Print list(prompt_family_mapping.keys()) for your installed version to see accepted names."],"exampleFix":"# before\nresearcher = GPTResearcher(query=q, prompt_family=\"my-custom\")  # not registered\n# after\nfrom gpt_researcher.prompts import prompt_family_mapping, PromptFamilyEnum\nprint(list(prompt_family_mapping))  # pick a valid name\nresearcher = GPTResearcher(query=q, prompt_family=PromptFamilyEnum.Default.value)","handlingStrategy":"type-guard","validationCode":"from gpt_researcher.prompts import prompt_family_mapping\nif name not in prompt_family_mapping:\n    name = \"default\"","typeGuard":"from gpt_researcher.prompts import prompt_family_mapping\n\ndef is_valid_prompt_family(name: str) -> bool:\n    return name in prompt_family_mapping","tryCatchPattern":null,"preventionTips":["Print prompt_family_mapping keys for your installed version before choosing a name.","Register custom prompt families in the mapping rather than passing unregistered strings."],"tags":["prompt-family","configuration","python"],"backgroundTag":"invalid-enum-value-fallback","analyzedSha":"6f998577d547b1e54ec662dac63583aa11e3b84b","analyzedAt":"2026-08-28T17:50:07.383Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}