diff --git a/src/vtk_prompt/cli.py b/src/vtk_prompt/cli.py index d4dbd17..2234ee1 100644 --- a/src/vtk_prompt/cli.py +++ b/src/vtk_prompt/cli.py @@ -162,7 +162,7 @@ def main( top_k=top_k, rag=rag, retry_attempts=retry_attempts, - _provider=provider, + provider=provider, custom_prompt=custom_prompt_data, ) diff --git a/src/vtk_prompt/generate_files.py b/src/vtk_prompt/generate_files.py index 8e93428..cfded20 100644 --- a/src/vtk_prompt/generate_files.py +++ b/src/vtk_prompt/generate_files.py @@ -187,7 +187,7 @@ def main( f.write(xml_content) logger.info("VTK XML content written to %s", output) else: - print(xml_content) + logger.info(xml_content) else: logger.warning("Generated content may not be valid VTK XML") if output: @@ -195,7 +195,7 @@ def main( f.write(xml_content) logger.info("Content written to %s (please verify)", output) else: - print(xml_content) + logger.info(xml_content) if __name__ == "__main__": diff --git a/src/vtk_prompt/rag_chat_wrapper.py b/src/vtk_prompt/rag_chat_wrapper.py index 4843864..bd217f2 100644 --- a/src/vtk_prompt/rag_chat_wrapper.py +++ b/src/vtk_prompt/rag_chat_wrapper.py @@ -239,7 +239,7 @@ def main(database: str, collection_name: str, top_k: int, model: str) -> None: try: reply = chat.ask(user_input, collection_name, top_k, streaming=True) for item in reply["response"]: - print(item.delta, end="") + logger.info(item.delta) full_reply += item.delta logger.info("\n Here are some relevant references:") diff --git a/src/vtk_prompt/state/initializer.py b/src/vtk_prompt/state/initializer.py index 350c0fa..02f37b6 100644 --- a/src/vtk_prompt/state/initializer.py +++ b/src/vtk_prompt/state/initializer.py @@ -22,7 +22,7 @@ def initialize_state(app: Any) -> None: """Initialize application state variables.""" # App state variables - app.state.query_text = "" + app.state.query_text = "Create a red sphere with lighting" app.state.generated_code = "" app.state.generated_explanation = "" app.state.is_loading = False diff --git a/src/vtk_prompt/ui/layout/content.py b/src/vtk_prompt/ui/layout/content.py index 0f1dc96..7d96f40 100644 --- a/src/vtk_prompt/ui/layout/content.py +++ b/src/vtk_prompt/ui/layout/content.py @@ -53,29 +53,17 @@ def build_content(layout: Any, app: Any) -> None: classes="mb-2", v_show="!use_cloud_models", ) - vuetify.VSpacer() - # API token warning chip - vuetify.VChip( - "API token is required for cloud models.", - small=True, - color="error", - text_color="white", - label=True, - classes="mb-2", - v_show="use_cloud_models && !api_token.trim()", - prepend_icon="mdi-alert", - ) with html.Div(classes="d-flex", style="height: calc(100% - 75px);"): # Query input vuetify.VTextarea( label="Describe VTK visualization", - v_model=("query_text", ""), + v_model=("query_text", "Create a red sphere with lighting"), rows=4, variant="outlined", - placeholder=("e.g., Create a red sphere with lighting"), hide_details=True, no_resize=True, + clearable=True, ) # Generate button vuetify.VBtn( diff --git a/src/vtk_prompt/ui/layout/settings_dialog.py b/src/vtk_prompt/ui/layout/settings_dialog.py index 917760a..986cdcb 100644 --- a/src/vtk_prompt/ui/layout/settings_dialog.py +++ b/src/vtk_prompt/ui/layout/settings_dialog.py @@ -71,7 +71,7 @@ def build_settings_dialog(layout: Any, app: Any) -> None: with vuetify.VRow(cols=12): with vuetify.VCol(cols=6): vuetify.VBtn( - "Download Conversation File", + "Conversation File", color="secondary", classes="mr-2 mt-2 w-100", click="download_conversation_file", @@ -79,7 +79,7 @@ def build_settings_dialog(layout: Any, app: Any) -> None: ) with vuetify.VCol(cols=6): vuetify.VBtn( - "Download Prompt File", + "Prompt File", color="secondary", classes="mr-2 mt-2 w-100", click="download_prompt_file", diff --git a/src/vtk_prompt/vtk_prompt_ui.py b/src/vtk_prompt/vtk_prompt_ui.py index 162de2d..e494d70 100644 --- a/src/vtk_prompt/vtk_prompt_ui.py +++ b/src/vtk_prompt/vtk_prompt_ui.py @@ -17,6 +17,7 @@ """ import sys +import textwrap from typing import Any import vtk @@ -261,11 +262,22 @@ def start(self) -> None: self.server.start() +def _print_startup_banner() -> None: + """Print a styled startup banner with ANSI colors.""" + banner = textwrap.dedent("""\ + \033[36m╭────────────────────────────────────────────────────────────────────╮ + │ \033[1mVTK Prompt UI\033[0m\033[36m │ + │ \033[97mEnter your API token in the application settings.\033[36m │ + │ \033[97mSupported providers: OpenAI, Anthropic, Gemini, NVIDIA NIM\033[36m │ + │ \033[97mFor local Ollama, use custom base URL and model config.\033[36m │ + ╰────────────────────────────────────────────────────────────────────╯\033[0m + """) + print(banner) + + def main() -> None: """Start the trame app.""" - print("VTK Prompt UI - Enter your API token in the application settings.") - print("Supported providers: OpenAI, Anthropic, Google Gemini, NVIDIA NIM") - print("For local Ollama, use custom base URL and model configuration.") + _print_startup_banner() # Check for custom prompt file in CLI arguments custom_prompt_file = None