Auto-translate natural language prompts to DSL via vtk-mcp#40
Open
vicentebolea wants to merge 1 commit into
Open
Auto-translate natural language prompts to DSL via vtk-mcp#40vicentebolea wants to merge 1 commit into
vicentebolea wants to merge 1 commit into
Conversation
When a vtk-mcp server is available, the client now calls is_dsl_prompt() before code generation; if the input is plain natural language it calls translate_prompt_to_dsl() to convert it to the structured VTK pipeline DSL before RAG retrieval and generation. VTKMCPClient.translate_prompt() accepts optional model, base_url, and api_key overrides so callers can direct the translation to a specific model or Ollama endpoint without changing server config.
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
VTKMCPClientgainstranslate_prompt(query, model?, base_url?, api_key?)method that calls the newtranslate_prompt_to_dslvtk-mcp toolclient.pynow callsis_dsl_prompt()before code generation; natural language input is translated to the VTK pipeline DSL before RAG retrieval and code generation beginWhy
The VTK pipeline DSL (structured
create / <filter> / define / add / renderspecification with snake_case setter names as parameters) hits the vtk-index BM25 index far more precisely than natural language, reduces the LLM's tool-calling rounds during generation, and leaves almost no hallucination space for class or method names. This change makes the quality improvement automatic for all vtk-prompt users with a vtk-mcp server.Dependencies
translate_prompt_to_dslandis_dsl_prompttoolsdslsubpackage with translatorTest plan