Skip to content

Conversation

@YunKuiLu
Copy link
Contributor

@YunKuiLu YunKuiLu commented May 19, 2025

  • Support the use of custom templates
  • Adding builder pattern
  • Adding unit tests
  • Adjusted the relevant documents

If this PR is merged, it will also solve the following issues:
#2698

- Support the use of custom templates - Adding builder pattern - Adding unit tests - Adjusted the relevant documents Signed-off-by: YunKui Lu <luyunkui95@gmail.com>
@YunKuiLu YunKuiLu changed the title feat: Add custom template support to KeywordMetadataEnricher feat(rag:etl): Add custom template support to KeywordMetadataEnricher May 20, 2025
@ilayaperumalg ilayaperumalg added this to the 1.1.x milestone May 28, 2025
@torakiki
Copy link
Contributor

To add on this, the current documentation (1.0.0) says

The keyword extraction prompt can be customized by modifying the KEYWORDS_TEMPLATE constant in the class.

but KEYWORDS_TEMPLATE is final so there isn't at the moment any way to change the template beside creating your own MyKeywordMetadataEnricher.
I needed to change the template because llama3.2 was returning "here are five keywords: bla bla" and I had to be more strict on the prompt adding something like "Return only the comma separated keywords"

@markpollack
Copy link
Member

oops! great catch. Thanks @YunKuiLu

@markpollack
Copy link
Member

Thanks for the PR. Thanks for the context @torakiki you should be good to go now.

merged in f3e9d04c3ffb852ab2198f77887b46e600c2dc5b

@YunKuiLu
Copy link
Contributor Author

Hi @markpollack. I found that this PR is in the 1.0.x branch but not in master. Should we wait until the 1.0.1 release before merging it into master?

@ilayaperumalg
Copy link
Member

Re-opening the PR as the commit f3e9d04c3ffb852ab2198f77887b46e600c2dc5b didn't make it to main yet.

@ilayaperumalg ilayaperumalg reopened this Jul 28, 2025
@YunKuiLu
Copy link
Contributor Author

Closing because it has been merged into main as c122fe1.

@YunKuiLu YunKuiLu closed this Jul 28, 2025
@YunKuiLu YunKuiLu deleted the KeywordMetadataEnricher branch August 8, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment