mirror of
http://100.103.83.12:3003/fegger/odoo-at-payroll.git
synced 2026-09-17 16:56:42 +00:00
feat(agent): add odoo review mode with plausibility verdict
This commit is contained in:
+13
-1
@@ -12,6 +12,7 @@ import argparse
|
||||
import ipaddress
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from .config import Config
|
||||
|
||||
@@ -49,8 +50,17 @@ def _cmd_ingest(args: argparse.Namespace, cfg: Config) -> int:
|
||||
|
||||
def _cmd_ask(args: argparse.Namespace, cfg: Config) -> int:
|
||||
from .generate import answer_question
|
||||
context = None
|
||||
if args.context:
|
||||
try:
|
||||
context = json.loads(Path(args.context).read_text(encoding="utf-8"))
|
||||
except (OSError, json.JSONDecodeError) as e:
|
||||
print(f"[Fehler] Kontext-Datei unlesbar: {e}", file=sys.stderr)
|
||||
return 2
|
||||
try:
|
||||
result = answer_question(args.question, cfg, top_k=args.top_k)
|
||||
result = answer_question(
|
||||
args.question, cfg, top_k=args.top_k, context=context
|
||||
)
|
||||
except Exception as e:
|
||||
print(
|
||||
f"[Fehler] Antwortgenerierung fehlgeschlagen: "
|
||||
@@ -131,6 +141,8 @@ def main(argv: list[str] | None = None) -> int:
|
||||
p_ask = sub.add_parser("ask", help="Frage stellen")
|
||||
p_ask.add_argument("question")
|
||||
p_ask.add_argument("--top-k", type=int, default=None)
|
||||
p_ask.add_argument("--context", default=None,
|
||||
help="JSON-Datei mit schema-gebundenem Odoo-Kontext (review)")
|
||||
p_ask.add_argument("--json", action="store_true")
|
||||
|
||||
p_eval = sub.add_parser("eval", help="Goldset-Evaluation")
|
||||
|
||||
Reference in New Issue
Block a user