feat(rag): add --embed-model flag with nomic-embed-text default
Some checks failed
CI / test (push) Failing after 15s

This commit is contained in:
2026-05-04 18:41:55 +02:00
parent be181c2d7f
commit 5529960e79

View File

@@ -12,7 +12,7 @@ from rich.panel import Panel
from rich.rule import Rule from rich.rule import Rule
from rich.text import Text from rich.text import Text
from tai.ai_client import DEFAULT_AI_HOST, DEFAULT_MODEL, AIClient, AIConfig from tai.ai_client import DEFAULT_AI_HOST, DEFAULT_EMBED_MODEL, DEFAULT_MODEL, AIClient, AIConfig
from tai.ai_guardrails import validate_ai_response from tai.ai_guardrails import validate_ai_response
from tai.collectors import CollectionReport, collect_from_plan from tai.collectors import CollectionReport, collect_from_plan
from tai.input_parser import InputValidationError, build_request from tai.input_parser import InputValidationError, build_request
@@ -110,6 +110,13 @@ def run(
help="Disable RAG; send full diagnostics to AI instead of retrieved chunks.", help="Disable RAG; send full diagnostics to AI instead of retrieved chunks.",
), ),
] = False, ] = False,
embed_model: Annotated[
str,
typer.Option(
"--embed-model",
help="Embedding model for RAG. Must be pulled in Ollama on the AI host.",
),
] = DEFAULT_EMBED_MODEL,
) -> None: ) -> None:
"""Start an interactive troubleshooting session scaffold.""" """Start an interactive troubleshooting session scaffold."""
try: try:
@@ -145,7 +152,7 @@ def run(
if not (probe or collect or analyze or interactive): if not (probe or collect or analyze or interactive):
return # nothing SSH-related requested return # nothing SSH-related requested
ai_config = AIConfig(host=ai_host, model=model, api_key=ai_key) ai_config = AIConfig(host=ai_host, model=model, api_key=ai_key, embed_model=embed_model)
logger = SessionLogger.create(log_file) if log_file else None logger = SessionLogger.create(log_file) if log_file else None
if analyze or interactive: if analyze or interactive:
console.print(f"[cyan]AI:[/cyan] {AIClient(ai_config).summary()}") console.print(f"[cyan]AI:[/cyan] {AIClient(ai_config).summary()}")