-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
49 lines (37 loc) · 1.43 KB
/
test.py
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
from template_requests import Template
temp = Template()
# Get all users
# T2 = temp.get_by_all_users()
# print(len(T2))
# print("="*10)
# print(T2)
# print("="*10)
# print(T2[103])
# print(T2[103]["name"])
# Get by template id
# T1 = temp.get_by_template_id("template-dca654c3-8573-4298-bd0b-b3916471e4fa")
# print(T1)
# print("ID: ", T1["id"])
# print("Name: ", T1["name"])
# Create new templates
# template = temp.create_templates("vinoth", "I'm fine. how are you??", "say something")
# print(template)
# print(template["prompt"])
# Update by template id
# to update {'id': 'template-dca654c3-8573-4298-bd0b-b3916471e4fa', 'name': 'dummy user', 'prompt': 'dummy prompt', 'context': 'dummy context'}
# update = temp.update_by_template_id("template-dca654c3-8573-4298-bd0b-b3916471e4fa",
# "Vinoth", "dummy prompt", "dummy context")
# # to check for updation
# T1 = temp.get_by_template_id("template-dca654c3-8573-4298-bd0b-b3916471e4fa")
# print(T1)
# Delete by template ID
# T1 = temp.delete_by_template_id("template-dca654c3-8573-4298-bd0b-b3916471e4fa")
# T1 = temp.get_by_template_id("template-dca654c3-8573-4298-bd0b-b3916471e4fa")
# print(T1)
# # >> {'success': False, 'type': 'error', 'message': 'template: template-dca654c3-8573-4298-bd0b-b3916471e4fa does not exist'}
# Get deleted templates
# T1 = temp.get_deleted_templates()
# print(T1)
# Retrieve all template
T1 = temp.retrieve_all_template()
print(T1)