forked from getzep/zep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
memory.http
186 lines (164 loc) · 5.46 KB
/
memory.http
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
### GetHealthz request with test checking status
GET {{host}}/healthz
> {%
client.test("Health check executed successfully", function () {
client.assert(response.status === 200, "Health check status is not 200");
});
%}
### PostMemory request with test checking status and body content
POST {{host}}/api/v1/sessions/{{$uuid}}/memory
Content-Type: application/json
{
"messages": [
{
"Role": "user",
"Content": "Hello"
},
{
"Role": "assistant",
"Content": "Hi there!"
},
{
"Role": "user",
"Content": "I'm looking to plan a trip to Iceland. Can you help me?"
},
{
"Role": "assistant",
"Content": "Of course! I'd be happy to help you plan your trip."
},
{
"Role": "user",
"Content": "What's the best time of year to go?"
},
{
"Role": "assistant",
"Content": "The best time to visit Iceland is from June to August. The weather is milder, and you'll have more daylight for sightseeing."
},
{
"Role": "user",
"Content": "Do I need a visa?"
},
{
"Role": "assistant",
"Content": "Visa requirements depend on your nationality. Citizens of the Schengen Area, the US, Canada, and several other countries can visit Iceland for up to 90 days without a visa."
},
{
"Role": "user",
"Content": "What are some must-see attractions?"
},
{
"Role": "assistant",
"Content": "Some popular attractions include the Blue Lagoon, Golden Circle, Reynisfjara Black Sand Beach, Gulfoss waterfall, and the Jökulsárlón Glacier Lagoon."
},
{
"Role": "user",
"Content": "What should I pack?"
},
{
"Role": "assistant",
"Content": "Pack warm and waterproof clothing, layers for temperature changes, comfortable walking shoes, a swimsuit for hot springs, and a camera to capture the beautiful scenery."
},
{
"Role": "user",
"Content": "Should I rent a car?"
},
{
"Role": "assistant",
"Content": "Renting a car is a great idea if you plan on exploring areas outside of Reykjavik. It gives you more freedom to travel at your own pace and visit remote locations."
},
{
"Role": "user",
"Content": "How much does a trip to Iceland typically cost?"
},
{
"Role": "assistant",
"Content": "Iceland can be expensive. Costs depend on factors like accommodations, activities, and dining preferences. However, you can expect to spend around $200-$300 per day, not including flights."
},
{
"Role": "user",
"Content": "Is it easy to find vegetarian or vegan food in Iceland?"
},
{
"Role": "assistant",
"Content": "Yes, Reykjavik has several vegetarian and vegan-friendly restaurants. In smaller towns, you may find fewer options, but most places will have some vegetarian dishes available."
},
{
"Role": "user",
"Content": "Thank you for all this information! I'm excited to start planning my trip."
},
{
"Role": "assistant",
"Content": "You're welcome! Have a great time planning and enjoy your trip to Iceland!",
"Metadata": {
"foo": "bar"
}
}
]
}
> {%
let urlArray = request.url().split("/");
let uuid = urlArray[urlArray.length - 2];
client.global.set("session_uuid", uuid);
client.test("Memory post request executed successfully", function () {
client.assert(response.status === 200, "Memory post request status is not 200");
});
// client.test("Memory post response body has 'Role'", function() {
// client.assert(response.body.hasOwnProperty("Role"), "Memory post request body does not contain 'Role'");
// });
//
// client.test("Memory post response body has 'Content'", function() {
// client.assert(response.body.hasOwnProperty("Content"), "Memory post request body does not contain 'Content'");
// });
%}
### GetMemory request with test checking status
GET {{host}}/api/v1/sessions/{{session_uuid}}/memory
> {%
client.test("Memory get request executed successfully", function () {
client.assert(response.status === 200, "Memory get request status is not 200");
});
%}
### Get Session with test checking status
GET {{host}}/api/v1/sessions/{{session_uuid}}
> {%
client.test("Get session request executed successfully", function () {
client.assert(response.status === 200, "Get session request status is not 200");
});
%}
### Post Session and Metadata with test checking status
POST {{host}}/api/v1/sessions/{{session_uuid}}
Content-Type: application/json
{
"metadata": {
"foo": "bar"
}
}
> {%
client.test("Post session request executed successfully", function () {
client.assert(response.status === 200, "Post session request status is not 200");
});
%}
### Search Simple
POST {{host}}/api/v1/sessions/{{session_uuid}}/search
Content-Type: application/json
{
"text": "What food is served in Iceland?"
}
> {%
client.test("Search request executed successfully", function () {
client.assert(response.status === 200, "Search request status is not 200");
});
%}
### Search with Metadata
POST {{host}}/api/v1/sessions/{{session_uuid}}/search
Content-Type: application/json
{
"text": "What food is served in Iceland?",
"metadata": {
"foo": {"baz": "bar"}
}
}
> {%
client.test("Search request executed successfully", function () {
client.assert(response.status === 200, "Search request status is not 200");
});
%}