priori-chat-sdk 1.0.1 → 1.0.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 +22 -1
- package/dist/index.d.ts +22 -1
- package/dist/index.js +21 -0
- package/dist/index.mjs +21 -0
- package/package.json +11 -13
- package/src/index.ts +21 -0
package/dist/index.d.mts
CHANGED
|
@@ -57,12 +57,28 @@ type GetConversationResponse = {
|
|
|
57
57
|
*/
|
|
58
58
|
user_id: string;
|
|
59
59
|
};
|
|
60
|
+
type GetMemoriesResponse = {
|
|
61
|
+
/**
|
|
62
|
+
* Bot memories for this conversation
|
|
63
|
+
*/
|
|
64
|
+
bot_memories: Array<MemoryResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* User memories for this conversation
|
|
67
|
+
*/
|
|
68
|
+
user_memories: Array<MemoryResponse>;
|
|
69
|
+
};
|
|
60
70
|
type ListConversationsResponse = {
|
|
61
71
|
/**
|
|
62
72
|
* List of conversations
|
|
63
73
|
*/
|
|
64
74
|
conversations: Array<ConversationHeader>;
|
|
65
75
|
};
|
|
76
|
+
type MemoryResponse = {
|
|
77
|
+
/**
|
|
78
|
+
* Text content of the memory
|
|
79
|
+
*/
|
|
80
|
+
text: string;
|
|
81
|
+
};
|
|
66
82
|
type Message$1 = {
|
|
67
83
|
attached_media?: Content | null;
|
|
68
84
|
/**
|
|
@@ -309,6 +325,11 @@ declare class Conversation {
|
|
|
309
325
|
* ```
|
|
310
326
|
*/
|
|
311
327
|
disconnect(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Retrieves bot and user memories for this conversation.
|
|
330
|
+
* @returns Promise resolving to memories data containing bot_memories and user_memories arrays
|
|
331
|
+
*/
|
|
332
|
+
getMemories(): Promise<GetMemoriesResponse>;
|
|
312
333
|
/**
|
|
313
334
|
* Gets the current conversation ID.
|
|
314
335
|
* @returns The conversation ID string
|
|
@@ -457,4 +478,4 @@ declare class PrioriChat {
|
|
|
457
478
|
}>;
|
|
458
479
|
}
|
|
459
480
|
|
|
460
|
-
export { ApiError, type AttachedMedia, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type ConversationWithId, type ConversationWithUserBot, type CreateConversationOptions, type CreateConversationResponse, type GetConversationOptions, type GetConversationResponse, type ListConversationsOptions, type ListConversationsResponse, type Message, PrioriChat };
|
|
481
|
+
export { ApiError, type AttachedMedia, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type Conversation$1 as ConversationType, type ConversationWithId, type ConversationWithUserBot, type CreateConversationOptions, type CreateConversationResponse, type GetConversationOptions, type GetConversationResponse, type GetMemoriesResponse, type ListConversationsOptions, type ListConversationsResponse, type MemoryResponse, type Message, PrioriChat };
|
package/dist/index.d.ts
CHANGED
|
@@ -57,12 +57,28 @@ type GetConversationResponse = {
|
|
|
57
57
|
*/
|
|
58
58
|
user_id: string;
|
|
59
59
|
};
|
|
60
|
+
type GetMemoriesResponse = {
|
|
61
|
+
/**
|
|
62
|
+
* Bot memories for this conversation
|
|
63
|
+
*/
|
|
64
|
+
bot_memories: Array<MemoryResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* User memories for this conversation
|
|
67
|
+
*/
|
|
68
|
+
user_memories: Array<MemoryResponse>;
|
|
69
|
+
};
|
|
60
70
|
type ListConversationsResponse = {
|
|
61
71
|
/**
|
|
62
72
|
* List of conversations
|
|
63
73
|
*/
|
|
64
74
|
conversations: Array<ConversationHeader>;
|
|
65
75
|
};
|
|
76
|
+
type MemoryResponse = {
|
|
77
|
+
/**
|
|
78
|
+
* Text content of the memory
|
|
79
|
+
*/
|
|
80
|
+
text: string;
|
|
81
|
+
};
|
|
66
82
|
type Message$1 = {
|
|
67
83
|
attached_media?: Content | null;
|
|
68
84
|
/**
|
|
@@ -309,6 +325,11 @@ declare class Conversation {
|
|
|
309
325
|
* ```
|
|
310
326
|
*/
|
|
311
327
|
disconnect(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Retrieves bot and user memories for this conversation.
|
|
330
|
+
* @returns Promise resolving to memories data containing bot_memories and user_memories arrays
|
|
331
|
+
*/
|
|
332
|
+
getMemories(): Promise<GetMemoriesResponse>;
|
|
312
333
|
/**
|
|
313
334
|
* Gets the current conversation ID.
|
|
314
335
|
* @returns The conversation ID string
|
|
@@ -457,4 +478,4 @@ declare class PrioriChat {
|
|
|
457
478
|
}>;
|
|
458
479
|
}
|
|
459
480
|
|
|
460
|
-
export { ApiError, type AttachedMedia, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type ConversationWithId, type ConversationWithUserBot, type CreateConversationOptions, type CreateConversationResponse, type GetConversationOptions, type GetConversationResponse, type ListConversationsOptions, type ListConversationsResponse, type Message, PrioriChat };
|
|
481
|
+
export { ApiError, type AttachedMedia, Conversation, type ConversationCallbacks, type ConversationHeader, type ConversationOptions, type Conversation$1 as ConversationType, type ConversationWithId, type ConversationWithUserBot, type CreateConversationOptions, type CreateConversationResponse, type GetConversationOptions, type GetConversationResponse, type GetMemoriesResponse, type ListConversationsOptions, type ListConversationsResponse, type MemoryResponse, type Message, PrioriChat };
|
package/dist/index.js
CHANGED
|
@@ -532,6 +532,13 @@ var getConversation = (options) => {
|
|
|
532
532
|
...options
|
|
533
533
|
});
|
|
534
534
|
};
|
|
535
|
+
var getMemories = (options) => {
|
|
536
|
+
return (options.client ?? client).get({
|
|
537
|
+
responseType: "json",
|
|
538
|
+
url: "/api/conversations/{id}/memories",
|
|
539
|
+
...options
|
|
540
|
+
});
|
|
541
|
+
};
|
|
535
542
|
var sendMessage = (options) => {
|
|
536
543
|
return (options.client ?? client).post({
|
|
537
544
|
url: "/api/conversations/{id}/messages",
|
|
@@ -786,6 +793,20 @@ var Conversation = class _Conversation {
|
|
|
786
793
|
// this.startPolling();
|
|
787
794
|
// }
|
|
788
795
|
// }
|
|
796
|
+
/**
|
|
797
|
+
* Retrieves bot and user memories for this conversation.
|
|
798
|
+
* @returns Promise resolving to memories data containing bot_memories and user_memories arrays
|
|
799
|
+
*/
|
|
800
|
+
async getMemories() {
|
|
801
|
+
if (!this.isInitialized) {
|
|
802
|
+
throw new Error("Conversation not initialized");
|
|
803
|
+
}
|
|
804
|
+
return (await getMemories({
|
|
805
|
+
path: {
|
|
806
|
+
id: this.conversationId
|
|
807
|
+
}
|
|
808
|
+
})).data;
|
|
809
|
+
}
|
|
789
810
|
/**
|
|
790
811
|
* Gets the current conversation ID.
|
|
791
812
|
* @returns The conversation ID string
|
package/dist/index.mjs
CHANGED
|
@@ -496,6 +496,13 @@ var getConversation = (options) => {
|
|
|
496
496
|
...options
|
|
497
497
|
});
|
|
498
498
|
};
|
|
499
|
+
var getMemories = (options) => {
|
|
500
|
+
return (options.client ?? client).get({
|
|
501
|
+
responseType: "json",
|
|
502
|
+
url: "/api/conversations/{id}/memories",
|
|
503
|
+
...options
|
|
504
|
+
});
|
|
505
|
+
};
|
|
499
506
|
var sendMessage = (options) => {
|
|
500
507
|
return (options.client ?? client).post({
|
|
501
508
|
url: "/api/conversations/{id}/messages",
|
|
@@ -750,6 +757,20 @@ var Conversation = class _Conversation {
|
|
|
750
757
|
// this.startPolling();
|
|
751
758
|
// }
|
|
752
759
|
// }
|
|
760
|
+
/**
|
|
761
|
+
* Retrieves bot and user memories for this conversation.
|
|
762
|
+
* @returns Promise resolving to memories data containing bot_memories and user_memories arrays
|
|
763
|
+
*/
|
|
764
|
+
async getMemories() {
|
|
765
|
+
if (!this.isInitialized) {
|
|
766
|
+
throw new Error("Conversation not initialized");
|
|
767
|
+
}
|
|
768
|
+
return (await getMemories({
|
|
769
|
+
path: {
|
|
770
|
+
id: this.conversationId
|
|
771
|
+
}
|
|
772
|
+
})).data;
|
|
773
|
+
}
|
|
753
774
|
/**
|
|
754
775
|
* Gets the current conversation ID.
|
|
755
776
|
* @returns The conversation ID string
|
package/package.json
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "priori-chat-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "TypeScript SDK for Priori Chat API",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "src/index.ts",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"codegen": "openapi-ts",
|
|
13
|
-
"codegen:watch": "openapi-ts --watch",
|
|
14
|
-
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
15
|
-
"test": "vitest run",
|
|
16
|
-
"lint": "eslint . --ext .ts",
|
|
17
|
-
"prepack": "pnpm codegen && pnpm build",
|
|
18
|
-
"docs": "typedoc --skipErrorChecking"
|
|
19
|
-
},
|
|
20
11
|
"keywords": [],
|
|
21
12
|
"author": "",
|
|
22
13
|
"license": "ISC",
|
|
23
|
-
"packageManager": "pnpm@10.7.0",
|
|
24
14
|
"devDependencies": {
|
|
25
15
|
"@hey-api/openapi-ts": "^0.77.0",
|
|
26
16
|
"tsup": "^8.0.0",
|
|
@@ -31,5 +21,13 @@
|
|
|
31
21
|
"@hey-api/client-fetch": "^0.13.1",
|
|
32
22
|
"axios": "^1.10.0",
|
|
33
23
|
"zod": "^3.25.68"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"codegen": "openapi-ts",
|
|
27
|
+
"codegen:watch": "openapi-ts --watch",
|
|
28
|
+
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"lint": "eslint . --ext .ts",
|
|
31
|
+
"docs": "typedoc --skipErrorChecking"
|
|
34
32
|
}
|
|
35
|
-
}
|
|
33
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { PrioriChat, ApiError, type CreateConversationOptions } from "./client";
|
|
2
|
+
export {
|
|
3
|
+
Conversation,
|
|
4
|
+
type ConversationOptions,
|
|
5
|
+
type ConversationCallbacks,
|
|
6
|
+
type Message,
|
|
7
|
+
type AttachedMedia,
|
|
8
|
+
type ConversationWithId,
|
|
9
|
+
type ConversationWithUserBot,
|
|
10
|
+
} from "./conversation";
|
|
11
|
+
export { type ListConversationsOptions, type GetConversationOptions } from "./methods/conversations";
|
|
12
|
+
export type {
|
|
13
|
+
CreateConversationResponse,
|
|
14
|
+
GetConversationResponse,
|
|
15
|
+
ListConversationsResponse,
|
|
16
|
+
ConversationHeader,
|
|
17
|
+
GetMemoriesResponse,
|
|
18
|
+
MemoryResponse,
|
|
19
|
+
Conversation as ConversationType,
|
|
20
|
+
} from "./client/types.gen";
|
|
21
|
+
|