@toothfairyai/sdk 0.1.0-beta.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/LICENSE +21 -0
- package/README.md +395 -0
- package/dist/chat/ChatManager.d.ts +22 -0
- package/dist/chat/ChatManager.d.ts.map +1 -0
- package/dist/chat/ChatManager.js +89 -0
- package/dist/chat/ChatManager.js.map +1 -0
- package/dist/client.d.ts +38 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +126 -0
- package/dist/client.js.map +1 -0
- package/dist/documents/DocumentManager.d.ts +34 -0
- package/dist/documents/DocumentManager.d.ts.map +1 -0
- package/dist/documents/DocumentManager.js +268 -0
- package/dist/documents/DocumentManager.js.map +1 -0
- package/dist/entities/EntityManager.d.ts +24 -0
- package/dist/entities/EntityManager.d.ts.map +1 -0
- package/dist/entities/EntityManager.js +56 -0
- package/dist/entities/EntityManager.js.map +1 -0
- package/dist/folders/FolderManager.d.ts +30 -0
- package/dist/folders/FolderManager.d.ts.map +1 -0
- package/dist/folders/FolderManager.js +86 -0
- package/dist/folders/FolderManager.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts/PromptManager.d.ts +23 -0
- package/dist/prompts/PromptManager.d.ts.map +1 -0
- package/dist/prompts/PromptManager.js +83 -0
- package/dist/prompts/PromptManager.js.map +1 -0
- package/dist/streaming/StreamingManager.d.ts +53 -0
- package/dist/streaming/StreamingManager.d.ts.map +1 -0
- package/dist/streaming/StreamingManager.js +217 -0
- package/dist/streaming/StreamingManager.js.map +1 -0
- package/dist/types/index.d.ts +273 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +17 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
export interface ToothFairyClientConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
workspaceId: string;
|
|
4
|
+
baseUrl?: string;
|
|
5
|
+
aiUrl?: string;
|
|
6
|
+
aiStreamUrl?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Chat {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
primaryRole: string;
|
|
13
|
+
externalParticipantId: string;
|
|
14
|
+
channelSettings: ChannelSettings;
|
|
15
|
+
customerId: string;
|
|
16
|
+
customerInfo: Record<string, any>;
|
|
17
|
+
isAIReplying: boolean;
|
|
18
|
+
createdAt?: string;
|
|
19
|
+
updatedAt?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ChannelSettings {
|
|
22
|
+
sms: {
|
|
23
|
+
isEnabled: boolean;
|
|
24
|
+
recipient: string;
|
|
25
|
+
providerID: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface Message {
|
|
29
|
+
id: string;
|
|
30
|
+
chatID: string;
|
|
31
|
+
text: string;
|
|
32
|
+
role: 'user' | 'assistant' | 'system';
|
|
33
|
+
userID: string;
|
|
34
|
+
createdAt?: string;
|
|
35
|
+
updatedAt?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ChatCreateData {
|
|
38
|
+
name: string;
|
|
39
|
+
primaryRole: string;
|
|
40
|
+
externalParticipantId: string;
|
|
41
|
+
channelSettings: ChannelSettings;
|
|
42
|
+
customerId: string;
|
|
43
|
+
customerInfo?: Record<string, any>;
|
|
44
|
+
isAIReplying?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface MessageCreateData {
|
|
47
|
+
chatID: string;
|
|
48
|
+
text: string;
|
|
49
|
+
role: 'user' | 'assistant' | 'system';
|
|
50
|
+
userID: string;
|
|
51
|
+
}
|
|
52
|
+
export interface AgentRequest {
|
|
53
|
+
chatid: string;
|
|
54
|
+
messages: AgentMessage[];
|
|
55
|
+
agentid: string;
|
|
56
|
+
}
|
|
57
|
+
export interface AgentMessage {
|
|
58
|
+
text: string;
|
|
59
|
+
role: 'user' | 'assistant' | 'system';
|
|
60
|
+
userID: string;
|
|
61
|
+
}
|
|
62
|
+
export interface AgentResponse {
|
|
63
|
+
chatId: string;
|
|
64
|
+
messageId: string;
|
|
65
|
+
agentResponse: any;
|
|
66
|
+
}
|
|
67
|
+
export type StreamEventType = 'status' | 'progress' | 'data' | 'complete' | 'metadata' | 'callback' | 'error' | 'unknown';
|
|
68
|
+
export interface StreamEvent {
|
|
69
|
+
type: StreamEventType;
|
|
70
|
+
data: any;
|
|
71
|
+
}
|
|
72
|
+
export interface StreamStatusEvent {
|
|
73
|
+
status: 'connected' | 'complete' | 'inProgress' | 'fulfilled';
|
|
74
|
+
metadata?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface StreamProgressEvent {
|
|
77
|
+
status: 'inProgress';
|
|
78
|
+
processing_status?: string;
|
|
79
|
+
metadata_parsed?: Record<string, any>;
|
|
80
|
+
}
|
|
81
|
+
export interface StreamDataEvent {
|
|
82
|
+
text: string;
|
|
83
|
+
type: 'message';
|
|
84
|
+
}
|
|
85
|
+
export interface Document {
|
|
86
|
+
id: string;
|
|
87
|
+
workspaceid: string;
|
|
88
|
+
userid: string;
|
|
89
|
+
type: DocumentType;
|
|
90
|
+
title: string;
|
|
91
|
+
topics: string[];
|
|
92
|
+
folderid: string;
|
|
93
|
+
external_path: string;
|
|
94
|
+
source: string;
|
|
95
|
+
status: string;
|
|
96
|
+
scope?: string;
|
|
97
|
+
rawtext?: string;
|
|
98
|
+
createdAt?: string;
|
|
99
|
+
updatedAt?: string;
|
|
100
|
+
}
|
|
101
|
+
export type DocumentType = 'readComprehensionUrl' | 'readComprehensionPdf' | 'readComprehensionFile';
|
|
102
|
+
export interface DocumentCreateData {
|
|
103
|
+
userid: string;
|
|
104
|
+
type: DocumentType;
|
|
105
|
+
title: string;
|
|
106
|
+
topics?: string[];
|
|
107
|
+
folderid?: string;
|
|
108
|
+
external_path: string;
|
|
109
|
+
source?: string;
|
|
110
|
+
status?: string;
|
|
111
|
+
scope?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface DocumentUpdateData {
|
|
114
|
+
workspaceid?: string;
|
|
115
|
+
userid?: string;
|
|
116
|
+
type?: DocumentType;
|
|
117
|
+
rawtext?: string;
|
|
118
|
+
title?: string;
|
|
119
|
+
status?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface DocumentSearchRequest {
|
|
122
|
+
text: string;
|
|
123
|
+
topK?: number;
|
|
124
|
+
metadata?: Record<string, any>;
|
|
125
|
+
}
|
|
126
|
+
export interface FileUploadOptions {
|
|
127
|
+
importType?: string;
|
|
128
|
+
contentType?: string;
|
|
129
|
+
onProgress?: (percent: number, loaded: number, total: number) => void;
|
|
130
|
+
}
|
|
131
|
+
export interface FileUploadResult {
|
|
132
|
+
success: boolean;
|
|
133
|
+
originalFilename: string;
|
|
134
|
+
sanitizedFilename: string;
|
|
135
|
+
filename: string;
|
|
136
|
+
importType: string;
|
|
137
|
+
contentType: string;
|
|
138
|
+
size: number;
|
|
139
|
+
sizeInMB: number;
|
|
140
|
+
}
|
|
141
|
+
export interface FileDownloadOptions {
|
|
142
|
+
context?: string;
|
|
143
|
+
onProgress?: (percent: number, loaded: number, total: number) => void;
|
|
144
|
+
}
|
|
145
|
+
export interface FileDownloadResult {
|
|
146
|
+
success: boolean;
|
|
147
|
+
outputPath: string;
|
|
148
|
+
size: number;
|
|
149
|
+
sizeInMB: string;
|
|
150
|
+
}
|
|
151
|
+
export interface Entity {
|
|
152
|
+
id: string;
|
|
153
|
+
workspaceid: string;
|
|
154
|
+
createdBy: string;
|
|
155
|
+
label: string;
|
|
156
|
+
type: EntityType;
|
|
157
|
+
description?: string;
|
|
158
|
+
emoji?: string;
|
|
159
|
+
parentEntity?: string;
|
|
160
|
+
backgroundColor?: string;
|
|
161
|
+
createdAt?: string;
|
|
162
|
+
updatedAt?: string;
|
|
163
|
+
}
|
|
164
|
+
export type EntityType = 'intent' | 'ner' | 'topic';
|
|
165
|
+
export interface EntityCreateData {
|
|
166
|
+
label: string;
|
|
167
|
+
type: EntityType;
|
|
168
|
+
description?: string;
|
|
169
|
+
emoji?: string;
|
|
170
|
+
parentEntity?: string;
|
|
171
|
+
backgroundColor?: string;
|
|
172
|
+
}
|
|
173
|
+
export interface EntityUpdateData {
|
|
174
|
+
label?: string;
|
|
175
|
+
description?: string;
|
|
176
|
+
emoji?: string;
|
|
177
|
+
parentEntity?: string;
|
|
178
|
+
backgroundColor?: string;
|
|
179
|
+
}
|
|
180
|
+
export interface Folder {
|
|
181
|
+
id: string;
|
|
182
|
+
workspaceID: string;
|
|
183
|
+
createdBy: string;
|
|
184
|
+
name: string;
|
|
185
|
+
description?: string;
|
|
186
|
+
emoji?: string;
|
|
187
|
+
status?: string;
|
|
188
|
+
parent?: string;
|
|
189
|
+
createdAt?: string;
|
|
190
|
+
updatedAt?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface FolderCreateData {
|
|
193
|
+
name: string;
|
|
194
|
+
description?: string;
|
|
195
|
+
emoji?: string;
|
|
196
|
+
status?: string;
|
|
197
|
+
parent?: string;
|
|
198
|
+
}
|
|
199
|
+
export interface FolderUpdateData {
|
|
200
|
+
name?: string;
|
|
201
|
+
description?: string;
|
|
202
|
+
emoji?: string;
|
|
203
|
+
status?: string;
|
|
204
|
+
parent?: string;
|
|
205
|
+
}
|
|
206
|
+
export interface Prompt {
|
|
207
|
+
id: string;
|
|
208
|
+
workspaceID: string;
|
|
209
|
+
createdBy: string;
|
|
210
|
+
type: string;
|
|
211
|
+
label: string;
|
|
212
|
+
promptLength: number;
|
|
213
|
+
interpolationString: string;
|
|
214
|
+
scope?: string;
|
|
215
|
+
style?: string;
|
|
216
|
+
domain?: string;
|
|
217
|
+
promptPlaceholder?: string;
|
|
218
|
+
availableToAgents?: string[];
|
|
219
|
+
createdAt?: string;
|
|
220
|
+
updatedAt?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface PromptCreateData {
|
|
223
|
+
type: string;
|
|
224
|
+
label: string;
|
|
225
|
+
promptLength: number;
|
|
226
|
+
interpolationString: string;
|
|
227
|
+
scope?: string;
|
|
228
|
+
style?: string;
|
|
229
|
+
domain?: string;
|
|
230
|
+
promptPlaceholder?: string;
|
|
231
|
+
availableToAgents?: string[];
|
|
232
|
+
}
|
|
233
|
+
export interface PromptUpdateData {
|
|
234
|
+
type?: string;
|
|
235
|
+
label?: string;
|
|
236
|
+
promptLength?: number;
|
|
237
|
+
interpolationString?: string;
|
|
238
|
+
scope?: string;
|
|
239
|
+
style?: string;
|
|
240
|
+
domain?: string;
|
|
241
|
+
promptPlaceholder?: string;
|
|
242
|
+
availableToAgents?: string[];
|
|
243
|
+
}
|
|
244
|
+
export interface SpeechGenerationRequest {
|
|
245
|
+
text: string;
|
|
246
|
+
chatId?: string;
|
|
247
|
+
lastMessageId?: string;
|
|
248
|
+
}
|
|
249
|
+
export declare class ToothFairyError extends Error {
|
|
250
|
+
readonly code: string;
|
|
251
|
+
readonly statusCode?: number;
|
|
252
|
+
readonly response?: any;
|
|
253
|
+
constructor(message: string, code: string, statusCode?: number, response?: any);
|
|
254
|
+
}
|
|
255
|
+
export interface ApiResponse<T = any> {
|
|
256
|
+
success: boolean;
|
|
257
|
+
data?: T;
|
|
258
|
+
message?: string;
|
|
259
|
+
error?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface ListResponse<T> {
|
|
262
|
+
items: T[];
|
|
263
|
+
total?: number;
|
|
264
|
+
limit?: number;
|
|
265
|
+
offset?: number;
|
|
266
|
+
}
|
|
267
|
+
export interface ProgressCallback {
|
|
268
|
+
(percent: number, loaded: number, total: number): void;
|
|
269
|
+
}
|
|
270
|
+
export interface StreamEventCallback {
|
|
271
|
+
(type: StreamEventType, data: any): void;
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,MAAM,WAA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|
3
|
+
exports.ToothFairyError = void 0;
|
|
4
|
+
class ToothFairyError extends Error {
|
|
5
|
+
constructor(message, code, statusCode, response) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'ToothFairyError';
|
|
8
|
+
this.code = code;
|
|
9
|
+
this.statusCode = statusCode;
|
|
10
|
+
this.response = response;
|
|
11
|
+
if (Error.captureStackTrace) {
|
|
12
|
+
Error.captureStackTrace(this, ToothFairyError);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ToothFairyError = ToothFairyError;
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAqSA,MAAa,eAAgB,SAAQ,KAAK;IAKxC,YAAY,OAAe,EAAE,IAAY,EAAE,UAAmB,EAAE,QAAc;QAC5E,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAGzB,IAAI,KAAK,CAAC,iBAAiB,EAAE;YAC3B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;SAChD;IACH,CAAC;CACF;AAjBD,0CAiBC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@toothfairyai/sdk",
|
|
3
|
+
"version": "0.1.0-beta.1",
|
|
4
|
+
"description": "JavaScript/TypeScript SDK for ToothFairyAI API integration",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist/**/*",
|
|
9
|
+
"README.md",
|
|
10
|
+
"LICENSE"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"build:watch": "tsc --watch",
|
|
15
|
+
"test": "jest",
|
|
16
|
+
"test:watch": "jest --watch",
|
|
17
|
+
"lint": "eslint src/**/*.ts",
|
|
18
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
19
|
+
"clean": "rm -rf dist",
|
|
20
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
21
|
+
"prepack": "npm run clean && npm run build",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"release": "../release-sdk.sh",
|
|
24
|
+
"version": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"toothfairy",
|
|
28
|
+
"ai",
|
|
29
|
+
"sdk",
|
|
30
|
+
"api",
|
|
31
|
+
"chatbot",
|
|
32
|
+
"agent",
|
|
33
|
+
"typescript",
|
|
34
|
+
"javascript",
|
|
35
|
+
"integration",
|
|
36
|
+
"streaming",
|
|
37
|
+
"documents"
|
|
38
|
+
],
|
|
39
|
+
"author": "ToothFairyAI <support@toothfairyai.com>",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"publishConfig": {
|
|
42
|
+
"access": "public"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "https://gitea.toothfairyai.com/ToothFairyAI/tooth-fairy-website/toothfairy-sdk.git"
|
|
47
|
+
},
|
|
48
|
+
"bugs": {
|
|
49
|
+
"url": "https://gitea.toothfairyai.com/ToothFairyAI/tooth-fairy-website/toothfairy-sdk/issues"
|
|
50
|
+
},
|
|
51
|
+
"homepage": "https://gitea.toothfairyai.com/ToothFairyAI/tooth-fairy-website/toothfairy-sdk#readme",
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"axios": "^1.4.0",
|
|
54
|
+
"events": "^3.3.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^18.15.0",
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
59
|
+
"@typescript-eslint/parser": "^5.54.0",
|
|
60
|
+
"eslint": "^8.32.0",
|
|
61
|
+
"jest": "^29.3.1",
|
|
62
|
+
"@types/jest": "^29.4.0",
|
|
63
|
+
"ts-jest": "^29.0.5",
|
|
64
|
+
"typescript": "^4.9.5"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=14.0.0"
|
|
68
|
+
},
|
|
69
|
+
"exports": {
|
|
70
|
+
".": {
|
|
71
|
+
"types": "./dist/index.d.ts",
|
|
72
|
+
"require": "./dist/index.js",
|
|
73
|
+
"import": "./dist/index.mjs"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|