|
57 | 57 | entities: create_workspace_data["entities"], |
58 | 58 | counterexamples: create_workspace_data["counterexamples"], |
59 | 59 | metadata: create_workspace_data["metadata"] |
60 | | -).body |
| 60 | +).result |
61 | 61 | p response |
62 | 62 |
|
63 | 63 | workspace_id = response["workspace_id"] |
|
66 | 66 | response = assistant.get_workspace( |
67 | 67 | workspace_id: workspace_id, |
68 | 68 | export: true |
69 | | -).body |
| 69 | +).result |
70 | 70 | p response |
71 | 71 |
|
72 | 72 | # message |
|
80 | 80 | "deployment" => "myDeployment" |
81 | 81 | } |
82 | 82 | } |
83 | | -).body |
| 83 | +).result |
84 | 84 | p response |
85 | 85 |
|
86 | | -response = assistant.list_workspaces.body |
| 86 | +response = assistant.list_workspaces.result |
87 | 87 | p response |
88 | 88 |
|
89 | 89 | response = assistant.update_workspace( |
90 | 90 | workspace_id: workspace_id, |
91 | 91 | description: "Updated test workspace." |
92 | | -).body |
| 92 | +).result |
93 | 93 | p response |
94 | 94 |
|
95 | 95 | # see cleanup section below for delete_workspace example |
|
104 | 104 | intent: "test_intent", |
105 | 105 | description: "Test intent.", |
106 | 106 | examples: examples |
107 | | -).body |
| 107 | +).result |
108 | 108 | p response |
109 | 109 |
|
110 | 110 | response = assistant.get_intent( |
111 | 111 | workspace_id: workspace_id, |
112 | 112 | intent: "test_intent", |
113 | 113 | export: true |
114 | | -).body |
| 114 | +).result |
115 | 115 | p response |
116 | 116 |
|
117 | 117 | response = assistant.list_intents( |
118 | 118 | workspace_id: workspace_id, |
119 | 119 | export: true |
120 | | -).body |
| 120 | +).result |
121 | 121 | p response |
122 | 122 |
|
123 | 123 | response = assistant.update_intent( |
124 | 124 | workspace_id: workspace_id, |
125 | 125 | intent: "test_intent", |
126 | 126 | new_intent: "updated_test_intent", |
127 | 127 | new_description: "Updated test intent." |
128 | | -).body |
| 128 | +).result |
129 | 129 | p response |
130 | 130 |
|
131 | 131 | # see cleanup section below for delete_intent example |
|
138 | 138 | workspace_id: workspace_id, |
139 | 139 | intent: "updated_test_intent", |
140 | 140 | text: "Gimme a pizza with pepperoni" |
141 | | -).body |
| 141 | +).result |
142 | 142 | p response |
143 | 143 |
|
144 | 144 | response = assistant.get_example( |
145 | 145 | workspace_id: workspace_id, |
146 | 146 | intent: "updated_test_intent", |
147 | 147 | text: "Gimme a pizza with pepperoni" |
148 | | -).body |
| 148 | +).result |
149 | 149 | p response |
150 | 150 |
|
151 | 151 | response = assistant.list_examples( |
152 | 152 | workspace_id: workspace_id, |
153 | 153 | intent: "updated_test_intent" |
154 | | -).body |
| 154 | +).result |
155 | 155 | p response |
156 | 156 |
|
157 | 157 | response = assistant.update_example( |
158 | 158 | workspace_id: workspace_id, |
159 | 159 | intent: "updated_test_intent", |
160 | 160 | text: "Gimme a pizza with pepperoni", |
161 | 161 | new_text: "Gimme a pizza with pepperoni" |
162 | | -).body |
| 162 | +).result |
163 | 163 | p response |
164 | 164 |
|
165 | 165 | response = assistant.delete_example( |
166 | 166 | workspace_id: workspace_id, |
167 | 167 | intent: "updated_test_intent", |
168 | 168 | text: "Gimme a pizza with pepperoni" |
169 | | -).body |
| 169 | +).result |
170 | 170 | p response |
171 | 171 |
|
172 | 172 | ######################### |
|
176 | 176 | response = assistant.create_counterexample( |
177 | 177 | workspace_id: workspace_id, |
178 | 178 | text: "I want financial advice today." |
179 | | -).body |
| 179 | +).result |
180 | 180 | p response |
181 | 181 |
|
182 | 182 | response = assistant.get_counterexample( |
183 | 183 | workspace_id: workspace_id, |
184 | 184 | text: "I want financial advice today." |
185 | | -).body |
| 185 | +).result |
186 | 186 | p response |
187 | 187 |
|
188 | | -response = assistant.list_counterexamples(workspace_id: workspace_id).body |
| 188 | +response = assistant.list_counterexamples(workspace_id: workspace_id).result |
189 | 189 | p response |
190 | 190 |
|
191 | 191 | response = assistant.update_counterexample( |
192 | 192 | workspace_id: workspace_id, |
193 | 193 | text: "I want financial advice today.", |
194 | 194 | new_text: "I want financial advice today." |
195 | | -).body |
| 195 | +).result |
196 | 196 | p response |
197 | 197 |
|
198 | 198 | response = assistant.delete_counterexample( |
199 | 199 | workspace_id: workspace_id, |
200 | 200 | text: "I want financial advice today." |
201 | | -).body |
| 201 | +).result |
202 | 202 | p response |
203 | 203 |
|
204 | 204 | ######################### |
|
211 | 211 | entity: "test_entity", |
212 | 212 | description: "A test entity.", |
213 | 213 | values: values |
214 | | -).body |
| 214 | +).result |
215 | 215 | p response |
216 | 216 |
|
217 | 217 | entities = [ |
|
253 | 253 | workspace_id: workspace_id, |
254 | 254 | entity: entities[0]["entity"], |
255 | 255 | values: entities[0]["values"] |
256 | | -).body |
| 256 | +).result |
257 | 257 | p response |
258 | 258 |
|
259 | 259 | response = assistant.get_entity( |
260 | 260 | workspace_id: workspace_id, |
261 | 261 | entity: entities[0]["entity"], |
262 | 262 | export: true |
263 | | -).body |
| 263 | +).result |
264 | 264 | p response |
265 | 265 |
|
266 | | -response = assistant.list_entities(workspace_id: workspace_id).body |
| 266 | +response = assistant.list_entities(workspace_id: workspace_id).result |
267 | 267 | p response |
268 | 268 |
|
269 | 269 | response = assistant.update_entity( |
270 | 270 | workspace_id: workspace_id, |
271 | 271 | entity: "test_entity", |
272 | 272 | new_description: "An updated test entity." |
273 | | -).body |
| 273 | +).result |
274 | 274 | p response |
275 | 275 |
|
276 | 276 | response = assistant.delete_entity( |
277 | 277 | workspace_id: workspace_id, |
278 | 278 | entity: "test_entity" |
279 | | -).body |
| 279 | +).result |
280 | 280 | p response |
281 | 281 |
|
282 | 282 | ######################### |
|
295 | 295 | entity: "beverage", |
296 | 296 | value: "orange juice", |
297 | 297 | synonym: "oj" |
298 | | -).body |
| 298 | +).result |
299 | 299 | p response |
300 | 300 |
|
301 | 301 | response = assistant.get_synonym( |
302 | 302 | workspace_id: workspace_id, |
303 | 303 | entity: "beverage", |
304 | 304 | value: "orange juice", |
305 | 305 | synonym: "oj" |
306 | | -).body |
| 306 | +).result |
307 | 307 | p response |
308 | 308 |
|
309 | 309 | response = assistant.list_synonyms( |
310 | 310 | workspace_id: workspace_id, |
311 | 311 | entity: "beverage", |
312 | 312 | value: "orange juice" |
313 | | -).body |
| 313 | +).result |
314 | 314 | p response |
315 | 315 |
|
316 | 316 | response = assistant.update_synonym( |
|
319 | 319 | value: "orange juice", |
320 | 320 | synonym: "oj", |
321 | 321 | new_synonym: "OJ" |
322 | | -).body |
| 322 | +).result |
323 | 323 | p response |
324 | 324 |
|
325 | 325 | response = assistant.delete_synonym( |
326 | 326 | workspace_id: workspace_id, |
327 | 327 | entity: "beverage", |
328 | 328 | value: "orange juice", |
329 | 329 | synonym: "OJ" |
330 | | -).body |
| 330 | +).result |
331 | 331 | p response |
332 | 332 |
|
333 | 333 | assistant.delete_entity(workspace_id: workspace_id, entity: "beverage") |
|
342 | 342 | workspace_id: workspace_id, |
343 | 343 | entity: "test_entity", |
344 | 344 | value: "test" |
345 | | -).body |
| 345 | +).result |
346 | 346 | p response |
347 | 347 |
|
348 | 348 | response = assistant.get_value( |
349 | 349 | workspace_id: workspace_id, |
350 | 350 | entity: "test_entity", |
351 | 351 | value: "test" |
352 | | -).body |
| 352 | +).result |
353 | 353 | p response |
354 | 354 |
|
355 | 355 | response = assistant.list_values( |
356 | 356 | workspace_id: workspace_id, |
357 | 357 | entity: "test_entity" |
358 | | -).body |
| 358 | +).result |
359 | 359 | p response |
360 | 360 |
|
361 | 361 | response = assistant.update_value( |
362 | 362 | workspace_id: workspace_id, |
363 | 363 | entity: "test_entity", |
364 | 364 | value: "test", |
365 | 365 | new_value: "example" |
366 | | -).body |
| 366 | +).result |
367 | 367 | p response |
368 | 368 |
|
369 | 369 | response = assistant.delete_value( |
370 | 370 | workspace_id: workspace_id, |
371 | 371 | entity: "test_entity", |
372 | 372 | value: "example" |
373 | | -).body |
| 373 | +).result |
374 | 374 | p response |
375 | 375 |
|
376 | 376 | assistant.delete_entity(workspace_id: workspace_id, entity: "test_entity") |
|
396 | 396 | dialog_node: create_dialog_node["dialog_node"], |
397 | 397 | description: create_dialog_node["description"], |
398 | 398 | actions: create_dialog_node["actions"] |
399 | | -).body |
| 399 | +).result |
400 | 400 | p response |
401 | 401 |
|
402 | 402 | response = assistant.get_dialog_node( |
403 | 403 | workspace_id: workspace_id, |
404 | 404 | dialog_node: create_dialog_node["dialog_node"] |
405 | | -).body |
| 405 | +).result |
406 | 406 | p response |
407 | 407 |
|
408 | | -response = assistant.list_dialog_nodes(workspace_id: workspace_id).body |
| 408 | +response = assistant.list_dialog_nodes(workspace_id: workspace_id).result |
409 | 409 | p response |
410 | 410 |
|
411 | 411 | response = assistant.update_dialog_node( |
412 | 412 | workspace_id: workspace_id, |
413 | 413 | dialog_node: create_dialog_node["dialog_node"], |
414 | 414 | new_dialog_node: "updated_node" |
415 | | -).body |
| 415 | +).result |
416 | 416 | p response |
417 | 417 |
|
418 | | -response = assistant.delete_dialog_node(workspace_id: workspace_id, dialog_node: "updated_node").body |
| 418 | +response = assistant.delete_dialog_node(workspace_id: workspace_id, dialog_node: "updated_node").result |
419 | 419 | p response |
420 | 420 |
|
421 | 421 | ######################### |
422 | 422 | # Logs |
423 | 423 | ######################### |
424 | 424 |
|
425 | | -response = assistant.list_logs(workspace_id: workspace_id).body |
| 425 | +response = assistant.list_logs(workspace_id: workspace_id).result |
426 | 426 | p response |
427 | 427 |
|
428 | 428 | ######################### |
|
432 | 432 | response = assistant.delete_intent( |
433 | 433 | workspace_id: workspace_id, |
434 | 434 | intent: "updated_test_intent" |
435 | | -).body |
| 435 | +).result |
436 | 436 | p response |
437 | 437 |
|
438 | | -response = assistant.delete_workspace(workspace_id: workspace_id).body |
| 438 | +response = assistant.delete_workspace(workspace_id: workspace_id).result |
439 | 439 | p response |
0 commit comments