Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ vtk-prompt "Create a red sphere" -t $API_KEY
# Advanced options
vtk-prompt "Create a textured cone with 32 resolution" \
--provider anthropic \
--model claude-opus-4-7 \
--model claude-opus-5 \
--max-tokens 4000 \
--mcp-url http://localhost:8000 \
--verbose \
Expand Down Expand Up @@ -156,7 +156,7 @@ print(code)

```yaml
# Model and parameter configuration
model: anthropic/claude-opus-4-1-20250805
model: anthropic/claude-opus-5
modelParameters:
temperature: 0.2
max_tokens: 6000
Expand Down Expand Up @@ -215,7 +215,7 @@ uv pip install -e ".[test]" && pytest

| Provider | Default Model | Base URL |
| ------------- | ------------------------------ | ----------------------------------- |
| **anthropic** | claude-sonnet-4-6 | https://api.anthropic.com/v1 |
| **anthropic** | claude-sonnet-5 | https://api.anthropic.com/v1 |
| **openai** | gpt-4.1 | https://api.openai.com/v1 |
| **gemini** | gemini-2.5-pro | https://generativelanguage.googleapis.com/v1beta |
| **nim** | meta/llama-3.3-70b-instruct | https://integrate.api.nvidia.com/v1 |
Expand Down
28 changes: 21 additions & 7 deletions src/vtk_prompt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
It handles argument parsing, validation, and orchestrates the VTKPromptClient.

Example:
>>> vtk-prompt "create sphere" --mcp-url http://localhost:8000 --model claude-sonnet-4-6
>>> vtk-prompt "create sphere" --mcp-url http://localhost:8000 --model claude-sonnet-5
"""

import sys

import click

from . import get_logger
from .client import VTKPromptClient
from .client import VTKPromptClient, load_conversation, save_conversation
from .provider_utils import DEFAULT_MODEL, DEFAULT_PROVIDER, get_default_model, supports_temperature

logger = get_logger(__name__)
Expand Down Expand Up @@ -54,6 +54,16 @@
"--prompt-file",
help="Path to custom YAML prompt file (overrides built-in prompts and defaults)",
)
@click.option(
"--dsl-translation/--no-dsl-translation",
default=True,
help="Auto-translate natural language prompts to the VTK pipeline DSL via vtk-mcp",
)
@click.option(
"--debug",
is_flag=True,
help="Dump the full LLM conversation (context and vtk-mcp tool calls included) to stdout",
)
def main(
input_string: str,
provider: str,
Expand All @@ -68,6 +78,8 @@ def main(
retry_attempts: int,
conversation: str | None,
prompt_file: str | None,
dsl_translation: bool,
debug: bool,
) -> None:
"""
Generate and execute VTK code using LLMs.
Expand Down Expand Up @@ -138,13 +150,12 @@ def main(
temperature = 1.0

try:
client = VTKPromptClient(
verbose=verbose,
conversation_file=conversation,
mcp_url=mcp_url,
)
client = VTKPromptClient(verbose=verbose, mcp_url=mcp_url)
# The caller owns the conversation: load it, hand it to query, save it back.
messages = load_conversation(conversation)
result = client.query(
input_string,
conversation=messages,
api_key=token,
model=model,
base_url=base_url,
Expand All @@ -154,7 +165,10 @@ def main(
retry_attempts=retry_attempts,
provider=provider,
custom_prompt=custom_prompt_data,
dsl_translation=dsl_translation,
debug=debug,
)
save_conversation(conversation, messages)

# Handle result with optional validation warnings
if isinstance(result, tuple):
Expand Down
Loading
Loading