fix(nemo-insights): export analyst result types from package __init__ and update prompt import path - #1220
Draft
mdcox wants to merge 1 commit into
Draft
fix(nemo-insights): export analyst result types from package __init__ and update prompt import path#1220mdcox wants to merge 1 commit into
mdcox wants to merge 1 commit into
Conversation
… and update prompt import path The analyst LLM was generating execute_python code that imported NewInsight from nemo_insights_plugin.analyst.functions.insights, which does not define it. Root cause: the system prompt told the model to call return_result with an AnalystResult but gave no import path, so the model guessed based on the last insights-related module it knew about. Fix by: - Adding a public API to nemo_insights_plugin.analyst.__init__ that re-exports AnalystResult, NewInsight, and InsightUpdate from analyst.result. This gives consumers a stable import path that survives internal module reorganization. - Updating the analyst system prompt to show the canonical import explicitly, eliminating the guesswork. Signed-off-by: Horde <horde@nvidia.com>
Contributor
|
15 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The analyst LLM was crashing with
AttributeError: module 'nemo_insights_plugin.analyst.functions.insights' has no attribute 'NewInsight'. The system prompt told the model to callreturn_result(result=AnalystResult(...))but gave no import path. The model guessedNewInsightlived in theinsightsmodule (the last insights-related module it had used), which was wrong — it lives inanalyst.result.Related Issue
Changes
plugins/nemo-insights/src/nemo_insights_plugin/analyst/__init__.py: exportsAnalystResult,NewInsight, andInsightUpdateas the stable public API of theanalystpackage, decoupling consumers from internal module layout.agent.pyto show the canonical import path (from nemo_insights_plugin.analyst import ...) so the model no longer has to guess.Type of Change
Quality Gates
Verification
Signed-off-by:trailer (horde@nvidia.com)uv run pre-commit run -apasses, or any blocked checks are identified belowTargeted validation: