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

@vicentebolea vicentebolea commented Jun 4, 2026

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
  • New --dsl-translation/--no-dsl-translation CLI flag and UI checkbox to opt out of auto-translation
  • New --debug flag (CLI and vtk-prompt-ui) that dumps the full LLM conversation, including injected context and vtk-mcp tool calls/results, to stdout
  • Settings dialog shows a live connectivity check next to the vtk-mcp Server URL field (checking/connected/unreachable)

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, while keeping an escape hatch, a debugging aid, and clearer feedback on vtk-mcp connectivity.

Dependencies

Test plan

  • Existing tests pass unchanged
  • Manually tested end-to-end: natural language → DSL → VTK code generation
  • Manually verified --debug dumps the full conversation on CLI and UI
  • Manually verified vtk-mcp connectivity indicator updates on URL change

@vicentebolea vicentebolea force-pushed the feat/dsl-translation branch from 77e5a9c to 41640ea Compare July 8, 2026 02:04
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.
@vicentebolea vicentebolea force-pushed the feat/dsl-translation branch from 41640ea to 5704e59 Compare July 10, 2026 02:20
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