File size: 1,289 Bytes
13fc29d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
Quick QA harness for VineyardChatbot.

Runs a fixed set of questions and prints the responses so we can sanity-check
behaviour before deploy.
"""

from __future__ import annotations

import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parent.parent
if str(ROOT) not in sys.path:
    sys.path.insert(0, str(ROOT))

from src.vineyard_chatbot import VineyardChatbot


def main() -> None:
    bot = VineyardChatbot(verbose=True)

    questions = [
        "What is the state of the vines today?",
        "What was the state of the vines one month ago?",
        "What will be the state of the vines one month from now?",
        "What will be the state of the vines two months from now?",
        "Given today's conditions, what is your shading recommendation for today?",
        "What is your irrigation recommendation for today?",
        "What is your fertiliser recommendation for today?",
    ]

    for i, q in enumerate(questions, 1):
        print("\n" + "=" * 80)
        print(f"Q{i}: {q}")
        try:
            resp = bot.chat(q)
            print("A:", resp.message)
        except Exception as exc:  # noqa: BLE001
            import traceback

            print("ERROR:", exc)
            traceback.print_exc()


if __name__ == "__main__":
    main()