Skip to content

fix: send catalog keyword vocabulary from plugin to backend#215

Closed
Olioli4 wants to merge 1 commit into
LrGenius:mainfrom
Olioli4:fix/catalog-keywords-plugin
Closed

fix: send catalog keyword vocabulary from plugin to backend#215
Olioli4 wants to merge 1 commit into
LrGenius:mainfrom
Olioli4:fix/catalog-keywords-plugin

Conversation

@Olioli4

@Olioli4 Olioli4 commented Jul 5, 2026

Copy link
Copy Markdown

Description

The backend already supports sending the full catalog keyword vocabulary to the LLM via the catalog_keywords field in MetadataGenerationRequest, and injects it into the prompt. However, the Lua plugin never populated this field.

Changes

Plugin (Lua)

  • TaskAnalyzeAndIndex.lua: Call MetadataManager.collectCatalogKeywordNames() (limit 500) and pass as options.catalog_keywords
  • TaskAiEditPhotos.lua: Same for the AI edit path

Backend (Python)

  • base.py (_normalize_keywords_structure): Added deduplication (case-insensitive) and catalog name normalization within the response. If the LLM returns "fruehling" and the catalog has "Fruehling", the canonical catalog spelling is used
  • All providers (ollama, chatgpt, gemini, lmstudio): Pass request.catalog_keywords to the normalization function

Related Issues

Closes #213

The backend already supports catalog_keywords but the Lua plugin
never populated this field via collectCatalogKeywordNames().

Also add deduplication and catalog name normalization in
_normalize_keywords_structure() so that duplicate or
differently-cased keywords are collapsed before reaching LR.

Refs: LrGenius#213
@Olioli4

Olioli4 commented Jul 5, 2026

Copy link
Copy Markdown
Author

Closing - approach needs to be rethought. Keeping the issues open for discussion.

@Olioli4 Olioli4 closed this Jul 5, 2026
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.

catalog_keywords not sent from plugin to backend

1 participant