dbagent-cli 0.1.6__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/PKG-INFO +1 -1
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/__init__.py +1 -1
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/cli.py +23 -1
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent_cli.egg-info/PKG-INFO +1 -1
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/pyproject.toml +1 -1
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/README.md +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/agent/generator.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/agent/pipeline.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/agent/validator.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/config.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/connectors/base.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/connectors/factory.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/connectors/mongo.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/connectors/relational.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/auto_setup.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/base.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/factory.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/gemini_provider.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/groq_provider.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/mock_provider.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/ollama_provider.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/llm/openrouter_provider.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/schema/formatter.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/schema/models.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/schema/selector.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/ui/console.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent/ui/viewer.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent_cli.egg-info/SOURCES.txt +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent_cli.egg-info/dependency_links.txt +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent_cli.egg-info/entry_points.txt +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent_cli.egg-info/requires.txt +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/dbagent_cli.egg-info/top_level.txt +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/setup.cfg +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/tests/test_cli.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/tests/test_connectors.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/tests/test_generator.py +0 -0
- {dbagent_cli-0.1.6 → dbagent_cli-0.1.7}/tests/test_schema.py +0 -0
|
@@ -509,7 +509,7 @@ def chat_command(
|
|
|
509
509
|
console.print(f"[bold green]Connected:[/bold green] {db_name} ({dialect}) - {len(table_names)} tables")
|
|
510
510
|
console.print(f"[bold cyan]AI:[/bold cyan] {llm.name}")
|
|
511
511
|
console.print("[dim]Type your question in plain English. Read queries auto-execute. Write queries ask for confirmation.[/dim]")
|
|
512
|
-
console.print("[dim]Commands: [bold]:tables[/bold] | [bold]:table <name>[/bold] | [bold]:fk <name>[/bold] | [bold]:explain[/bold] | [bold]:history[/bold] | [bold]:auto[/bold]/[bold]:noauto[/bold] | [bold]:run[/bold] | [bold]:export <file>[/bold] | [bold]:exit[/bold][/dim]\n")
|
|
512
|
+
console.print("[dim]Commands: [bold]:tables[/bold] | [bold]:table <name>[/bold] | [bold]:fk <name>[/bold] | [bold]:model <name>[/bold] | [bold]:explain[/bold] | [bold]:history[/bold] | [bold]:auto[/bold]/[bold]:noauto[/bold] | [bold]:run[/bold] | [bold]:export <file>[/bold] | [bold]:exit[/bold][/dim]\n")
|
|
513
513
|
|
|
514
514
|
history_file = config_mgr.config_dir / "chat_history.txt"
|
|
515
515
|
session = PromptSession(history=FileHistory(str(history_file)))
|
|
@@ -578,6 +578,28 @@ def chat_command(
|
|
|
578
578
|
console.print("")
|
|
579
579
|
continue
|
|
580
580
|
|
|
581
|
+
if user_input.startswith(":model ") or user_input.startswith(":provider ") or user_input.startswith(":use "):
|
|
582
|
+
parts = user_input.split(maxsplit=2)
|
|
583
|
+
if len(parts) > 1:
|
|
584
|
+
new_target = parts[1].strip()
|
|
585
|
+
if new_target.lower() in ["ollama", "gemini", "groq", "openrouter", "mock"]:
|
|
586
|
+
llm = get_llm_provider(provider_name=new_target.lower(), config_mgr=config_mgr)
|
|
587
|
+
model = None
|
|
588
|
+
print_success(f"Switched AI provider to [bold cyan]{llm.name}[/bold cyan]")
|
|
589
|
+
else:
|
|
590
|
+
model = new_target
|
|
591
|
+
print_success(f"Switched active model to [bold cyan]{model}[/bold cyan] (Provider: {llm.name})")
|
|
592
|
+
else:
|
|
593
|
+
print_info(f"Active AI Provider: [bold cyan]{llm.name}[/bold cyan] | Model: [bold green]{model or getattr(llm, 'default_model', 'default')}[/bold green]")
|
|
594
|
+
continue
|
|
595
|
+
|
|
596
|
+
if user_input.lower() in [":models", ":providers", ":ai"]:
|
|
597
|
+
curr_model = model or getattr(llm, "default_model", "default")
|
|
598
|
+
console.print(f"\n[bold cyan]Active AI Provider:[/bold cyan] [bold white]{llm.name}[/bold white]")
|
|
599
|
+
console.print(f"[bold cyan]Active Model:[/bold cyan] [bold green]{curr_model}[/bold green]")
|
|
600
|
+
console.print("[dim]Switch on the fly: [bold]:provider <ollama|gemini|groq|openrouter>[/bold] or [bold]:model <model_name>[/bold][/dim]\n")
|
|
601
|
+
continue
|
|
602
|
+
|
|
581
603
|
if user_input.lower() == ":explain":
|
|
582
604
|
if last_result and last_result.sql:
|
|
583
605
|
print_code(last_result.sql, "sql", "Last Executed SQL")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|