-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
36 lines (31 loc) · 974 Bytes
/
run.py
File metadata and controls
36 lines (31 loc) · 974 Bytes
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
from workflow import app
from dotenv import load_dotenv
import os
from util.logger import log
# Load environment variables for API keys
load_dotenv()
def main():
# Example configuration with a fake user ID
fake_config = {
"configurable": {
"current_user_id": 1 # Assuming user ID 1 exists in database
}
}
# Example questions
examples = [
"Tell me a joke.",
"Create a new order for Spaghetti Carbonara.",
"What foods are available for purchase?",
"Show me my orders.",
"What's the price of Pizza Margherita?"
]
# Run examples
for i, question in enumerate(examples):
log.infoAndPrint(f"\n---> Example {i+1}: '{question}' ---")
result = app.invoke(
{"question": question, "attempts": 0},
config=fake_config
)
log.infoAndPrint(f"---> Result: {result['query_result']}")
if __name__ == "__main__":
main()