Skip to content

Add custom prompt file support for summarization#62

Closed
prasjaiswal wants to merge 4 commits intomainfrom
fix/custom-prompt-file-support-for-summarization
Closed

Add custom prompt file support for summarization#62
prasjaiswal wants to merge 4 commits intomainfrom
fix/custom-prompt-file-support-for-summarization

Conversation

@prasjaiswal
Copy link
Collaborator

  • Modified create_summarizer_from_prompt_ref() to accept optional prompt_file parameter
  • Updated PostQueryProcessing.create_for_site() to load custom prompt file from site config
  • Enables sites to use custom prompts for result summarization (previously only worked for query decontextualization)
  • Fixes issue where HindiSummarization prompt was being loaded from package defaults instead of custom prompt file

Note: This implementation loads XML per request. Performance optimization with caching will be added in follow-up.

Prashant Jaiswal added 2 commits February 13, 2026 01:03
- Modified create_summarizer_from_prompt_ref() to accept optional prompt_file parameter
- Updated PostQueryProcessing.create_for_site() to load custom prompt file from site config
- Enables sites to use custom prompts for result summarization (previously only worked for query decontextualization)
- Fixes issue where HindiSummarization prompt was being loaded from package defaults instead of custom prompt file

Note: This implementation loads XML per request. Performance optimization with caching will be added in follow-up.
config = await lookup.get_config(site)
if config:
prompt_file = config.get("prompt_file")
except (ValueError, Exception):
This function was imported in postQueryProcessing.py but never implemented,
causing ImportError that broke all queries.
config = await lookup.get_config(site)
if config:
return config.get("summarization_prompt")
except Exception:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant