cheshirecat-typescript-client 1.3.26 → 1.4.1
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/client.d.ts +2 -0
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/endpoints/conversation.d.ts +50 -0
- package/dist/endpoints/conversation.js +74 -0
- package/dist/endpoints/conversation.js.map +1 -0
- package/dist/endpoints/memory.d.ts +1 -34
- package/dist/endpoints/memory.js +0 -45
- package/dist/endpoints/memory.js.map +1 -1
- package/dist/endpoints/rabbitHole.d.ts +4 -2
- package/dist/endpoints/rabbitHole.js +8 -4
- package/dist/endpoints/rabbitHole.js.map +1 -1
- package/dist/models/api/conversations.d.ts +8 -0
- package/dist/models/api/conversations.js +12 -0
- package/dist/models/api/conversations.js.map +1 -0
- package/dist/models/api/memories.d.ts +1 -8
- package/dist/models/api/memories.js +0 -9
- package/dist/models/api/memories.js.map +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Endpoints } from "./endpoints/types";
|
|
|
6
6
|
import { AdminsEndpoint } from "./endpoints/admins";
|
|
7
7
|
import { AuthHandlerEndpoint } from "./endpoints/authHandler";
|
|
8
8
|
import { ChunkerEndpoint } from "./endpoints/chunker";
|
|
9
|
+
import { ConversationEndpoint } from "./endpoints/conversation";
|
|
9
10
|
import { CustomEndpoint } from "./endpoints/customEndpoint";
|
|
10
11
|
import { EmbedderEndpoint } from "./endpoints/embedder";
|
|
11
12
|
import { LargeLanguageModelEndpoint } from "./endpoints/largeLanguageModel";
|
|
@@ -30,6 +31,7 @@ export declare class CheshireCatClient implements Endpoints {
|
|
|
30
31
|
admins(): AdminsEndpoint;
|
|
31
32
|
authHandler(): AuthHandlerEndpoint;
|
|
32
33
|
chunker(): ChunkerEndpoint;
|
|
34
|
+
conversation(): ConversationEndpoint;
|
|
33
35
|
embedder(): EmbedderEndpoint;
|
|
34
36
|
fileManager(): FileManagerEndpoint;
|
|
35
37
|
largeLanguageModel(): LargeLanguageModelEndpoint;
|
package/dist/client.js
CHANGED
|
@@ -6,6 +6,7 @@ const helpers_1 = require("./helpers");
|
|
|
6
6
|
const admins_1 = require("./endpoints/admins");
|
|
7
7
|
const authHandler_1 = require("./endpoints/authHandler");
|
|
8
8
|
const chunker_1 = require("./endpoints/chunker");
|
|
9
|
+
const conversation_1 = require("./endpoints/conversation");
|
|
9
10
|
const customEndpoint_1 = require("./endpoints/customEndpoint");
|
|
10
11
|
const embedder_1 = require("./endpoints/embedder");
|
|
11
12
|
const largeLanguageModel_1 = require("./endpoints/largeLanguageModel");
|
|
@@ -55,6 +56,9 @@ class CheshireCatClient {
|
|
|
55
56
|
chunker() {
|
|
56
57
|
return new chunker_1.ChunkerEndpoint(this);
|
|
57
58
|
}
|
|
59
|
+
conversation() {
|
|
60
|
+
return new conversation_1.ConversationEndpoint(this);
|
|
61
|
+
}
|
|
58
62
|
embedder() {
|
|
59
63
|
return new embedder_1.EmbedderEndpoint(this);
|
|
60
64
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AACA,6CAAwC;AAGxC,uCAA2C;AAE3C,+CAAkD;AAClD,yDAA4D;AAC5D,iDAAoD;AACpD,+DAA0D;AAC1D,mDAAsD;AACtD,uEAA0E;AAC1E,iDAAoD;AACpD,iDAAoD;AACpD,yDAA4D;AAC5D,6CAAgD;AAChD,uDAA0D;AAC1D,+CAAkD;AAElD,+DAAkE;AAClE,yDAA4D;AAE5D,MAAa,iBAAiB;IACT,QAAQ,CAAW;IACnB,UAAU,CAAa;IACvB,UAAU,CAAa;IAExC,YAAY,QAAkB,EAAE,UAAsB,EAAE,KAAc;QAClE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAE7B,IAAI,KAAK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AAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC1D,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,IAAoB,EAAE,EAAE;YAC5C,OAAO,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CACH,OAAmE,EACnE,OAAe,EACf,MAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC1D,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAkB,EAAE,KAA4B,EAAE,EAAE;YACtE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAzKD,8CAyKC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AbstractEndpoint } from "./abstract";
|
|
2
|
+
import { ConversationHistoryDeleteOutput, ConversationHistoryOutput } from "../models/api/conversations";
|
|
3
|
+
import { Role } from "../types";
|
|
4
|
+
import { Why } from "../models/dtos";
|
|
5
|
+
export declare class ConversationEndpoint extends AbstractEndpoint {
|
|
6
|
+
protected prefix: string;
|
|
7
|
+
/**
|
|
8
|
+
* This endpoint returns the conversation history.
|
|
9
|
+
*
|
|
10
|
+
* @param agentId The agent ID.
|
|
11
|
+
* @param userId The user ID to filter the conversation history by.
|
|
12
|
+
* @param chatId The chat ID to filter the conversation history by.
|
|
13
|
+
*
|
|
14
|
+
* @returns The conversation history.
|
|
15
|
+
*/
|
|
16
|
+
getConversationHistory(agentId: string, userId: string, chatId: string): Promise<ConversationHistoryOutput>;
|
|
17
|
+
/**
|
|
18
|
+
* This endpoint returns all conversation histories for a given agent and user.
|
|
19
|
+
*
|
|
20
|
+
* @param agentId The agent ID.
|
|
21
|
+
* @param userId The user ID to filter the conversation histories by.
|
|
22
|
+
*
|
|
23
|
+
* @returns An object with keys as chat IDs and values as ConversationHistoryOutput.
|
|
24
|
+
*/
|
|
25
|
+
getConversationHistories(agentId: string, userId: string): Promise<object>;
|
|
26
|
+
/**
|
|
27
|
+
* This endpoint deletes the conversation history.
|
|
28
|
+
*
|
|
29
|
+
* @param agentId The agent ID.
|
|
30
|
+
* @param userId The user ID to filter the conversation history by.
|
|
31
|
+
* @param chatId The chat ID to filter the conversation history by.
|
|
32
|
+
*
|
|
33
|
+
* @returns The output of the deletion operation.
|
|
34
|
+
*/
|
|
35
|
+
deleteConversationHistory(agentId: string, userId: string, chatId: string): Promise<ConversationHistoryDeleteOutput>;
|
|
36
|
+
/**
|
|
37
|
+
* This endpoint creates a new element in the conversation history.
|
|
38
|
+
*
|
|
39
|
+
* @param who The speaker of the conversation history.
|
|
40
|
+
* @param text The text of the conversation history.
|
|
41
|
+
* @param agentId The agent ID.
|
|
42
|
+
* @param userId The user ID to add the conversation history to.
|
|
43
|
+
* @param chatId The chat ID to add the conversation history to.
|
|
44
|
+
* @param image The image of the conversation history.
|
|
45
|
+
* @param why The reason for the conversation history.
|
|
46
|
+
*
|
|
47
|
+
* @returns The conversation history.
|
|
48
|
+
*/
|
|
49
|
+
postConversationHistory(who: Role, text: string, agentId: string, userId: string, chatId: string, image?: string | null, why?: Why | null): Promise<ConversationHistoryOutput>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationEndpoint = void 0;
|
|
4
|
+
const abstract_1 = require("./abstract");
|
|
5
|
+
class ConversationEndpoint extends abstract_1.AbstractEndpoint {
|
|
6
|
+
prefix = "/conversation";
|
|
7
|
+
/**
|
|
8
|
+
* This endpoint returns the conversation history.
|
|
9
|
+
*
|
|
10
|
+
* @param agentId The agent ID.
|
|
11
|
+
* @param userId The user ID to filter the conversation history by.
|
|
12
|
+
* @param chatId The chat ID to filter the conversation history by.
|
|
13
|
+
*
|
|
14
|
+
* @returns The conversation history.
|
|
15
|
+
*/
|
|
16
|
+
async getConversationHistory(agentId, userId, chatId) {
|
|
17
|
+
return this.get(this.formatUrl(chatId), agentId, userId);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* This endpoint returns all conversation histories for a given agent and user.
|
|
21
|
+
*
|
|
22
|
+
* @param agentId The agent ID.
|
|
23
|
+
* @param userId The user ID to filter the conversation histories by.
|
|
24
|
+
*
|
|
25
|
+
* @returns An object with keys as chat IDs and values as ConversationHistoryOutput.
|
|
26
|
+
*/
|
|
27
|
+
async getConversationHistories(agentId, userId) {
|
|
28
|
+
const response = await this.getHttpClient(agentId, userId).get(this.prefix);
|
|
29
|
+
if (response.status !== 200) {
|
|
30
|
+
throw new Error(`Failed to fetch data from ${this.prefix}: ${response.statusText}`);
|
|
31
|
+
}
|
|
32
|
+
const result = {};
|
|
33
|
+
for (const [key, item] of response.data) {
|
|
34
|
+
result[key] = this.deserialize(JSON.stringify(item));
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* This endpoint deletes the conversation history.
|
|
40
|
+
*
|
|
41
|
+
* @param agentId The agent ID.
|
|
42
|
+
* @param userId The user ID to filter the conversation history by.
|
|
43
|
+
* @param chatId The chat ID to filter the conversation history by.
|
|
44
|
+
*
|
|
45
|
+
* @returns The output of the deletion operation.
|
|
46
|
+
*/
|
|
47
|
+
async deleteConversationHistory(agentId, userId, chatId) {
|
|
48
|
+
return this.delete(this.formatUrl(chatId), agentId, userId);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* This endpoint creates a new element in the conversation history.
|
|
52
|
+
*
|
|
53
|
+
* @param who The speaker of the conversation history.
|
|
54
|
+
* @param text The text of the conversation history.
|
|
55
|
+
* @param agentId The agent ID.
|
|
56
|
+
* @param userId The user ID to add the conversation history to.
|
|
57
|
+
* @param chatId The chat ID to add the conversation history to.
|
|
58
|
+
* @param image The image of the conversation history.
|
|
59
|
+
* @param why The reason for the conversation history.
|
|
60
|
+
*
|
|
61
|
+
* @returns The conversation history.
|
|
62
|
+
*/
|
|
63
|
+
async postConversationHistory(who, text, agentId, userId, chatId, image, why) {
|
|
64
|
+
const payload = {
|
|
65
|
+
who: who,
|
|
66
|
+
text,
|
|
67
|
+
...(image && { image }),
|
|
68
|
+
...(why && { why: why.toArray() }),
|
|
69
|
+
};
|
|
70
|
+
return this.post(this.formatUrl(chatId), agentId, payload, userId);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ConversationEndpoint = ConversationEndpoint;
|
|
74
|
+
//# sourceMappingURL=conversation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/endpoints/conversation.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAQ5C,MAAa,oBAAqB,SAAQ,2BAAgB;IAC5C,MAAM,GAAG,eAAe,CAAC;IAEnC;;;;;;;;OAQG;IACH,KAAK,CAAC,sBAAsB,CACxB,OAAe,EACf,MAAc,EACd,MAAc;QAEd,OAAO,IAAI,CAAC,GAAG,CAA4B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACxF,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,wBAAwB,CAAC,OAAe,EAAE,MAAc;QAC1D,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5E,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACxF,CAAC;QAED,MAAM,MAAM,GAA8C,EAAE,CAAC;QAC7D,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YACtC,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAA4B,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;QACnF,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,yBAAyB,CAC3B,OAAe,EACf,MAAc,EACd,MAAc;QAEd,OAAO,IAAI,CAAC,MAAM,CACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EACtB,OAAO,EACP,MAAM,CACT,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,uBAAuB,CACzB,GAAS,EACT,IAAY,EACZ,OAAe,EACf,MAAc,EACd,MAAc,EACd,KAAqB,EACrB,GAAgB;QAEhB,MAAM,OAAO,GAAG;YACZ,GAAG,EAAE,GAAG;YACR,IAAI;YACJ,GAAG,CAAC,KAAK,IAAI,EAAC,KAAK,EAAC,CAAC;YACrB,GAAG,CAAC,GAAG,IAAI,EAAC,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,EAAC,CAAC;SACnC,CAAC;QAEF,OAAO,IAAI,CAAC,IAAI,CAA4B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAClG,CAAC;CACJ;AA9FD,oDA8FC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { AbstractEndpoint } from "./abstract";
|
|
2
|
-
import { CollectionPointsDestroyOutput, CollectionsOutput,
|
|
3
|
-
import { Role } from "../types";
|
|
4
|
-
import { Why } from "../models/dtos";
|
|
2
|
+
import { CollectionPointsDestroyOutput, CollectionsOutput, MemoryPointDeleteOutput, MemoryPointsDeleteByMetadataOutput, MemoryPointsOutput, MemoryPointOutput, MemoryRecallOutput } from "../models/api/memories";
|
|
5
3
|
import { CollectionsItem } from "../models/api/nested/memories";
|
|
6
4
|
export declare class MemoryEndpoint extends AbstractEndpoint {
|
|
7
5
|
protected prefix: string;
|
|
@@ -39,37 +37,6 @@ export declare class MemoryEndpoint extends AbstractEndpoint {
|
|
|
39
37
|
* @returns The output of the creation.
|
|
40
38
|
*/
|
|
41
39
|
postMemoryCollections(collection: string, agentId: string): Promise<CollectionsItem>;
|
|
42
|
-
/**
|
|
43
|
-
* This endpoint returns the conversation history.
|
|
44
|
-
*
|
|
45
|
-
* @param agentId The agent ID.
|
|
46
|
-
* @param userId The user ID to filter the conversation history by.
|
|
47
|
-
*
|
|
48
|
-
* @returns The conversation history.
|
|
49
|
-
*/
|
|
50
|
-
getConversationHistory(agentId: string, userId: string): Promise<ConversationHistoryOutput>;
|
|
51
|
-
/**
|
|
52
|
-
* This endpoint deletes the conversation history.
|
|
53
|
-
*
|
|
54
|
-
* @param agentId The agent ID.
|
|
55
|
-
* @param userId The user ID to filter the conversation history by.
|
|
56
|
-
*
|
|
57
|
-
* @returns The output of the deletion operation.
|
|
58
|
-
*/
|
|
59
|
-
deleteConversationHistory(agentId: string, userId: string): Promise<ConversationHistoryDeleteOutput>;
|
|
60
|
-
/**
|
|
61
|
-
* This endpoint creates a new element in the conversation history.
|
|
62
|
-
*
|
|
63
|
-
* @param who The speaker of the conversation history.
|
|
64
|
-
* @param text The text of the conversation history.
|
|
65
|
-
* @param agentId The agent ID.
|
|
66
|
-
* @param userId The user ID to add the conversation history to.
|
|
67
|
-
* @param image The image of the conversation history.
|
|
68
|
-
* @param why The reason for the conversation history.
|
|
69
|
-
*
|
|
70
|
-
* @returns The conversation history.
|
|
71
|
-
*/
|
|
72
|
-
postConversationHistory(who: Role, text: string, agentId: string, userId: string, image?: string | null, why?: Why | null): Promise<ConversationHistoryOutput>;
|
|
73
40
|
/**
|
|
74
41
|
* This endpoint retrieves memory points based on the input text. The text parameter is the input text for which the
|
|
75
42
|
* memory points are retrieved. The k parameter is the number of memory points to retrieve.
|
package/dist/endpoints/memory.js
CHANGED
|
@@ -48,51 +48,6 @@ class MemoryEndpoint extends abstract_1.AbstractEndpoint {
|
|
|
48
48
|
return this.post(this.formatUrl("/collections/" + collection), agentId);
|
|
49
49
|
}
|
|
50
50
|
// END Memory Collections API --
|
|
51
|
-
// -- Memory Conversation History API
|
|
52
|
-
/**
|
|
53
|
-
* This endpoint returns the conversation history.
|
|
54
|
-
*
|
|
55
|
-
* @param agentId The agent ID.
|
|
56
|
-
* @param userId The user ID to filter the conversation history by.
|
|
57
|
-
*
|
|
58
|
-
* @returns The conversation history.
|
|
59
|
-
*/
|
|
60
|
-
async getConversationHistory(agentId, userId) {
|
|
61
|
-
return this.get(this.formatUrl("/conversation_history"), agentId, userId);
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* This endpoint deletes the conversation history.
|
|
65
|
-
*
|
|
66
|
-
* @param agentId The agent ID.
|
|
67
|
-
* @param userId The user ID to filter the conversation history by.
|
|
68
|
-
*
|
|
69
|
-
* @returns The output of the deletion operation.
|
|
70
|
-
*/
|
|
71
|
-
async deleteConversationHistory(agentId, userId) {
|
|
72
|
-
return this.delete(this.formatUrl("/conversation_history"), agentId, userId);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* This endpoint creates a new element in the conversation history.
|
|
76
|
-
*
|
|
77
|
-
* @param who The speaker of the conversation history.
|
|
78
|
-
* @param text The text of the conversation history.
|
|
79
|
-
* @param agentId The agent ID.
|
|
80
|
-
* @param userId The user ID to add the conversation history to.
|
|
81
|
-
* @param image The image of the conversation history.
|
|
82
|
-
* @param why The reason for the conversation history.
|
|
83
|
-
*
|
|
84
|
-
* @returns The conversation history.
|
|
85
|
-
*/
|
|
86
|
-
async postConversationHistory(who, text, agentId, userId, image, why) {
|
|
87
|
-
const payload = {
|
|
88
|
-
who: who,
|
|
89
|
-
text,
|
|
90
|
-
...(image && { image }),
|
|
91
|
-
...(why && { why: why.toArray() }),
|
|
92
|
-
};
|
|
93
|
-
return this.post(this.formatUrl("/conversation_history"), agentId, payload, userId);
|
|
94
|
-
}
|
|
95
|
-
// END Memory Conversation History API --
|
|
96
51
|
// -- Memory Points API
|
|
97
52
|
/**
|
|
98
53
|
* This endpoint retrieves memory points based on the input text. The text parameter is the input text for which the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/endpoints/memory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/endpoints/memory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAY5C,MAAa,cAAe,SAAQ,2BAAgB;IACtC,MAAM,GAAG,SAAS,CAAC;IAE7B,4BAA4B;IAE5B;;;;;;OAMG;IACH,KAAK,CAAC,oBAAoB,CAAC,OAAe;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,+BAA+B,CAAC,OAAe;QACjD,OAAO,IAAI,CAAC,MAAM,CAAgC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,qCAAqC,CACvC,UAAkB,EAClB,OAAe;QAEf,OAAO,IAAI,CAAC,MAAM,CACd,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,CAAC,EAC5C,OAAO,CACV,CAAC;IACN,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,qBAAqB,CACvB,UAAkB,EAClB,OAAe;QAEf,OAAO,IAAI,CAAC,IAAI,CACZ,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,CAAC,EAC5C,OAAO,CACV,CAAC;IACN,CAAC;IAED,gCAAgC;IAEhC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CACd,CAAC;IACN,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,iBAAiB,CACnB,UAAkB,EAClB,OAAe,EACf,OAAe;QAEf,OAAO,IAAI,CAAC,MAAM,CACd,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,CAAC,EACnE,OAAO,CACV,CAAC;IACN,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,4BAA4B,CAC9B,UAAkB,EAClB,OAAe,EACf,QAAc;QAEd,OAAO,IAAI,CAAC,MAAM,CACd,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,GAAG,SAAS,CAAC,EACxD,OAAO,EACP,IAAI,EACJ,QAAQ,CACX,CAAC;IACN,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,eAAe,CACjB,UAAkB,EAClB,OAAe,EACf,KAAqB,EACrB,MAAsB,EACtB,QAAc;QAEd,MAAM,KAAK,GAAG;YACV,GAAG,CAAC,KAAK,IAAI,EAAC,KAAK,EAAC,CAAC;YACrB,GAAG,CAAC,MAAM,IAAI,EAAC,MAAM,EAAC,CAAC;YACvB,GAAG,CAAC,QAAQ,IAAI,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAC,CAAC;SACxD,CAAC;QAEF,OAAO,IAAI,CAAC,GAAG,CACX,IAAI,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,GAAG,SAAS,CAAC,EACxD,OAAO,EACP,IAAI,EACJ,KAAK,CACR,CAAC;IACN,CAAC;CAGJ;AApOD,wCAoOC"}
|
|
@@ -29,6 +29,7 @@ export declare class RabbitHoleEndpoint extends AbstractEndpoint {
|
|
|
29
29
|
* - In Node.js: A string path to the file
|
|
30
30
|
* - In browser: A File object
|
|
31
31
|
* @param agentId ID of the agent to associate with this upload
|
|
32
|
+
* @param chatId Optional ID of the chat to associate with this upload
|
|
32
33
|
* @param fileName Optional custom name for the file. If not provided:
|
|
33
34
|
* - In Node.js: The basename of the file path is used
|
|
34
35
|
* - In browser: The name property of the File object is used
|
|
@@ -50,7 +51,7 @@ export declare class RabbitHoleEndpoint extends AbstractEndpoint {
|
|
|
50
51
|
* const response = await rabbitHoleEndpoint.postFile('/path/to/document.pdf');
|
|
51
52
|
* ```
|
|
52
53
|
*/
|
|
53
|
-
postFile(fileSource: FileSource, agentId: string, fileName?: string | null, metadata?: Record<string, any> | null): Promise<any>;
|
|
54
|
+
postFile(fileSource: FileSource, agentId: string, chatId?: string | null, fileName?: string | null, metadata?: Record<string, any> | null): Promise<any>;
|
|
54
55
|
/**
|
|
55
56
|
* This method posts a number of files to the RabbitHole API. The files are uploaded to the RabbitHole server and
|
|
56
57
|
* ingested into the RAG system.
|
|
@@ -68,6 +69,7 @@ export declare class RabbitHoleEndpoint extends AbstractEndpoint {
|
|
|
68
69
|
* - In Node.js: An array of strings path to the file
|
|
69
70
|
* - In browser: An array of File objects
|
|
70
71
|
* @param agentId ID of the agent to associate with this upload
|
|
72
|
+
* @param chatId Optional ID of the chat to associate with this upload
|
|
71
73
|
* @param metadata Optional additional metadata to associate with the file
|
|
72
74
|
*
|
|
73
75
|
* @returns Promise resolving to the API response data
|
|
@@ -86,7 +88,7 @@ export declare class RabbitHoleEndpoint extends AbstractEndpoint {
|
|
|
86
88
|
* const response = await rabbitHoleEndpoint.postFiles(['/path/to/first/document.pdf', '/path/to/second/document.pdf']);
|
|
87
89
|
* ```
|
|
88
90
|
*/
|
|
89
|
-
postFiles(fileSources: FileSource[], agentId: string, metadata?: Record<string, any> | null): Promise<any>;
|
|
91
|
+
postFiles(fileSources: FileSource[], agentId: string, chatId?: string | null, metadata?: Record<string, any> | null): Promise<any>;
|
|
90
92
|
/**
|
|
91
93
|
* This method posts a web URL to the RabbitHole API. The web URL is ingested into the RAG system. The web URL is
|
|
92
94
|
* processed by the RAG system by Web scraping, and the results are stored in the RAG database. The process is
|
|
@@ -74,6 +74,7 @@ class RabbitHoleEndpoint extends abstract_1.AbstractEndpoint {
|
|
|
74
74
|
* - In Node.js: A string path to the file
|
|
75
75
|
* - In browser: A File object
|
|
76
76
|
* @param agentId ID of the agent to associate with this upload
|
|
77
|
+
* @param chatId Optional ID of the chat to associate with this upload
|
|
77
78
|
* @param fileName Optional custom name for the file. If not provided:
|
|
78
79
|
* - In Node.js: The basename of the file path is used
|
|
79
80
|
* - In browser: The name property of the File object is used
|
|
@@ -95,13 +96,14 @@ class RabbitHoleEndpoint extends abstract_1.AbstractEndpoint {
|
|
|
95
96
|
* const response = await rabbitHoleEndpoint.postFile('/path/to/document.pdf');
|
|
96
97
|
* ```
|
|
97
98
|
*/
|
|
98
|
-
async postFile(fileSource, agentId, fileName, metadata) {
|
|
99
|
+
async postFile(fileSource, agentId, chatId, fileName, metadata) {
|
|
99
100
|
const form = (0, form_data_2.createFormData)();
|
|
101
|
+
const endpoint = chatId ? this.formatUrl(`/${chatId}`) : this.prefix;
|
|
100
102
|
try {
|
|
101
103
|
await this.appendFileToForm(form, fileSource, "file", fileName);
|
|
102
104
|
this.appendQueryDataToForm(form, metadata);
|
|
103
105
|
// Send the request
|
|
104
|
-
return await this.submitForm(form,
|
|
106
|
+
return await this.submitForm(form, endpoint, agentId);
|
|
105
107
|
}
|
|
106
108
|
catch (error) {
|
|
107
109
|
this.throwError(fileSource, error);
|
|
@@ -124,6 +126,7 @@ class RabbitHoleEndpoint extends abstract_1.AbstractEndpoint {
|
|
|
124
126
|
* - In Node.js: An array of strings path to the file
|
|
125
127
|
* - In browser: An array of File objects
|
|
126
128
|
* @param agentId ID of the agent to associate with this upload
|
|
129
|
+
* @param chatId Optional ID of the chat to associate with this upload
|
|
127
130
|
* @param metadata Optional additional metadata to associate with the file
|
|
128
131
|
*
|
|
129
132
|
* @returns Promise resolving to the API response data
|
|
@@ -142,15 +145,16 @@ class RabbitHoleEndpoint extends abstract_1.AbstractEndpoint {
|
|
|
142
145
|
* const response = await rabbitHoleEndpoint.postFiles(['/path/to/first/document.pdf', '/path/to/second/document.pdf']);
|
|
143
146
|
* ```
|
|
144
147
|
*/
|
|
145
|
-
async postFiles(fileSources, agentId, metadata) {
|
|
148
|
+
async postFiles(fileSources, agentId, chatId, metadata) {
|
|
146
149
|
const form = new form_data_1.default();
|
|
150
|
+
const endpoint = chatId ? this.formatUrl(`/batch/${chatId}`) : this.formatUrl("/batch");
|
|
147
151
|
try {
|
|
148
152
|
await Promise.all(fileSources.map(async (fileSource) => {
|
|
149
153
|
await this.appendFileToForm(form, fileSource, "files");
|
|
150
154
|
}));
|
|
151
155
|
// Append additional query parameters
|
|
152
156
|
this.appendQueryDataToForm(form, metadata);
|
|
153
|
-
return await this.submitForm(form,
|
|
157
|
+
return await this.submitForm(form, endpoint, agentId);
|
|
154
158
|
}
|
|
155
159
|
catch (error) {
|
|
156
160
|
this.throwError(fileSources[0], error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rabbitHole.js","sourceRoot":"","sources":["../../src/endpoints/rabbitHole.ts"],"names":[],"mappings":";;;;;;AAAA;;;;;;GAMG;AACH,yCAA4C;AAC5C,0DAAiC;AACjC,sDAAuD;AACvD,sDAAwF;AACxF,kDAAkD;AAGlD,MAAa,kBAAmB,SAAQ,2BAAgB;IAC1C,MAAM,GAAG,aAAa,CAAC;IAEzB,UAAU,CAAC,UAAsB,EAAE,KAAU;QACjD,2DAA2D;QAC3D,IAAI,CAAC,IAAA,+BAAiB,GAAE,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAC;QAC1G,CAAC;aAAM,IAAI,IAAA,+BAAiB,GAAE,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;QACvF,CAAC;QAED,8BAA8B;QAC9B,MAAM,KAAK,CAAC;IAChB,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAC1B,IAA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AO,IAAI,CAAC,GAAG,CAAW,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;CACJ;AAxRD,gDAwRC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConversationHistoryItem } from "./nested/memories";
|
|
2
|
+
export interface ConversationHistoryDeleteOutput {
|
|
3
|
+
deleted: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare class ConversationHistoryOutput {
|
|
6
|
+
history: ConversationHistoryItem[];
|
|
7
|
+
toArray(): Record<string, unknown>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConversationHistoryOutput = void 0;
|
|
4
|
+
class ConversationHistoryOutput {
|
|
5
|
+
history;
|
|
6
|
+
toArray() {
|
|
7
|
+
const history = this.history.map(h => h.toArray());
|
|
8
|
+
return { history };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.ConversationHistoryOutput = ConversationHistoryOutput;
|
|
12
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/models/api/conversations.ts"],"names":[],"mappings":";;;AAMA,MAAa,yBAAyB;IAClC,OAAO,CAA4B;IAE5B,OAAO;QACV,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,EAAE,CAAC;IACvB,CAAC;CACJ;AAPD,8DAOC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import { MemoryPoint } from "../../types";
|
|
2
|
-
import { CollectionsItem,
|
|
2
|
+
import { CollectionsItem, MemoryPointsDeleteByMetadataInfo, MemoryRecallQuery, MemoryRecallVectors, VectorRecord } from "./nested/memories";
|
|
3
3
|
export interface CollectionPointsDestroyOutput {
|
|
4
4
|
deleted: Record<string, boolean>;
|
|
5
5
|
}
|
|
6
6
|
export interface CollectionsOutput {
|
|
7
7
|
collections: CollectionsItem[];
|
|
8
8
|
}
|
|
9
|
-
export interface ConversationHistoryDeleteOutput {
|
|
10
|
-
deleted: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare class ConversationHistoryOutput {
|
|
13
|
-
history: ConversationHistoryItem[];
|
|
14
|
-
toArray(): Record<string, unknown>;
|
|
15
|
-
}
|
|
16
9
|
export interface MemoryPointDeleteOutput {
|
|
17
10
|
deleted: string;
|
|
18
11
|
}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConversationHistoryOutput = void 0;
|
|
4
|
-
class ConversationHistoryOutput {
|
|
5
|
-
history;
|
|
6
|
-
toArray() {
|
|
7
|
-
const history = this.history.map(h => h.toArray());
|
|
8
|
-
return { history };
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.ConversationHistoryOutput = ConversationHistoryOutput;
|
|
12
3
|
//# sourceMappingURL=memories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memories.js","sourceRoot":"","sources":["../../../src/models/api/memories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"memories.js","sourceRoot":"","sources":["../../../src/models/api/memories.ts"],"names":[],"mappings":""}
|