Skip to content

Auto-translate natural language prompts to DSL via vtk-mcp#40

Open
vicentebolea wants to merge 1 commit into
masterfrom
feat/dsl-translation
Open

Auto-translate natural language prompts to DSL via vtk-mcp#40
vicentebolea wants to merge 1 commit into
masterfrom
feat/dsl-translation

Conversation

@vicentebolea

Copy link
Copy Markdown
Member

Summary

  • VTKMCPClient gains translate_prompt(query, model?, base_url?, api_key?) method that calls the new translate_prompt_to_dsl vtk-mcp tool
  • client.py now calls is_dsl_prompt() before code generation; natural language input is translated to the VTK pipeline DSL before RAG retrieval and code generation begin
  • Prompts already in DSL format are passed through unchanged

Why

The VTK pipeline DSL (structured create / <filter> / define / add / render specification 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

Test plan

  • Existing 41 tests pass unchanged
  • Manually tested end-to-end: natural language → DSL → VTK code generation

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.
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.

1 participant