@15gifts/sdk 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +627 -126
- package/dist/index.d.ts +627 -126
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,7 +15,10 @@ interface paths$1 {
|
|
|
15
15
|
};
|
|
16
16
|
get?: never;
|
|
17
17
|
put?: never;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Generate Conversation Json Response
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
19
22
|
post: operations['generate_conversation_json_response_api_conversation_v2_post'];
|
|
20
23
|
delete?: never;
|
|
21
24
|
options?: never;
|
|
@@ -23,6 +26,23 @@ interface paths$1 {
|
|
|
23
26
|
patch?: never;
|
|
24
27
|
trace?: never;
|
|
25
28
|
};
|
|
29
|
+
'/api/conversation/v3': {
|
|
30
|
+
parameters: {
|
|
31
|
+
query?: never;
|
|
32
|
+
header?: never;
|
|
33
|
+
path?: never;
|
|
34
|
+
cookie?: never;
|
|
35
|
+
};
|
|
36
|
+
get?: never;
|
|
37
|
+
put?: never;
|
|
38
|
+
/** Generate Conversation Json Response With Jwt */
|
|
39
|
+
post: operations['generate_conversation_json_response_with_jwt_api_conversation_v3_post'];
|
|
40
|
+
delete?: never;
|
|
41
|
+
options?: never;
|
|
42
|
+
head?: never;
|
|
43
|
+
patch?: never;
|
|
44
|
+
trace?: never;
|
|
45
|
+
};
|
|
26
46
|
'/api/v1/conversation/': {
|
|
27
47
|
parameters: {
|
|
28
48
|
query?: never;
|
|
@@ -97,6 +117,16 @@ interface components {
|
|
|
97
117
|
/** Data */
|
|
98
118
|
data: components['schemas']['ProductInformationChunkQueryResult'][];
|
|
99
119
|
};
|
|
120
|
+
/** ConversationContext */
|
|
121
|
+
ConversationContext: {
|
|
122
|
+
/**
|
|
123
|
+
* Availableproductids
|
|
124
|
+
* @description What product IDs are available to recommend?
|
|
125
|
+
*/
|
|
126
|
+
availableProductIds?: string[] | null;
|
|
127
|
+
} & {
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
};
|
|
100
130
|
/**
|
|
101
131
|
* ConversationHistoryRequest
|
|
102
132
|
* @description A request to retrieve the conversation history
|
|
@@ -113,87 +143,47 @@ interface components {
|
|
|
113
143
|
*/
|
|
114
144
|
end_date: string | null;
|
|
115
145
|
};
|
|
116
|
-
/** ConversationRequest */
|
|
117
|
-
ConversationRequest: {
|
|
118
|
-
/**
|
|
119
|
-
* Customerid
|
|
120
|
-
* @description The customer id
|
|
121
|
-
*/
|
|
122
|
-
customerId: string;
|
|
123
|
-
/**
|
|
124
|
-
* Conversationid
|
|
125
|
-
* @description The conversation id
|
|
126
|
-
*/
|
|
127
|
-
conversationId?: string | null;
|
|
128
|
-
/**
|
|
129
|
-
* Usermessage
|
|
130
|
-
* @description The user message
|
|
131
|
-
*/
|
|
132
|
-
userMessage: string;
|
|
133
|
-
/**
|
|
134
|
-
* Openingmessage
|
|
135
|
-
* @description The opening message of the conversation
|
|
136
|
-
*/
|
|
137
|
-
openingMessage?: string | null;
|
|
138
|
-
/**
|
|
139
|
-
* Userid
|
|
140
|
-
* @description Id to identify the user, this should be unified across the entire product.
|
|
141
|
-
*/
|
|
142
|
-
userId?: string | null;
|
|
143
|
-
/**
|
|
144
|
-
* Sessionid
|
|
145
|
-
* Format: uuid
|
|
146
|
-
* @description Id to identify the session that the conversation is in, this should be unified across the product
|
|
147
|
-
*/
|
|
148
|
-
sessionId: string;
|
|
149
|
-
};
|
|
150
146
|
/**
|
|
151
|
-
*
|
|
152
|
-
* @description
|
|
147
|
+
* ConversationIdChunk
|
|
148
|
+
* @description We're giving the caller a new Conversation ID
|
|
153
149
|
*/
|
|
154
|
-
|
|
150
|
+
ConversationIdChunk: {
|
|
155
151
|
/**
|
|
156
152
|
* Type
|
|
157
|
-
* @default
|
|
153
|
+
* @default CONVERSATION_ID
|
|
158
154
|
* @constant
|
|
159
155
|
* @enum {string}
|
|
160
156
|
*/
|
|
161
|
-
type: '
|
|
157
|
+
type: 'CONVERSATION_ID';
|
|
162
158
|
/**
|
|
163
159
|
* Conversationid
|
|
164
|
-
*
|
|
165
|
-
* @description Unique identifier for the conversation. If an id is given in the request, the same id is returned in the response.
|
|
160
|
+
* @description Unique identifier for the conversation. This will be generated once, at the start of a conversation.
|
|
166
161
|
*/
|
|
167
|
-
conversationId: string;
|
|
168
|
-
/**
|
|
169
|
-
* Records
|
|
170
|
-
* @description List of debug records.
|
|
171
|
-
*/
|
|
172
|
-
records: (components['schemas']['EmbeddingTokenCountRecord'] | components['schemas']['SystemPromptRecord'] | components['schemas']['TriggeredBranchesRecord'] | components['schemas']['ActionsMatchedByTriggeredBranchesRecord'] | components['schemas']['RunActionDetailsRecord'] | components['schemas']['MaxCosineSimilarityScoresRecord'] | components['schemas']['LLMTokenCountRecord'] | components['schemas']['ContextChunksRecord'] | components['schemas']['ApplicationVersionRecord'] | components['schemas']['DBVersionRecord'] | components['schemas']['PhraseTokenProbabilitiesRecord'] | components['schemas']['ConversationTurnIDRecord'])[];
|
|
162
|
+
conversationId: string | null;
|
|
173
163
|
};
|
|
174
|
-
/**
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
164
|
+
/** ConversationOption */
|
|
165
|
+
ConversationOption: {
|
|
166
|
+
/** Label */
|
|
167
|
+
label: string;
|
|
168
|
+
/** Value */
|
|
169
|
+
value: string;
|
|
170
|
+
};
|
|
171
|
+
/** ConversationStageTransitionRecord */
|
|
172
|
+
ConversationStageTransitionRecord: {
|
|
179
173
|
/**
|
|
180
|
-
*
|
|
181
|
-
* @default
|
|
174
|
+
* Id
|
|
175
|
+
* @default conversation_stage_transition
|
|
182
176
|
* @constant
|
|
183
177
|
* @enum {string}
|
|
184
178
|
*/
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* Conversationid
|
|
188
|
-
* Format: uuid
|
|
189
|
-
* @description Unique identifier for the conversation. If an id is given in the request, the same id is returned in the response.
|
|
190
|
-
*/
|
|
191
|
-
conversationId: string;
|
|
179
|
+
id: 'conversation_stage_transition';
|
|
192
180
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
181
|
+
* Timestamp
|
|
182
|
+
* Format: date-time
|
|
195
183
|
*/
|
|
196
|
-
|
|
184
|
+
timestamp?: string;
|
|
185
|
+
/** Data */
|
|
186
|
+
data: string;
|
|
197
187
|
};
|
|
198
188
|
/** ConversationTurnIDRecord */
|
|
199
189
|
ConversationTurnIDRecord: {
|
|
@@ -235,6 +225,24 @@ interface components {
|
|
|
235
225
|
*/
|
|
236
226
|
db_version: string;
|
|
237
227
|
};
|
|
228
|
+
/**
|
|
229
|
+
* DebugChunk
|
|
230
|
+
* @description Model for the debug chunk returned in the streaming response by the conversation endpoint.
|
|
231
|
+
*/
|
|
232
|
+
DebugChunk: {
|
|
233
|
+
/**
|
|
234
|
+
* Type
|
|
235
|
+
* @default DEBUG
|
|
236
|
+
* @constant
|
|
237
|
+
* @enum {string}
|
|
238
|
+
*/
|
|
239
|
+
type: 'DEBUG';
|
|
240
|
+
/**
|
|
241
|
+
* Records
|
|
242
|
+
* @description List of debug records.
|
|
243
|
+
*/
|
|
244
|
+
records: (components['schemas']['EmbeddingTokenCountRecord'] | components['schemas']['SystemPromptRecord'] | components['schemas']['TriggeredBranchesRecord'] | components['schemas']['ActionsMatchedByTriggeredBranchesRecord'] | components['schemas']['RunActionDetailsRecord'] | components['schemas']['MaxCosineSimilarityScoresRecord'] | components['schemas']['LLMTokenCountRecord'] | components['schemas']['ContextChunksRecord'] | components['schemas']['ApplicationVersionRecord'] | components['schemas']['DBVersionRecord'] | components['schemas']['PhraseTokenProbabilitiesRecord'] | components['schemas']['ConversationTurnIDRecord'] | components['schemas']['ConversationStageTransitionRecord'])[];
|
|
245
|
+
};
|
|
238
246
|
/** EmbeddingTokenCountRecord */
|
|
239
247
|
EmbeddingTokenCountRecord: {
|
|
240
248
|
/**
|
|
@@ -251,17 +259,61 @@ interface components {
|
|
|
251
259
|
timestamp?: string;
|
|
252
260
|
data: components['schemas']['app__debug_stash__types__EmbeddingTokenCountRecord__Data'];
|
|
253
261
|
};
|
|
262
|
+
/**
|
|
263
|
+
* ExitToChatChunk
|
|
264
|
+
* @description The conversation has reached a point where we heed to pass it to human involvement
|
|
265
|
+
*/
|
|
266
|
+
ExitToChatChunk: {
|
|
267
|
+
/**
|
|
268
|
+
* Type
|
|
269
|
+
* @default EXIT_TO_CHAT
|
|
270
|
+
* @constant
|
|
271
|
+
* @enum {string}
|
|
272
|
+
*/
|
|
273
|
+
type: 'EXIT_TO_CHAT';
|
|
274
|
+
/**
|
|
275
|
+
* Fallbackmessage
|
|
276
|
+
* @description What should a client render if they do not have a native renderer for this message type?
|
|
277
|
+
*/
|
|
278
|
+
fallbackMessage: string;
|
|
279
|
+
/**
|
|
280
|
+
* Conversationsummary
|
|
281
|
+
* @description A summary of the conversation so far
|
|
282
|
+
*/
|
|
283
|
+
conversationSummary: string;
|
|
284
|
+
/** @description Why have we been exited to chat? */
|
|
285
|
+
reason: components['schemas']['ExitToChatReason'];
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* ExitToChatReason
|
|
289
|
+
* @enum {string}
|
|
290
|
+
*/
|
|
291
|
+
ExitToChatReason: 'WANT_TO_TALK_TO_HUMAN' | 'OUT_OF_SCOPE_QUESTIONS' | 'NOT_BEHAVING_CORRECTLY';
|
|
292
|
+
/**
|
|
293
|
+
* ExitToPurchaseChunk
|
|
294
|
+
* @description The customer wants to buy something
|
|
295
|
+
*/
|
|
296
|
+
ExitToPurchaseChunk: {
|
|
297
|
+
/**
|
|
298
|
+
* Type
|
|
299
|
+
* @default EXIT_TO_PURCHASE
|
|
300
|
+
* @constant
|
|
301
|
+
* @enum {string}
|
|
302
|
+
*/
|
|
303
|
+
type: 'EXIT_TO_PURCHASE';
|
|
304
|
+
/**
|
|
305
|
+
* Fallbackmessage
|
|
306
|
+
* @description What should a client render if they do not have a native renderer for this message type?
|
|
307
|
+
*/
|
|
308
|
+
fallbackMessage: string;
|
|
309
|
+
/** Products */
|
|
310
|
+
products: components['schemas']['Product'][];
|
|
311
|
+
};
|
|
254
312
|
/** HTTPValidationError */
|
|
255
313
|
HTTPValidationError: {
|
|
256
314
|
/** Detail */
|
|
257
315
|
detail?: components['schemas']['ValidationError'][];
|
|
258
316
|
};
|
|
259
|
-
/**
|
|
260
|
-
* IndustryEnum
|
|
261
|
-
* @constant
|
|
262
|
-
* @enum {string}
|
|
263
|
-
*/
|
|
264
|
-
IndustryEnum: 'telco';
|
|
265
317
|
/** LLMTokenCountRecord */
|
|
266
318
|
LLMTokenCountRecord: {
|
|
267
319
|
/**
|
|
@@ -297,6 +349,52 @@ interface components {
|
|
|
297
349
|
[key: string]: number;
|
|
298
350
|
};
|
|
299
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* MessageChunk
|
|
354
|
+
* @description A text-based item for clients to render
|
|
355
|
+
*/
|
|
356
|
+
MessageChunk: {
|
|
357
|
+
/**
|
|
358
|
+
* Type
|
|
359
|
+
* @default MESSAGE
|
|
360
|
+
* @constant
|
|
361
|
+
* @enum {string}
|
|
362
|
+
*/
|
|
363
|
+
type: 'MESSAGE';
|
|
364
|
+
/**
|
|
365
|
+
* Message
|
|
366
|
+
* @description Message for the conversation.
|
|
367
|
+
*/
|
|
368
|
+
message: string;
|
|
369
|
+
};
|
|
370
|
+
/**
|
|
371
|
+
* MultiSelectChunk
|
|
372
|
+
* @description A multi-select renderer - given a list of options, pick one or more
|
|
373
|
+
*/
|
|
374
|
+
MultiSelectChunk: {
|
|
375
|
+
/**
|
|
376
|
+
* Type
|
|
377
|
+
* @default MULTI_SELECT
|
|
378
|
+
* @constant
|
|
379
|
+
* @enum {string}
|
|
380
|
+
*/
|
|
381
|
+
type: 'MULTI_SELECT';
|
|
382
|
+
/**
|
|
383
|
+
* Fallbackmessage
|
|
384
|
+
* @description What should a client render if they do not have a native renderer for this message type?
|
|
385
|
+
*/
|
|
386
|
+
fallbackMessage: string;
|
|
387
|
+
/**
|
|
388
|
+
* Options
|
|
389
|
+
* @description What selectable options should be available?
|
|
390
|
+
*/
|
|
391
|
+
options: components['schemas']['ConversationOption'][];
|
|
392
|
+
/**
|
|
393
|
+
* Allowfreetext
|
|
394
|
+
* @description Should we expect a free text response to this message?
|
|
395
|
+
*/
|
|
396
|
+
allowFreeText: boolean;
|
|
397
|
+
};
|
|
300
398
|
/** PhraseTokenProbabilitiesRecord */
|
|
301
399
|
PhraseTokenProbabilitiesRecord: {
|
|
302
400
|
/**
|
|
@@ -314,12 +412,22 @@ interface components {
|
|
|
314
412
|
/** Phrase Token Probabilities */
|
|
315
413
|
phrase_token_probabilities: components['schemas']['RootModel_list_TokenProbabilityRecord__'][];
|
|
316
414
|
};
|
|
317
|
-
/**
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
|
|
415
|
+
/** Product */
|
|
416
|
+
Product: {
|
|
417
|
+
/** Id */
|
|
418
|
+
id: string;
|
|
419
|
+
/** Name */
|
|
420
|
+
name: string;
|
|
421
|
+
/**
|
|
422
|
+
* Descriptiveprice
|
|
423
|
+
* @description A user-readable form of the price of this item.
|
|
424
|
+
*/
|
|
425
|
+
descriptivePrice: string;
|
|
426
|
+
/**
|
|
427
|
+
* Url
|
|
428
|
+
* @description Where can we find this product?
|
|
429
|
+
*/
|
|
430
|
+
url: string;
|
|
323
431
|
};
|
|
324
432
|
/** ProductInformationChunkQueryResult */
|
|
325
433
|
ProductInformationChunkQueryResult: {
|
|
@@ -327,11 +435,42 @@ interface components {
|
|
|
327
435
|
text: string;
|
|
328
436
|
/** Customer Id */
|
|
329
437
|
customer_id: string;
|
|
330
|
-
metadata: components['schemas']['ProductInformationChunkMetadata'];
|
|
331
|
-
industry: components['schemas']['IndustryEnum'];
|
|
332
438
|
/** Similarity Score */
|
|
333
439
|
similarity_score: number;
|
|
334
440
|
};
|
|
441
|
+
/** Recommendation */
|
|
442
|
+
Recommendation: {
|
|
443
|
+
/**
|
|
444
|
+
* Explanation
|
|
445
|
+
* @description Why was this recommendation made?
|
|
446
|
+
*/
|
|
447
|
+
explanation: string;
|
|
448
|
+
/**
|
|
449
|
+
* Products
|
|
450
|
+
* @description The IDs of the products that make up this recommendation
|
|
451
|
+
*/
|
|
452
|
+
products: components['schemas']['Product'][];
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* RecommendationChunk
|
|
456
|
+
* @description The conversation has reached a point where we can make one or more recommendations
|
|
457
|
+
*/
|
|
458
|
+
RecommendationChunk: {
|
|
459
|
+
/**
|
|
460
|
+
* Type
|
|
461
|
+
* @default RECOMMENDATION
|
|
462
|
+
* @constant
|
|
463
|
+
* @enum {string}
|
|
464
|
+
*/
|
|
465
|
+
type: 'RECOMMENDATION';
|
|
466
|
+
/**
|
|
467
|
+
* Fallbackmessage
|
|
468
|
+
* @description What should a client render if they do not have a native renderer for this message type?
|
|
469
|
+
*/
|
|
470
|
+
fallbackMessage: string;
|
|
471
|
+
/** Recommendations */
|
|
472
|
+
recommendations: components['schemas']['Recommendation'][];
|
|
473
|
+
};
|
|
335
474
|
/** RootModel[list[TokenProbabilityRecord]] */
|
|
336
475
|
RootModel_list_TokenProbabilityRecord__: components['schemas']['TokenProbabilityRecord'][];
|
|
337
476
|
/** RunActionDetailsRecord */
|
|
@@ -350,15 +489,57 @@ interface components {
|
|
|
350
489
|
timestamp?: string;
|
|
351
490
|
data: components['schemas']['app__debug_stash__types__RunActionDetailsRecord__Data'];
|
|
352
491
|
};
|
|
492
|
+
/**
|
|
493
|
+
* SingleSelectChunk
|
|
494
|
+
* @description A single-select renderer - given a list of options, pick one
|
|
495
|
+
*/
|
|
496
|
+
SingleSelectChunk: {
|
|
497
|
+
/**
|
|
498
|
+
* Type
|
|
499
|
+
* @default SINGLE_SELECT
|
|
500
|
+
* @constant
|
|
501
|
+
* @enum {string}
|
|
502
|
+
*/
|
|
503
|
+
type: 'SINGLE_SELECT';
|
|
504
|
+
/**
|
|
505
|
+
* Fallbackmessage
|
|
506
|
+
* @description What should a client render if they do not have a native renderer for this message type?
|
|
507
|
+
*/
|
|
508
|
+
fallbackMessage: string;
|
|
509
|
+
/**
|
|
510
|
+
* Options
|
|
511
|
+
* @description What selectable options should be available?
|
|
512
|
+
*/
|
|
513
|
+
options: components['schemas']['ConversationOption'][];
|
|
514
|
+
/**
|
|
515
|
+
* Allowfreetext
|
|
516
|
+
* @description Should we expect a free text response to this message?
|
|
517
|
+
*/
|
|
518
|
+
allowFreeText: boolean;
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* StartConversationRequest
|
|
522
|
+
* @description We are starting a new conversation, please give us a conversation ID back
|
|
523
|
+
*/
|
|
524
|
+
StartConversationRequest: {
|
|
525
|
+
/**
|
|
526
|
+
* Type
|
|
527
|
+
* @default START_CONVERSATION
|
|
528
|
+
* @constant
|
|
529
|
+
* @enum {string}
|
|
530
|
+
*/
|
|
531
|
+
type: 'START_CONVERSATION';
|
|
532
|
+
/** @description Context information we'll be getting with the request */
|
|
533
|
+
conversationContext: components['schemas']['ConversationContext'];
|
|
534
|
+
};
|
|
353
535
|
/** SystemPromptRecord */
|
|
354
536
|
SystemPromptRecord: {
|
|
355
537
|
/**
|
|
356
538
|
* Id
|
|
357
539
|
* @default system_prompt
|
|
358
|
-
* @constant
|
|
359
540
|
* @enum {string}
|
|
360
541
|
*/
|
|
361
|
-
id: 'system_prompt';
|
|
542
|
+
id: 'system_prompt' | 'sales_framework_system_prompt' | 'conversation_stage_transition_prompt';
|
|
362
543
|
/**
|
|
363
544
|
* Timestamp
|
|
364
545
|
* Format: date-time
|
|
@@ -402,6 +583,232 @@ interface components {
|
|
|
402
583
|
/** Error Type */
|
|
403
584
|
type: string;
|
|
404
585
|
};
|
|
586
|
+
/**
|
|
587
|
+
* MessageRequest
|
|
588
|
+
* @description A standard, text-based message from an end-user
|
|
589
|
+
*/
|
|
590
|
+
app__conversation__models__input__MessageRequest: {
|
|
591
|
+
/**
|
|
592
|
+
* Type
|
|
593
|
+
* @default MESSAGE
|
|
594
|
+
* @constant
|
|
595
|
+
* @enum {string}
|
|
596
|
+
*/
|
|
597
|
+
type: 'MESSAGE';
|
|
598
|
+
/**
|
|
599
|
+
* Conversationid
|
|
600
|
+
* @description The conversation id
|
|
601
|
+
*/
|
|
602
|
+
conversationId?: string | null;
|
|
603
|
+
/**
|
|
604
|
+
* Usermessage
|
|
605
|
+
* @description The user message
|
|
606
|
+
*/
|
|
607
|
+
userMessage: string;
|
|
608
|
+
};
|
|
609
|
+
/**
|
|
610
|
+
* MultiSelectRequest
|
|
611
|
+
* @description A message from the end user that picks multiple select items
|
|
612
|
+
*/
|
|
613
|
+
app__conversation__models__input__MultiSelectRequest: {
|
|
614
|
+
/**
|
|
615
|
+
* Type
|
|
616
|
+
* @default MULTI_SELECT
|
|
617
|
+
* @constant
|
|
618
|
+
* @enum {string}
|
|
619
|
+
*/
|
|
620
|
+
type: 'MULTI_SELECT';
|
|
621
|
+
/**
|
|
622
|
+
* Conversationid
|
|
623
|
+
* @description The conversation id
|
|
624
|
+
*/
|
|
625
|
+
conversationId?: string | null;
|
|
626
|
+
/**
|
|
627
|
+
* Usermessage
|
|
628
|
+
* @description The user message
|
|
629
|
+
*/
|
|
630
|
+
userMessage?: string | null;
|
|
631
|
+
/**
|
|
632
|
+
* Options
|
|
633
|
+
* @description Which select options were picked?
|
|
634
|
+
*/
|
|
635
|
+
options: string[];
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* SingleSelectRequest
|
|
639
|
+
* @description A message from the end user that picks a single select item
|
|
640
|
+
*/
|
|
641
|
+
app__conversation__models__input__SingleSelectRequest: {
|
|
642
|
+
/**
|
|
643
|
+
* Type
|
|
644
|
+
* @default SINGLE_SELECT
|
|
645
|
+
* @constant
|
|
646
|
+
* @enum {string}
|
|
647
|
+
*/
|
|
648
|
+
type: 'SINGLE_SELECT';
|
|
649
|
+
/**
|
|
650
|
+
* Conversationid
|
|
651
|
+
* @description The conversation id
|
|
652
|
+
*/
|
|
653
|
+
conversationId?: string | null;
|
|
654
|
+
/**
|
|
655
|
+
* Usermessage
|
|
656
|
+
* @description The user message
|
|
657
|
+
*/
|
|
658
|
+
userMessage?: string | null;
|
|
659
|
+
/**
|
|
660
|
+
* Option
|
|
661
|
+
* @description Which select option was picked?
|
|
662
|
+
*/
|
|
663
|
+
option: string;
|
|
664
|
+
};
|
|
665
|
+
/** ConversationRequest */
|
|
666
|
+
app__conversation__models__v1__input__ConversationRequest: {
|
|
667
|
+
/**
|
|
668
|
+
* Conversationid
|
|
669
|
+
* @description The conversation id
|
|
670
|
+
*/
|
|
671
|
+
conversationId?: string | null;
|
|
672
|
+
/**
|
|
673
|
+
* Usermessage
|
|
674
|
+
* @description The user message
|
|
675
|
+
*/
|
|
676
|
+
userMessage: string;
|
|
677
|
+
/**
|
|
678
|
+
* Openingmessage
|
|
679
|
+
* @description The opening message of the conversation
|
|
680
|
+
*/
|
|
681
|
+
openingMessage?: string | null;
|
|
682
|
+
/**
|
|
683
|
+
* Customerid
|
|
684
|
+
* @description The customer id
|
|
685
|
+
*/
|
|
686
|
+
customerId: string;
|
|
687
|
+
/**
|
|
688
|
+
* Userid
|
|
689
|
+
* @description Id to identify the user, this should be unified across the entire product.
|
|
690
|
+
*/
|
|
691
|
+
userId?: string | null;
|
|
692
|
+
/**
|
|
693
|
+
* Sessionid
|
|
694
|
+
* Format: uuid
|
|
695
|
+
* @description Id to identify the session that the conversation is in, this should be unified across the product
|
|
696
|
+
*/
|
|
697
|
+
sessionId: string;
|
|
698
|
+
};
|
|
699
|
+
/** ConversationRequest */
|
|
700
|
+
app__conversation__models__v2__input__ConversationRequest: components['schemas']['app__conversation__models__v2__input__MessageRequest'] | components['schemas']['app__conversation__models__v2__input__SingleSelectRequest'] | components['schemas']['app__conversation__models__v2__input__MultiSelectRequest'];
|
|
701
|
+
/**
|
|
702
|
+
* MessageRequest
|
|
703
|
+
* @description A standard, text-based message from an end-user
|
|
704
|
+
*/
|
|
705
|
+
app__conversation__models__v2__input__MessageRequest: {
|
|
706
|
+
/**
|
|
707
|
+
* Conversationid
|
|
708
|
+
* @description The conversation id
|
|
709
|
+
*/
|
|
710
|
+
conversationId?: string | null;
|
|
711
|
+
/**
|
|
712
|
+
* Customerid
|
|
713
|
+
* @description The customer id
|
|
714
|
+
*/
|
|
715
|
+
customerId: string;
|
|
716
|
+
/**
|
|
717
|
+
* Userid
|
|
718
|
+
* @description Id to identify the user, this should be unified across the entire product.
|
|
719
|
+
*/
|
|
720
|
+
userId?: string | null;
|
|
721
|
+
/**
|
|
722
|
+
* Sessionid
|
|
723
|
+
* Format: uuid
|
|
724
|
+
* @description Id to identify the session that the conversation is in, this should be unified across the product
|
|
725
|
+
*/
|
|
726
|
+
sessionId: string;
|
|
727
|
+
/**
|
|
728
|
+
* Usermessage
|
|
729
|
+
* @description The user message
|
|
730
|
+
*/
|
|
731
|
+
userMessage: string;
|
|
732
|
+
/**
|
|
733
|
+
* Openingmessage
|
|
734
|
+
* @description The opening message of the conversation
|
|
735
|
+
*/
|
|
736
|
+
openingMessage?: string | null;
|
|
737
|
+
};
|
|
738
|
+
/**
|
|
739
|
+
* MultiSelectRequest
|
|
740
|
+
* @description A message from the end user that picks multiple select items
|
|
741
|
+
*/
|
|
742
|
+
app__conversation__models__v2__input__MultiSelectRequest: {
|
|
743
|
+
/**
|
|
744
|
+
* Conversationid
|
|
745
|
+
* @description The conversation id
|
|
746
|
+
*/
|
|
747
|
+
conversationId?: string | null;
|
|
748
|
+
/**
|
|
749
|
+
* Customerid
|
|
750
|
+
* @description The customer id
|
|
751
|
+
*/
|
|
752
|
+
customerId: string;
|
|
753
|
+
/**
|
|
754
|
+
* Userid
|
|
755
|
+
* @description Id to identify the user, this should be unified across the entire product.
|
|
756
|
+
*/
|
|
757
|
+
userId?: string | null;
|
|
758
|
+
/**
|
|
759
|
+
* Sessionid
|
|
760
|
+
* Format: uuid
|
|
761
|
+
* @description Id to identify the session that the conversation is in, this should be unified across the product
|
|
762
|
+
*/
|
|
763
|
+
sessionId: string;
|
|
764
|
+
/**
|
|
765
|
+
* Usermessage
|
|
766
|
+
* @description The user message
|
|
767
|
+
*/
|
|
768
|
+
userMessage?: string | null;
|
|
769
|
+
/**
|
|
770
|
+
* Option
|
|
771
|
+
* @description Which select options were picked?
|
|
772
|
+
*/
|
|
773
|
+
option: string[];
|
|
774
|
+
};
|
|
775
|
+
/**
|
|
776
|
+
* SingleSelectRequest
|
|
777
|
+
* @description A message from the end user that picks a single select item
|
|
778
|
+
*/
|
|
779
|
+
app__conversation__models__v2__input__SingleSelectRequest: {
|
|
780
|
+
/**
|
|
781
|
+
* Conversationid
|
|
782
|
+
* @description The conversation id
|
|
783
|
+
*/
|
|
784
|
+
conversationId?: string | null;
|
|
785
|
+
/**
|
|
786
|
+
* Customerid
|
|
787
|
+
* @description The customer id
|
|
788
|
+
*/
|
|
789
|
+
customerId: string;
|
|
790
|
+
/**
|
|
791
|
+
* Userid
|
|
792
|
+
* @description Id to identify the user, this should be unified across the entire product.
|
|
793
|
+
*/
|
|
794
|
+
userId?: string | null;
|
|
795
|
+
/**
|
|
796
|
+
* Sessionid
|
|
797
|
+
* Format: uuid
|
|
798
|
+
* @description Id to identify the session that the conversation is in, this should be unified across the product
|
|
799
|
+
*/
|
|
800
|
+
sessionId: string;
|
|
801
|
+
/**
|
|
802
|
+
* Usermessage
|
|
803
|
+
* @description The user message
|
|
804
|
+
*/
|
|
805
|
+
userMessage?: string | null;
|
|
806
|
+
/**
|
|
807
|
+
* Option
|
|
808
|
+
* @description Which select option was picked?
|
|
809
|
+
*/
|
|
810
|
+
option: string;
|
|
811
|
+
};
|
|
405
812
|
/** Data */
|
|
406
813
|
app__debug_stash__types__EmbeddingTokenCountRecord__Data: {
|
|
407
814
|
/** Token Count */
|
|
@@ -446,11 +853,83 @@ interface operations {
|
|
|
446
853
|
'user-agent'?: string;
|
|
447
854
|
/**
|
|
448
855
|
* @description Comma-separated list of feature flags (flags might require elevated permissions)
|
|
449
|
-
* @example debug,no-decision-forest
|
|
856
|
+
* @example debug,no-decision-forest,use-sales-framework
|
|
857
|
+
*/
|
|
858
|
+
'x-feature-flags'?: string | null;
|
|
859
|
+
/**
|
|
860
|
+
* @description The version of the SDK version that is being used
|
|
861
|
+
* @example 1.0.0
|
|
862
|
+
*/
|
|
863
|
+
'x-sdk-version'?: string | null;
|
|
864
|
+
};
|
|
865
|
+
path?: never;
|
|
866
|
+
cookie?: never;
|
|
867
|
+
};
|
|
868
|
+
requestBody: {
|
|
869
|
+
content: {
|
|
870
|
+
'application/json': components['schemas']['app__conversation__models__v2__input__ConversationRequest'];
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
responses: {
|
|
874
|
+
/** @description A successful response from the conversation service */
|
|
875
|
+
200: {
|
|
876
|
+
headers: {
|
|
877
|
+
[name: string]: unknown;
|
|
878
|
+
};
|
|
879
|
+
content: {
|
|
880
|
+
'application/json': (components['schemas']['MessageChunk'] | components['schemas']['DebugChunk'] | components['schemas']['SingleSelectChunk'] | components['schemas']['MultiSelectChunk'] | components['schemas']['ExitToChatChunk'] | components['schemas']['RecommendationChunk'] | components['schemas']['ConversationIdChunk'] | components['schemas']['ExitToPurchaseChunk'])[];
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
/** @description The user is not authorized to access the requested data */
|
|
884
|
+
401: {
|
|
885
|
+
headers: {
|
|
886
|
+
[name: string]: unknown;
|
|
887
|
+
};
|
|
888
|
+
content: {
|
|
889
|
+
'application/json': unknown;
|
|
890
|
+
};
|
|
891
|
+
};
|
|
892
|
+
/** @description The user does not have permission to access the requested data */
|
|
893
|
+
403: {
|
|
894
|
+
headers: {
|
|
895
|
+
[name: string]: unknown;
|
|
896
|
+
};
|
|
897
|
+
content: {
|
|
898
|
+
'application/json': unknown;
|
|
899
|
+
};
|
|
900
|
+
};
|
|
901
|
+
/** @description The customer config was not found */
|
|
902
|
+
404: {
|
|
903
|
+
headers: {
|
|
904
|
+
[name: string]: unknown;
|
|
905
|
+
};
|
|
906
|
+
content: {
|
|
907
|
+
'application/json': unknown;
|
|
908
|
+
};
|
|
909
|
+
};
|
|
910
|
+
/** @description Validation Error */
|
|
911
|
+
422: {
|
|
912
|
+
headers: {
|
|
913
|
+
[name: string]: unknown;
|
|
914
|
+
};
|
|
915
|
+
content: {
|
|
916
|
+
'application/json': components['schemas']['HTTPValidationError'];
|
|
917
|
+
};
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
generate_conversation_json_response_with_jwt_api_conversation_v3_post: {
|
|
922
|
+
parameters: {
|
|
923
|
+
query?: never;
|
|
924
|
+
header?: {
|
|
925
|
+
'user-agent'?: string;
|
|
926
|
+
/**
|
|
927
|
+
* @description Comma-separated list of feature flags (flags might require elevated permissions)
|
|
928
|
+
* @example debug,no-decision-forest,use-sales-framework
|
|
450
929
|
*/
|
|
451
930
|
'x-feature-flags'?: string | null;
|
|
452
931
|
/**
|
|
453
|
-
* @description
|
|
932
|
+
* @description The version of the SDK version that is being used
|
|
454
933
|
* @example 1.0.0
|
|
455
934
|
*/
|
|
456
935
|
'x-sdk-version'?: string | null;
|
|
@@ -460,7 +939,7 @@ interface operations {
|
|
|
460
939
|
};
|
|
461
940
|
requestBody: {
|
|
462
941
|
content: {
|
|
463
|
-
'application/json': components['schemas']['
|
|
942
|
+
'application/json': components['schemas']['app__conversation__models__input__MessageRequest'] | components['schemas']['app__conversation__models__input__SingleSelectRequest'] | components['schemas']['app__conversation__models__input__MultiSelectRequest'] | components['schemas']['StartConversationRequest'];
|
|
464
943
|
};
|
|
465
944
|
};
|
|
466
945
|
responses: {
|
|
@@ -470,7 +949,34 @@ interface operations {
|
|
|
470
949
|
[name: string]: unknown;
|
|
471
950
|
};
|
|
472
951
|
content: {
|
|
473
|
-
'application/json': (components['schemas']['
|
|
952
|
+
'application/json': (components['schemas']['MessageChunk'] | components['schemas']['DebugChunk'] | components['schemas']['SingleSelectChunk'] | components['schemas']['MultiSelectChunk'] | components['schemas']['ExitToChatChunk'] | components['schemas']['RecommendationChunk'] | components['schemas']['ConversationIdChunk'] | components['schemas']['ExitToPurchaseChunk'])[];
|
|
953
|
+
};
|
|
954
|
+
};
|
|
955
|
+
/** @description The user is not authorized to access the requested data */
|
|
956
|
+
401: {
|
|
957
|
+
headers: {
|
|
958
|
+
[name: string]: unknown;
|
|
959
|
+
};
|
|
960
|
+
content: {
|
|
961
|
+
'application/json': unknown;
|
|
962
|
+
};
|
|
963
|
+
};
|
|
964
|
+
/** @description The user does not have permission to access the requested data */
|
|
965
|
+
403: {
|
|
966
|
+
headers: {
|
|
967
|
+
[name: string]: unknown;
|
|
968
|
+
};
|
|
969
|
+
content: {
|
|
970
|
+
'application/json': unknown;
|
|
971
|
+
};
|
|
972
|
+
};
|
|
973
|
+
/** @description The customer config was not found */
|
|
974
|
+
404: {
|
|
975
|
+
headers: {
|
|
976
|
+
[name: string]: unknown;
|
|
977
|
+
};
|
|
978
|
+
content: {
|
|
979
|
+
'application/json': unknown;
|
|
474
980
|
};
|
|
475
981
|
};
|
|
476
982
|
/** @description Validation Error */
|
|
@@ -491,7 +997,7 @@ interface operations {
|
|
|
491
997
|
'user-agent'?: string;
|
|
492
998
|
/**
|
|
493
999
|
* @description Comma-separated list of feature flags (flags might require elevated permissions)
|
|
494
|
-
* @example debug,no-decision-forest
|
|
1000
|
+
* @example debug,no-decision-forest,use-sales-framework
|
|
495
1001
|
*/
|
|
496
1002
|
'x-feature-flags'?: string | null;
|
|
497
1003
|
/**
|
|
@@ -505,7 +1011,7 @@ interface operations {
|
|
|
505
1011
|
};
|
|
506
1012
|
requestBody: {
|
|
507
1013
|
content: {
|
|
508
|
-
'application/json': components['schemas']['
|
|
1014
|
+
'application/json': components['schemas']['app__conversation__models__v1__input__ConversationRequest'];
|
|
509
1015
|
};
|
|
510
1016
|
};
|
|
511
1017
|
responses: {
|
|
@@ -518,6 +1024,15 @@ interface operations {
|
|
|
518
1024
|
'text/event-stream': string;
|
|
519
1025
|
};
|
|
520
1026
|
};
|
|
1027
|
+
/** @description The user is not authorized to access the requested data */
|
|
1028
|
+
401: {
|
|
1029
|
+
headers: {
|
|
1030
|
+
[name: string]: unknown;
|
|
1031
|
+
};
|
|
1032
|
+
content: {
|
|
1033
|
+
'application/json': unknown;
|
|
1034
|
+
};
|
|
1035
|
+
};
|
|
521
1036
|
/** @description The user does not have permission to access the requested data */
|
|
522
1037
|
403: {
|
|
523
1038
|
headers: {
|
|
@@ -1052,10 +1567,17 @@ interface paths {
|
|
|
1052
1567
|
* These are the types as defined in the OpenAPI schema.
|
|
1053
1568
|
* We don't use them directly, or export them here because of how they appear in the documentation site.
|
|
1054
1569
|
*/
|
|
1055
|
-
type ApiConversationRequest = components['schemas']['
|
|
1056
|
-
type
|
|
1057
|
-
type
|
|
1570
|
+
type ApiConversationRequest = components['schemas']['app__conversation__models__input__MessageRequest'];
|
|
1571
|
+
type ApiConversationResponse = operations['generate_conversation_json_response_api_conversation_v2_post']['responses']['200']['content']['application/json'];
|
|
1572
|
+
type ApiDebug = components['schemas']['DebugChunk'];
|
|
1573
|
+
type ApiBasicMessage = components['schemas']['MessageChunk'];
|
|
1574
|
+
type ApiMultiSelectMessage = components['schemas']['MultiSelectChunk'];
|
|
1575
|
+
type ApiSingleSelectMessage = components['schemas']['SingleSelectChunk'];
|
|
1576
|
+
type ApiExitToChatMessage = components['schemas']['ExitToChatChunk'];
|
|
1577
|
+
type ApiExitToPurchaseMessage = components['schemas']['ExitToPurchaseChunk'];
|
|
1578
|
+
type ApiRecomendationMessage = components['schemas']['RecommendationChunk'];
|
|
1058
1579
|
type ApiTrackingUserRequest = paths['/api/tracking/user/v2']['post']['requestBody']['content']['application/json'];
|
|
1580
|
+
type ApiIdentityRequest = paths['/api/tracking/identity/v2']['post']['requestBody']['content']['application/json'];
|
|
1059
1581
|
/**
|
|
1060
1582
|
* Configuration options for initializing the client.
|
|
1061
1583
|
*/
|
|
@@ -1063,7 +1585,7 @@ interface Config {
|
|
|
1063
1585
|
/**
|
|
1064
1586
|
* The customer ID associated with the conversation.
|
|
1065
1587
|
*/
|
|
1066
|
-
customerId:
|
|
1588
|
+
customerId: ApiIdentityRequest['customerId'];
|
|
1067
1589
|
/**
|
|
1068
1590
|
* Optional fetch function to use for making HTTP requests.
|
|
1069
1591
|
* If not provided, the default `fetch` implementation will be used.
|
|
@@ -1112,42 +1634,23 @@ interface Identity {
|
|
|
1112
1634
|
*/
|
|
1113
1635
|
userId?: string;
|
|
1114
1636
|
}
|
|
1637
|
+
interface DebugResponse extends ApiDebug {
|
|
1638
|
+
}
|
|
1115
1639
|
/**
|
|
1116
|
-
*
|
|
1640
|
+
* The message types that the SDK returns.
|
|
1641
|
+
* Note that the API response may contain additional types that the SDK does not return.
|
|
1117
1642
|
*/
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* The conversation ID to which the message belongs.
|
|
1121
|
-
*/
|
|
1122
|
-
conversationId: ApiMessage['conversationId'];
|
|
1123
|
-
/**
|
|
1124
|
-
* The message content.
|
|
1125
|
-
*/
|
|
1126
|
-
message: ApiMessage['message'];
|
|
1127
|
-
/**
|
|
1128
|
-
* The message type.
|
|
1129
|
-
*/
|
|
1130
|
-
type: ApiMessage['type'];
|
|
1131
|
-
}
|
|
1132
|
-
interface DebugResponse {
|
|
1133
|
-
/**
|
|
1134
|
-
* The conversation ID to which the message belongs.
|
|
1135
|
-
*/
|
|
1136
|
-
conversationId: ApiDebug['conversationId'];
|
|
1137
|
-
/**
|
|
1138
|
-
* The debug records.
|
|
1139
|
-
*/
|
|
1140
|
-
records: ApiDebug['records'];
|
|
1141
|
-
/**
|
|
1142
|
-
* The message type.
|
|
1143
|
-
*/
|
|
1144
|
-
type: ApiDebug['type'];
|
|
1145
|
-
}
|
|
1643
|
+
type Message = ApiBasicMessage | ApiMultiSelectMessage | ApiSingleSelectMessage | ApiExitToChatMessage | ApiExitToPurchaseMessage | ApiRecomendationMessage;
|
|
1146
1644
|
/**
|
|
1147
1645
|
* The request to the conversation API.
|
|
1148
1646
|
*/
|
|
1149
1647
|
interface ConversationApiRequest extends ApiConversationRequest {
|
|
1150
1648
|
}
|
|
1649
|
+
/**
|
|
1650
|
+
* The response from the conversation API.
|
|
1651
|
+
*/
|
|
1652
|
+
interface ConversationApiResponse extends ApiConversationResponse {
|
|
1653
|
+
}
|
|
1151
1654
|
interface TrackingEvent extends ApiTrackingUserRequest {
|
|
1152
1655
|
}
|
|
1153
1656
|
|
|
@@ -1204,16 +1707,15 @@ declare class Client {
|
|
|
1204
1707
|
*/
|
|
1205
1708
|
endConversation(): void;
|
|
1206
1709
|
/**
|
|
1207
|
-
* Sends a message in the conversation
|
|
1710
|
+
* Sends a message in the conversation
|
|
1208
1711
|
*
|
|
1209
|
-
* @param options - An object containing the
|
|
1712
|
+
* @param options - An object containing the user message.
|
|
1210
1713
|
* @returns A promise that resolves to an array of messages or debug records.
|
|
1211
1714
|
* If the message is a debug record, it will throw an error.
|
|
1212
1715
|
*
|
|
1213
1716
|
* @example
|
|
1214
1717
|
* ```ts
|
|
1215
1718
|
* const newMessages = await client.sendMessage({
|
|
1216
|
-
* openingMessage: 'Hello! How can I help you?',
|
|
1217
1719
|
* userMessage: 'How can I get support?',
|
|
1218
1720
|
* })
|
|
1219
1721
|
*
|
|
@@ -1224,8 +1726,7 @@ declare class Client {
|
|
|
1224
1726
|
* }
|
|
1225
1727
|
* ```
|
|
1226
1728
|
*/
|
|
1227
|
-
sendMessage({
|
|
1228
|
-
openingMessage?: ConversationApiRequest['openingMessage'];
|
|
1729
|
+
sendMessage({ userMessage, }: {
|
|
1229
1730
|
userMessage: ConversationApiRequest['userMessage'];
|
|
1230
1731
|
}): Promise<Message[] | undefined>;
|
|
1231
1732
|
/**
|
|
@@ -1422,4 +1923,4 @@ declare const setUserId: (userId: string) => void;
|
|
|
1422
1923
|
*/
|
|
1423
1924
|
declare const authMiddleware: (accessToken: string) => Middleware;
|
|
1424
1925
|
|
|
1425
|
-
export { CONVERSATION_ID, Client, type Config, type ConversationApiRequest, type DebugResponse, type Endpoint, type Identity, type Message, SESSION_ID, TTL, type TrackingEvent, USER_ID, authMiddleware, deleteConversationId, getConversationId, getSessionId, getUserId, setConversationId, setSessionId, setUserId };
|
|
1926
|
+
export { CONVERSATION_ID, Client, type Config, type ConversationApiRequest, type ConversationApiResponse, type DebugResponse, type Endpoint, type Identity, type Message, SESSION_ID, TTL, type TrackingEvent, USER_ID, authMiddleware, deleteConversationId, getConversationId, getSessionId, getUserId, setConversationId, setSessionId, setUserId };
|