Instrumental search improvement - #633
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for filtering instrumental tracks across the AI tasks and tools pipeline. Key changes include adding keyword-based instrumental detection in planner.py, updating intent classifier prompts, and implementing database filtering and scoring based on the mood_vector in tool_impl.py. The search_database tool definition was also updated to expose the new instrumental boolean parameter. Feedback on these changes suggests compiling the _INSTRUMENTAL_RE regular expression at the module level in planner.py to avoid recompiling it on every function call, and coercing the instrumental parameter to a boolean in tool_impl.py to prevent potential truthiness bugs if it is passed as a string.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
I am having trouble creating individual review comments. Click here to see my feedback.
tasks/ai/planner.py (490-495)
The regular expression _INSTRUMENTAL_RE is compiled inside the extract_hints function on every invocation. For better performance and consistency with other regex patterns in this file (such as _YEAR_RE and _DECADE_RE), it should be defined at the module level.
if _INSTRUMENTAL_RE.search(text):tasks/ai/tool_impl.py (713-714)
If the instrumental parameter is passed as a string (e.g., 'false' or 'False') instead of a boolean, the truthiness check if instrumental: will evaluate to True because non-empty strings are truthy in Python. Coercing it to a boolean when it is a string prevents potential logic errors.
if instrumental is not None:
if isinstance(instrumental, str):
instrumental = instrumental.lower() in ('true', '1', 'yes')
if instrumental:
|



This PR is to improve the instruemntal song search in different way:
PR test builds:
ghcr.io/neptunehub/audiomuse-ai:pr-633ghcr.io/neptunehub/audiomuse-ai:pr-633-nvidiaghcr.io/neptunehub/audiomuse-ai:pr-633-noavx2