-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify_flow.py
More file actions
59 lines (48 loc) · 1.72 KB
/
verify_flow.py
File metadata and controls
59 lines (48 loc) · 1.72 KB
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
50
51
52
53
54
55
56
57
58
59
import os
import sys
from pathlib import Path
from dotenv import load_dotenv
load_dotenv()
# Add src to path so we can import without installing
sys.path.append(str(Path(__file__).parent / "src"))
from llm_session import Automator
def main():
print("--- Starting Verification ---")
email = os.getenv("LLM_EMAIL", "your_email@gmail.com")
password = os.getenv("LLM_PASSWORD", "your_password")
try:
# Initialize Automator (this handles setup & auth)
# We use headless=False for the first run to see what's happening, or let the user decide.
# But the requirement says "non-interactive", so we should default to True.
# However, for verification, seeing it is nice. Let's stick to the config default (True)
# but maybe allow override.
print("Initializing Automator...")
bot = Automator(
headless=False,
provider="chatgpt",
credentials={
"email": email,
"password": password,
"method": "google"
}
)
# Test 2: Chained Prompt
print("\n[Test 2] Chained Prompt")
chain = [
"Generate a random color name.",
"Write a short poem about {}."
]
responses = bot.process_chain(chain)
print(f"Chain Responses: {responses}")
if len(responses) == 2 and len(responses[1]) > 10:
print(">> Test 2 PASSED")
else:
print(">> Test 2 FAILED")
bot.close()
print("\n--- Verification Complete ---")
except Exception as e:
print(f"\nERROR during verification: {e}")
import traceback
traceback.print_exc()
if __name__ == "__main__":
main()