convo-ai-sdk 1.2.9 → 1.3.0
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.js +3 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,8 @@ export class ChatClient {
|
|
|
14
14
|
testAgentId: options.testAgentId || '',
|
|
15
15
|
identifier: options.identifier || '',
|
|
16
16
|
dynamicVariables: options.dynamicVariables || {},
|
|
17
|
-
httpApiEndpoint: options.httpApiEndpoint || DEFAULT_HTTP_ENDPOINT
|
|
17
|
+
httpApiEndpoint: options.httpApiEndpoint || DEFAULT_HTTP_ENDPOINT,
|
|
18
|
+
threadId: options.threadId || '',
|
|
18
19
|
};
|
|
19
20
|
}
|
|
20
21
|
_emit(event, data) {
|
|
@@ -139,6 +140,7 @@ export class ChatClient {
|
|
|
139
140
|
const headers = {
|
|
140
141
|
'Content-Type': 'application/json',
|
|
141
142
|
'x-identifier': this.options.identifier || '',
|
|
143
|
+
...(this.options.threadId ? { 'x-thread-id': this.options.threadId } : {}),
|
|
142
144
|
};
|
|
143
145
|
if (this.options.testAgentId) {
|
|
144
146
|
headers['x-test-agent-id'] = this.options.testAgentId;
|
package/dist/types.d.ts
CHANGED
|
@@ -19,5 +19,6 @@ export interface ClientOptions {
|
|
|
19
19
|
httpApiEndpoint?: string;
|
|
20
20
|
identifier?: string;
|
|
21
21
|
dynamicVariables?: Record<string, any>;
|
|
22
|
+
threadId?: string;
|
|
22
23
|
}
|
|
23
24
|
export type ChatEvent = 'statusChange' | 'conversationStatusChange' | 'bubbleSuggestionsChange' | 'message' | 'configLoaded' | 'historyLoaded' | 'messageStart' | 'messageData' | 'messageDone' | 'messageError' | 'paymentError' | 'toolCall' | 'thought' | 'reset' | 'awaitingResponse';
|