ttc-ai-chat-sdk 0.0.12-beta → 0.0.13-dev
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/README.md +8 -8
- package/dist/construct.js +2 -2
- package/dist/construct.js.map +1 -1
- package/dist/index.d.ts +32 -132
- package/dist/internal.js +61 -65
- package/dist/internal.js.map +1 -1
- package/dist/ttc_server.js +38 -133
- package/dist/ttc_server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,19 +60,19 @@ import { ttc } from "ttc-ai-chat-sdk";
|
|
|
60
60
|
import { z } from "zod";
|
|
61
61
|
|
|
62
62
|
// Create a module
|
|
63
|
-
const
|
|
63
|
+
const CommerceModule = ttc.module('ecommerce');
|
|
64
64
|
|
|
65
65
|
// Add the function to the module
|
|
66
|
-
|
|
67
|
-
name: '
|
|
66
|
+
CommerceModule.add_function({
|
|
67
|
+
name: 'Invoice',
|
|
68
68
|
input_schema: z.object({
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
amount: z.number(),
|
|
70
|
+
currency: z.string()
|
|
71
71
|
}),
|
|
72
72
|
output_schema: z.string(),
|
|
73
|
-
doc:
|
|
74
|
-
func: async (
|
|
75
|
-
return `
|
|
73
|
+
doc: "Generate an invoice for the given amount and currency",
|
|
74
|
+
func: async (amount: number, currency: string) => {
|
|
75
|
+
return `Invoice generated for ${amount} ${currency}`;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
78
|
```
|
package/dist/construct.js
CHANGED
|
@@ -13,9 +13,9 @@ class TTCContruct {
|
|
|
13
13
|
};
|
|
14
14
|
this.description = description;
|
|
15
15
|
}
|
|
16
|
-
run(
|
|
16
|
+
run(instruction) {
|
|
17
17
|
const request_id = this.randId();
|
|
18
|
-
core_1.ttc.server.
|
|
18
|
+
core_1.ttc.server.ttcCore.invoke({
|
|
19
19
|
description: this.description,
|
|
20
20
|
instruction: instruction,
|
|
21
21
|
construct_id: request_id
|
package/dist/construct.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"construct.js","sourceRoot":"","sources":["../src/construct.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;
|
|
1
|
+
{"version":3,"file":"construct.js","sourceRoot":"","sources":["../src/construct.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAQ7B,MAAa,WAAW;IAIpB,YAAY,WAAmB;QAD/B,cAAS,GAAwC,EAAE,CAAC;QAKpD,WAAM,GAAG,GAAG,EAAE;YACV,OAAO,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE;gBACjC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;gBACjC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;QACP,CAAC,CAAA;QARG,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IASD,GAAG,CAAC,WAAmB;QACnB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACjC,UAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,WAAW;YACxB,YAAY,EAAE,UAAU;SAC3B,CAAC,CAAA;QAEF,OAAO,IAAI,OAAO,CAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACxC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAS,EAAE,EAAE;gBACvC,OAAO,CAAC,IAAI,CAAC,CAAC;gBACd,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACtC,CAAC,CAAC;YACF,qFAAqF;YACrF,UAAU,CAAC,GAAG,EAAE;gBACZ,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;oBAC5B,MAAM,CAAC,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC,CAAC;oBAC5D,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;iBACrC;YACL,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,qBAAqB;QACpC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AArCD,kCAqCC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -40,95 +40,54 @@ declare class RPCClient {
|
|
|
40
40
|
/**
|
|
41
41
|
* sends a message to the ai
|
|
42
42
|
*
|
|
43
|
-
* @param {
|
|
43
|
+
* @param {message: string}
|
|
44
44
|
* @returns {Promise<rpcResponseType<any>>}
|
|
45
45
|
*/
|
|
46
|
-
chatAI(
|
|
46
|
+
chatAI(message: string): Promise<rpcResponseType$1<any>>;
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* @param {conversation_id: string, response: any[], image_urls: any[]}
|
|
51
|
-
* @returns {Promise<rpcResponseType<any>>}
|
|
52
|
-
*/
|
|
53
|
-
functionResponse(conversation_id: string, response: any[], image_urls: any[]): Promise<rpcResponseType$1<any>>;
|
|
54
|
-
/**
|
|
55
|
-
* get chat history
|
|
48
|
+
* This function is used to invoke the llm with a description and instruction
|
|
56
49
|
*
|
|
57
|
-
* @param {
|
|
50
|
+
* @param {input: Partial<{ description: string, instruction: string, construct_id: string }> }
|
|
58
51
|
* @returns {Promise<rpcResponseType<any>>}
|
|
59
52
|
*/
|
|
60
|
-
|
|
53
|
+
invoke(input: Partial<{
|
|
54
|
+
description: string;
|
|
55
|
+
instruction: string;
|
|
56
|
+
construct_id: string;
|
|
57
|
+
}>): Promise<rpcResponseType$1<any>>;
|
|
61
58
|
/**
|
|
62
|
-
*
|
|
59
|
+
* sends a function response to the ai
|
|
63
60
|
*
|
|
64
|
-
* @param {
|
|
61
|
+
* @param {response: any[], image_urls: any[]}
|
|
65
62
|
* @returns {Promise<rpcResponseType<any>>}
|
|
66
63
|
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Generates a chat token
|
|
70
|
-
*
|
|
71
|
-
* @param {uuid: string}
|
|
72
|
-
* @returns {Promise<rpcResponseType<{ chatId: string }>>}
|
|
73
|
-
*/
|
|
74
|
-
createChat(uuid: string): Promise<rpcResponseType$1<{
|
|
75
|
-
chatId: string;
|
|
76
|
-
}>>;
|
|
64
|
+
functionResponse(response: any[], image_urls: any[]): Promise<rpcResponseType$1<any>>;
|
|
77
65
|
/**
|
|
78
|
-
*
|
|
66
|
+
* get chat history
|
|
79
67
|
*
|
|
80
|
-
* @param {
|
|
68
|
+
* @param {limit: number, page: number}
|
|
81
69
|
* @returns {Promise<rpcResponseType<any>>}
|
|
82
70
|
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Fetches all chats for an app
|
|
86
|
-
*
|
|
87
|
-
* @param {page: number, limit: number}
|
|
88
|
-
* @returns {Promise<rpcResponseType<string[]>>}
|
|
89
|
-
*/
|
|
90
|
-
fetchChats(page: number, limit: number): Promise<rpcResponseType$1<string[]>>;
|
|
91
|
-
/**
|
|
92
|
-
* Fetches a chat
|
|
93
|
-
*
|
|
94
|
-
* @param {chatId: string}
|
|
95
|
-
* @returns {Promise<rpcResponseType<{ id: string; inputTokens: number; outputTokens: number; metadata?: any }>>}
|
|
96
|
-
*/
|
|
97
|
-
fetchChat(chatId: string): Promise<rpcResponseType$1<{
|
|
98
|
-
id: string;
|
|
99
|
-
inputTokens: number;
|
|
100
|
-
outputTokens: number;
|
|
101
|
-
metadata?: any;
|
|
102
|
-
}>>;
|
|
71
|
+
fetchChatHistory(limit: number, page: number): Promise<rpcResponseType$1<any>>;
|
|
103
72
|
/**
|
|
104
|
-
*
|
|
73
|
+
* sets a function for the app
|
|
105
74
|
*
|
|
106
|
-
* @param {
|
|
75
|
+
* @param {func: Partial<{ }> }
|
|
107
76
|
* @returns {Promise<rpcResponseType<any>>}
|
|
108
77
|
*/
|
|
109
|
-
|
|
78
|
+
setAppFunctions(func: Partial<{}>): Promise<rpcResponseType$1<any>>;
|
|
110
79
|
/**
|
|
111
80
|
* Clears chat history, soft clears messages but retains system prompt and functions, hard clears everything
|
|
112
81
|
*
|
|
113
|
-
* @param {
|
|
82
|
+
* @param {mode: string}
|
|
114
83
|
* @returns {Promise<rpcResponseType<string>>}
|
|
115
84
|
*/
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* fetches an emote
|
|
119
|
-
*
|
|
120
|
-
* @param {}
|
|
121
|
-
* @returns {Promise<rpcResponseType<{ emote: string; modelId?: string }>>}
|
|
122
|
-
*/
|
|
123
|
-
fetchEmote(): Promise<rpcResponseType$1<{
|
|
124
|
-
emote: string;
|
|
125
|
-
modelId?: string;
|
|
126
|
-
}>>;
|
|
85
|
+
reset(mode: string): Promise<rpcResponseType$1<string>>;
|
|
127
86
|
/**
|
|
128
87
|
* Adds a remote origin for an app
|
|
129
88
|
*
|
|
130
89
|
* @param {app_id: string}
|
|
131
|
-
* @returns {Promise<rpcResponseType<{ url: string; name: string }[]>>}
|
|
90
|
+
* @returns {Promise<rpcResponseType<{ url: string; name: string; apikey: string }[]>>}
|
|
132
91
|
*/
|
|
133
92
|
fetchOrigins(app_id: string): Promise<rpcResponseType$1<{
|
|
134
93
|
url: string;
|
|
@@ -136,62 +95,14 @@ declare class RPCClient {
|
|
|
136
95
|
apikey: string;
|
|
137
96
|
}[]>>;
|
|
138
97
|
};
|
|
139
|
-
AppOAuth: {
|
|
140
|
-
/**
|
|
141
|
-
* Generate OAuth authorization URL for app integration. Platform embeds this URL to start OAuth flow.
|
|
142
|
-
*
|
|
143
|
-
* @param {appId: string, redirectUri: string, scopes: string, state: string}
|
|
144
|
-
* @returns {Promise<rpcResponseType<{ authorizationUrl: string; state: string }>>}
|
|
145
|
-
*/
|
|
146
|
-
generateAuthorizationUrl(appId: string, redirectUri: string, scopes: string, state: string): Promise<rpcResponseType$1<{
|
|
147
|
-
authorizationUrl: string;
|
|
148
|
-
state: string;
|
|
149
|
-
}>>;
|
|
150
|
-
/**
|
|
151
|
-
* Exchange authorization code for access token. Called by platform backend after receiving code.
|
|
152
|
-
*
|
|
153
|
-
* @param {code: string, appId: string, redirectUri: string}
|
|
154
|
-
* @returns {Promise<rpcResponseType<{ accessToken: string; tokenType: string; expiresIn: number; appUserId: string; emote: any }>>}
|
|
155
|
-
*/
|
|
156
|
-
exchangeCodeForToken(code: string, appId: string, redirectUri: string): Promise<rpcResponseType$1<{
|
|
157
|
-
accessToken: string;
|
|
158
|
-
tokenType: string;
|
|
159
|
-
expiresIn: number;
|
|
160
|
-
appUserId: string;
|
|
161
|
-
emote: any;
|
|
162
|
-
}>>;
|
|
163
|
-
/**
|
|
164
|
-
* Refresh an expired access token for continued API access.
|
|
165
|
-
*
|
|
166
|
-
* @param {appUserId: string, appId: string}
|
|
167
|
-
* @returns {Promise<rpcResponseType<{ accessToken: string; tokenType: string; expiresIn: number; appUserId: string }>>}
|
|
168
|
-
*/
|
|
169
|
-
refreshToken(appUserId: string, appId: string): Promise<rpcResponseType$1<{
|
|
170
|
-
accessToken: string;
|
|
171
|
-
tokenType: string;
|
|
172
|
-
expiresIn: number;
|
|
173
|
-
appUserId: string;
|
|
174
|
-
}>>;
|
|
175
|
-
};
|
|
176
|
-
Media: {
|
|
177
|
-
/**
|
|
178
|
-
* Uploads an image to S3 and returns its URL. Replaces any existing image for the conversation.
|
|
179
|
-
*
|
|
180
|
-
* @param {appId: string, conversationId: string, file: any}
|
|
181
|
-
* @returns {Promise<rpcResponseType<{ url: string }>>}
|
|
182
|
-
*/
|
|
183
|
-
uploadImage(appId: string, conversationId: string, file: any): Promise<rpcResponseType$1<{
|
|
184
|
-
url: string;
|
|
185
|
-
}>>;
|
|
186
|
-
};
|
|
187
98
|
TCC: {
|
|
188
99
|
/**
|
|
189
100
|
* Get list of all models available to you
|
|
190
101
|
*
|
|
191
|
-
* @param {
|
|
102
|
+
* @param {}
|
|
192
103
|
* @returns {Promise<rpcResponseType<{ id: string; name: string; type: string; provider: string }[]>>}
|
|
193
104
|
*/
|
|
194
|
-
get_models(
|
|
105
|
+
get_models(): Promise<rpcResponseType$1<{
|
|
195
106
|
id: string;
|
|
196
107
|
name: string;
|
|
197
108
|
type: string;
|
|
@@ -200,10 +111,10 @@ declare class RPCClient {
|
|
|
200
111
|
/**
|
|
201
112
|
* Get current model for a conversation
|
|
202
113
|
*
|
|
203
|
-
* @param {
|
|
114
|
+
* @param {}
|
|
204
115
|
* @returns {Promise<rpcResponseType<{ emote: string; nlp_model: string; assistant: string }>>}
|
|
205
116
|
*/
|
|
206
|
-
conversation_stats(
|
|
117
|
+
conversation_stats(): Promise<rpcResponseType$1<{
|
|
207
118
|
emote: string;
|
|
208
119
|
nlp_model: string;
|
|
209
120
|
assistant: string;
|
|
@@ -211,35 +122,24 @@ declare class RPCClient {
|
|
|
211
122
|
/**
|
|
212
123
|
* Changes the model for a conversation, use with caution, may discontinue chat if model is not compatible
|
|
213
124
|
*
|
|
214
|
-
* @param {
|
|
125
|
+
* @param {model_id: string, type: string}
|
|
215
126
|
* @returns {Promise<rpcResponseType<any>>}
|
|
216
127
|
*/
|
|
217
|
-
change_to_model(
|
|
128
|
+
change_to_model(model_id: string, type: string): Promise<rpcResponseType$1<any>>;
|
|
218
129
|
/**
|
|
219
130
|
* Trigger the ai to act based on a trigger message
|
|
220
131
|
*
|
|
221
|
-
* @param {
|
|
132
|
+
* @param {message: string, eta_seconds: number}
|
|
222
133
|
* @returns {Promise<rpcResponseType<any>>}
|
|
223
134
|
*/
|
|
224
|
-
trigger(
|
|
225
|
-
/**
|
|
226
|
-
* This function is used to invoke the llm with a description and instruction
|
|
227
|
-
*
|
|
228
|
-
* @param {conversation_id: string, input: Partial<{ description: string, instruction: string, construct_id: string }> }
|
|
229
|
-
* @returns {Promise<rpcResponseType<any>>}
|
|
230
|
-
*/
|
|
231
|
-
invoke_construct(conversation_id: string, input: Partial<{
|
|
232
|
-
description: string;
|
|
233
|
-
instruction: string;
|
|
234
|
-
construct_id: string;
|
|
235
|
-
}>): Promise<rpcResponseType$1<any>>;
|
|
135
|
+
trigger(message: string, eta_seconds: number): Promise<rpcResponseType$1<any>>;
|
|
236
136
|
/**
|
|
237
137
|
* specifies a selected data on the client for the ai to work with
|
|
238
138
|
*
|
|
239
|
-
* @param {
|
|
139
|
+
* @param {data: string}
|
|
240
140
|
* @returns {Promise<rpcResponseType<any>>}
|
|
241
141
|
*/
|
|
242
|
-
select_context(
|
|
142
|
+
select_context(data: string): Promise<rpcResponseType$1<any>>;
|
|
243
143
|
};
|
|
244
144
|
}
|
|
245
145
|
declare class TTCContruct {
|
|
@@ -247,7 +147,7 @@ declare class TTCContruct {
|
|
|
247
147
|
callbacks: Record<string, (data: any) => void>;
|
|
248
148
|
constructor(description: string);
|
|
249
149
|
randId: () => string;
|
|
250
|
-
run(
|
|
150
|
+
run(instruction: string): Promise<any>;
|
|
251
151
|
}
|
|
252
152
|
declare class TTCModule {
|
|
253
153
|
name: string;
|
package/dist/internal.js
CHANGED
|
@@ -11,60 +11,56 @@ class TTCInternal {
|
|
|
11
11
|
this.getFunctionDetails = (functionName) => {
|
|
12
12
|
return this.ai?.functions[functionName];
|
|
13
13
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
console.error('Screenshot failed:', error);
|
|
65
|
-
throw new Error(`Screenshot failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
14
|
+
// takeScreenshot = async (conversation_id: string, x: number = 0, y: number = 0, width?: number, height?: number): Promise<string> => {
|
|
15
|
+
// try {
|
|
16
|
+
// // Request screen capture permission
|
|
17
|
+
// const stream = await navigator.mediaDevices.getDisplayMedia({
|
|
18
|
+
// video: true
|
|
19
|
+
// });
|
|
20
|
+
// const video = document.createElement('video');
|
|
21
|
+
// video.srcObject = stream;
|
|
22
|
+
// await new Promise(resolve => video.onloadedmetadata = resolve);
|
|
23
|
+
// video.play();
|
|
24
|
+
// // Create canvas to capture the screenshot
|
|
25
|
+
// const canvas = document.createElement('canvas');
|
|
26
|
+
// const ctx = canvas.getContext('2d');
|
|
27
|
+
// if (!ctx) {
|
|
28
|
+
// throw new Error('Could not get canvas context');
|
|
29
|
+
// }
|
|
30
|
+
// // Set canvas size to video dimensions or specified dimensions
|
|
31
|
+
// const videoWidth = video.videoWidth;
|
|
32
|
+
// const videoHeight = video.videoHeight;
|
|
33
|
+
// canvas.width = width || videoWidth;
|
|
34
|
+
// canvas.height = height || videoHeight;
|
|
35
|
+
// // Draw the video frame to canvas
|
|
36
|
+
// ctx.drawImage(video, x, y, width || videoWidth, height || videoHeight, 0, 0, width || videoWidth, height || videoHeight);
|
|
37
|
+
// // Stop the stream
|
|
38
|
+
// stream.getTracks().forEach(track => track.stop());
|
|
39
|
+
// // Convert to base64 data URL
|
|
40
|
+
// return new Promise<string>((resolve, reject) => {
|
|
41
|
+
// canvas.toBlob(async (blob) => {
|
|
42
|
+
// if (blob) {
|
|
43
|
+
// try {
|
|
44
|
+
// const response = await ttc.server.Media.uploadImage(ttc.app_id, conversation_id, blob);
|
|
45
|
+
// if (response.status === 'success' && response.data?.url) {
|
|
46
|
+
// console.log('Screenshot taken and uploaded:', response.data.url);
|
|
47
|
+
// resolve(response.data.url);
|
|
48
|
+
// } else {
|
|
49
|
+
// reject(new Error('Upload failed or no URL returned'));
|
|
50
|
+
// }
|
|
51
|
+
// } catch (uploadError) {
|
|
52
|
+
// reject(uploadError);
|
|
53
|
+
// }
|
|
54
|
+
// } else {
|
|
55
|
+
// reject(new Error('Could not convert canvas to blob'));
|
|
56
|
+
// }
|
|
57
|
+
// }, 'image/png');
|
|
58
|
+
// });
|
|
59
|
+
// } catch (error) {
|
|
60
|
+
// console.error('Screenshot failed:', error);
|
|
61
|
+
// throw new Error(`Screenshot failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
68
64
|
this.getEnvironment = () => {
|
|
69
65
|
// also get date and time
|
|
70
66
|
const dateString = new Date().toISOString();
|
|
@@ -88,14 +84,14 @@ class TTCInternal {
|
|
|
88
84
|
}
|
|
89
85
|
};
|
|
90
86
|
this.sendMessage = (conversation_id, message) => {
|
|
91
|
-
core_1.ttc.server.ttcCore.chatAI(
|
|
87
|
+
core_1.ttc.server.ttcCore.chatAI(message);
|
|
92
88
|
};
|
|
93
89
|
this.sendFunctionResponse = async (conversation_id, response, image_urls) => {
|
|
94
90
|
if (this.ai.on_call) {
|
|
95
91
|
this.function_response_cache = { response, image_urls };
|
|
96
92
|
}
|
|
97
93
|
else {
|
|
98
|
-
await core_1.ttc.server.ttcCore.functionResponse(
|
|
94
|
+
await core_1.ttc.server.ttcCore.functionResponse(response, image_urls);
|
|
99
95
|
}
|
|
100
96
|
};
|
|
101
97
|
this.speakToUser = async (conversation_id, message) => {
|
|
@@ -116,8 +112,8 @@ class TTCInternal {
|
|
|
116
112
|
return await this.fetchAppFunctions(conversation_id);
|
|
117
113
|
case 'TTCInternal.getFunctionDetails':
|
|
118
114
|
return await this.getFunctionDetails(args.functionName);
|
|
119
|
-
case 'TTCInternal.takeScreenshot':
|
|
120
|
-
|
|
115
|
+
// case 'TTCInternal.takeScreenshot':
|
|
116
|
+
// return await this.takeScreenshot(conversation_id, args.x, args.y, args.width, args.height);
|
|
121
117
|
default:
|
|
122
118
|
throw new Error(`Unknown function: ${functionName}`);
|
|
123
119
|
}
|
|
@@ -126,7 +122,7 @@ class TTCInternal {
|
|
|
126
122
|
}
|
|
127
123
|
async fetchAppFunctions(conversation_id) {
|
|
128
124
|
await this.ai?.fetchFunctions();
|
|
129
|
-
await core_1.ttc.server.ttcCore.setAppFunctions(
|
|
125
|
+
await core_1.ttc.server.ttcCore.setAppFunctions(this.ai?.functions);
|
|
130
126
|
return 'App functions have been added to your system message';
|
|
131
127
|
}
|
|
132
128
|
get_internal_functions() {
|
|
@@ -141,12 +137,12 @@ class TTCInternal {
|
|
|
141
137
|
input_schema: `{}`,
|
|
142
138
|
output_schema: `{ current_url: string, userAgent: string, language: string }`
|
|
143
139
|
},
|
|
144
|
-
{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
140
|
+
// {
|
|
141
|
+
// name: 'TTCInternal.takeScreenshot',
|
|
142
|
+
// description: 'Take a screenshot of a portion of the screen. Parameters: x, y (coordinates), width, height (optional - defaults to full screen)',
|
|
143
|
+
// input_schema: `{ x: number, y: number, width: number?, height: number? }`,
|
|
144
|
+
// output_schema: 'string'
|
|
145
|
+
// }
|
|
150
146
|
];
|
|
151
147
|
}
|
|
152
148
|
}
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":";;;AAAA,iCAA6B;AAM7B,MAAa,WAAW;IAMpB;QAFA,4BAAuB,GAAQ,EAAE,CAAC;QAMlC,cAAS,GAAG,CAAC,EAAS,EAAE,EAAE;YACtB,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACjB,CAAC,CAAA;QAQD,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DAA8D;aAChF;YACD,IAAI;YACJ,0CAA0C;YAC1C,uJAAuJ;YACvJ,iFAAiF;YACjF,8BAA8B;YAC9B,IAAI;SACP,CAAA;IACL,CAAC;CACJ;AAnKD,kCAmKC"}
|
package/dist/ttc_server.js
CHANGED
|
@@ -31,207 +31,112 @@ class RPCClient {
|
|
|
31
31
|
/**
|
|
32
32
|
* sends a message to the ai
|
|
33
33
|
*
|
|
34
|
-
* @param {
|
|
34
|
+
* @param {message: string}
|
|
35
35
|
* @returns {Promise<rpcResponseType<any>>}
|
|
36
36
|
*/
|
|
37
|
-
async chatAI(
|
|
38
|
-
_a.
|
|
39
|
-
return await _a.apiCallback('ttcCore.chatAI', [conversation_id, message]);
|
|
37
|
+
async chatAI(message) {
|
|
38
|
+
return await _a.apiCallback('ttcCore.chatAI', [message]);
|
|
40
39
|
},
|
|
41
40
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @param {conversation_id: string, response: any[], image_urls: any[]}
|
|
45
|
-
* @returns {Promise<rpcResponseType<any>>}
|
|
46
|
-
*/
|
|
47
|
-
async functionResponse(conversation_id, response, image_urls) {
|
|
48
|
-
return await _a.apiCallback('ttcCore.functionResponse', [conversation_id, response, image_urls]);
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* get chat history
|
|
41
|
+
* This function is used to invoke the llm with a description and instruction
|
|
52
42
|
*
|
|
53
|
-
* @param {
|
|
43
|
+
* @param {input: Partial<{ description: string, instruction: string, construct_id: string }> }
|
|
54
44
|
* @returns {Promise<rpcResponseType<any>>}
|
|
55
45
|
*/
|
|
56
|
-
async
|
|
57
|
-
return await _a.apiCallback('ttcCore.
|
|
46
|
+
async invoke(input) {
|
|
47
|
+
return await _a.apiCallback('ttcCore.invoke', [input]);
|
|
58
48
|
},
|
|
59
49
|
/**
|
|
60
|
-
*
|
|
50
|
+
* sends a function response to the ai
|
|
61
51
|
*
|
|
62
|
-
* @param {
|
|
52
|
+
* @param {response: any[], image_urls: any[]}
|
|
63
53
|
* @returns {Promise<rpcResponseType<any>>}
|
|
64
54
|
*/
|
|
65
|
-
async
|
|
66
|
-
return await _a.apiCallback('ttcCore.
|
|
67
|
-
},
|
|
68
|
-
/**
|
|
69
|
-
* Generates a chat token
|
|
70
|
-
*
|
|
71
|
-
* @param {uuid: string}
|
|
72
|
-
* @returns {Promise<rpcResponseType<{ chatId: string }>>}
|
|
73
|
-
*/
|
|
74
|
-
async createChat(uuid) {
|
|
75
|
-
return await _a.apiCallback('ttcCore.createChat', [uuid]);
|
|
55
|
+
async functionResponse(response, image_urls) {
|
|
56
|
+
return await _a.apiCallback('ttcCore.functionResponse', [response, image_urls]);
|
|
76
57
|
},
|
|
77
58
|
/**
|
|
78
|
-
*
|
|
59
|
+
* get chat history
|
|
79
60
|
*
|
|
80
|
-
* @param {
|
|
61
|
+
* @param {limit: number, page: number}
|
|
81
62
|
* @returns {Promise<rpcResponseType<any>>}
|
|
82
63
|
*/
|
|
83
|
-
async
|
|
84
|
-
return await _a.apiCallback('ttcCore.
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* Fetches all chats for an app
|
|
88
|
-
*
|
|
89
|
-
* @param {page: number, limit: number}
|
|
90
|
-
* @returns {Promise<rpcResponseType<string[]>>}
|
|
91
|
-
*/
|
|
92
|
-
async fetchChats(page, limit) {
|
|
93
|
-
return await _a.apiCallback('ttcCore.fetchChats', [page, limit]);
|
|
94
|
-
},
|
|
95
|
-
/**
|
|
96
|
-
* Fetches a chat
|
|
97
|
-
*
|
|
98
|
-
* @param {chatId: string}
|
|
99
|
-
* @returns {Promise<rpcResponseType<{ id: string; inputTokens: number; outputTokens: number; metadata?: any }>>}
|
|
100
|
-
*/
|
|
101
|
-
async fetchChat(chatId) {
|
|
102
|
-
return await _a.apiCallback('ttcCore.fetchChat', [chatId]);
|
|
64
|
+
async fetchChatHistory(limit, page) {
|
|
65
|
+
return await _a.apiCallback('ttcCore.fetchChatHistory', [limit, page]);
|
|
103
66
|
},
|
|
104
67
|
/**
|
|
105
|
-
*
|
|
68
|
+
* sets a function for the app
|
|
106
69
|
*
|
|
107
|
-
* @param {
|
|
70
|
+
* @param {func: Partial<{ }> }
|
|
108
71
|
* @returns {Promise<rpcResponseType<any>>}
|
|
109
72
|
*/
|
|
110
|
-
async
|
|
111
|
-
return await _a.apiCallback('ttcCore.
|
|
73
|
+
async setAppFunctions(func) {
|
|
74
|
+
return await _a.apiCallback('ttcCore.setAppFunctions', [func]);
|
|
112
75
|
},
|
|
113
76
|
/**
|
|
114
77
|
* Clears chat history, soft clears messages but retains system prompt and functions, hard clears everything
|
|
115
78
|
*
|
|
116
|
-
* @param {
|
|
79
|
+
* @param {mode: string}
|
|
117
80
|
* @returns {Promise<rpcResponseType<string>>}
|
|
118
81
|
*/
|
|
119
|
-
async
|
|
120
|
-
return await _a.apiCallback('ttcCore.
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* fetches an emote
|
|
124
|
-
*
|
|
125
|
-
* @param {}
|
|
126
|
-
* @returns {Promise<rpcResponseType<{ emote: string; modelId?: string }>>}
|
|
127
|
-
*/
|
|
128
|
-
async fetchEmote() {
|
|
129
|
-
return await _a.apiCallback('ttcCore.fetchEmote');
|
|
82
|
+
async reset(mode) {
|
|
83
|
+
return await _a.apiCallback('ttcCore.reset', [mode]);
|
|
130
84
|
},
|
|
131
85
|
/**
|
|
132
86
|
* Adds a remote origin for an app
|
|
133
87
|
*
|
|
134
88
|
* @param {app_id: string}
|
|
135
|
-
* @returns {Promise<rpcResponseType<{ url: string; name: string }[]>>}
|
|
89
|
+
* @returns {Promise<rpcResponseType<{ url: string; name: string; apikey: string }[]>>}
|
|
136
90
|
*/
|
|
137
91
|
async fetchOrigins(app_id) {
|
|
138
92
|
return await _a.apiCallback('ttcCore.fetchOrigins', [app_id]);
|
|
139
93
|
},
|
|
140
94
|
};
|
|
141
|
-
this.AppOAuth = {
|
|
142
|
-
/**
|
|
143
|
-
* Generate OAuth authorization URL for app integration. Platform embeds this URL to start OAuth flow.
|
|
144
|
-
*
|
|
145
|
-
* @param {appId: string, redirectUri: string, scopes: string, state: string}
|
|
146
|
-
* @returns {Promise<rpcResponseType<{ authorizationUrl: string; state: string }>>}
|
|
147
|
-
*/
|
|
148
|
-
async generateAuthorizationUrl(appId, redirectUri, scopes, state) {
|
|
149
|
-
return await _a.apiCallback('AppOAuth.generateAuthorizationUrl', [appId, redirectUri, scopes, state]);
|
|
150
|
-
},
|
|
151
|
-
/**
|
|
152
|
-
* Exchange authorization code for access token. Called by platform backend after receiving code.
|
|
153
|
-
*
|
|
154
|
-
* @param {code: string, appId: string, redirectUri: string}
|
|
155
|
-
* @returns {Promise<rpcResponseType<{ accessToken: string; tokenType: string; expiresIn: number; appUserId: string; emote: any }>>}
|
|
156
|
-
*/
|
|
157
|
-
async exchangeCodeForToken(code, appId, redirectUri) {
|
|
158
|
-
return await _a.apiCallback('AppOAuth.exchangeCodeForToken', [code, appId, redirectUri]);
|
|
159
|
-
},
|
|
160
|
-
/**
|
|
161
|
-
* Refresh an expired access token for continued API access.
|
|
162
|
-
*
|
|
163
|
-
* @param {appUserId: string, appId: string}
|
|
164
|
-
* @returns {Promise<rpcResponseType<{ accessToken: string; tokenType: string; expiresIn: number; appUserId: string }>>}
|
|
165
|
-
*/
|
|
166
|
-
async refreshToken(appUserId, appId) {
|
|
167
|
-
return await _a.apiCallback('AppOAuth.refreshToken', [appUserId, appId]);
|
|
168
|
-
},
|
|
169
|
-
};
|
|
170
|
-
this.Media = {
|
|
171
|
-
/**
|
|
172
|
-
* Uploads an image to S3 and returns its URL. Replaces any existing image for the conversation.
|
|
173
|
-
*
|
|
174
|
-
* @param {appId: string, conversationId: string, file: any}
|
|
175
|
-
* @returns {Promise<rpcResponseType<{ url: string }>>}
|
|
176
|
-
*/
|
|
177
|
-
async uploadImage(appId, conversationId, file) {
|
|
178
|
-
return await _a.mediaCallback('Media.uploadImage', [appId, conversationId], file);
|
|
179
|
-
},
|
|
180
|
-
};
|
|
181
95
|
this.TCC = {
|
|
182
96
|
/**
|
|
183
97
|
* Get list of all models available to you
|
|
184
98
|
*
|
|
185
|
-
* @param {
|
|
99
|
+
* @param {}
|
|
186
100
|
* @returns {Promise<rpcResponseType<{ id: string; name: string; type: string; provider: string }[]>>}
|
|
187
101
|
*/
|
|
188
|
-
async get_models(
|
|
189
|
-
return await _a.apiCallback('TCC.get_models'
|
|
102
|
+
async get_models() {
|
|
103
|
+
return await _a.apiCallback('TCC.get_models');
|
|
190
104
|
},
|
|
191
105
|
/**
|
|
192
106
|
* Get current model for a conversation
|
|
193
107
|
*
|
|
194
|
-
* @param {
|
|
108
|
+
* @param {}
|
|
195
109
|
* @returns {Promise<rpcResponseType<{ emote: string; nlp_model: string; assistant: string }>>}
|
|
196
110
|
*/
|
|
197
|
-
async conversation_stats(
|
|
198
|
-
return await _a.apiCallback('TCC.conversation_stats'
|
|
111
|
+
async conversation_stats() {
|
|
112
|
+
return await _a.apiCallback('TCC.conversation_stats');
|
|
199
113
|
},
|
|
200
114
|
/**
|
|
201
115
|
* Changes the model for a conversation, use with caution, may discontinue chat if model is not compatible
|
|
202
116
|
*
|
|
203
|
-
* @param {
|
|
117
|
+
* @param {model_id: string, type: string}
|
|
204
118
|
* @returns {Promise<rpcResponseType<any>>}
|
|
205
119
|
*/
|
|
206
|
-
async change_to_model(
|
|
207
|
-
return await _a.apiCallback('TCC.change_to_model', [
|
|
120
|
+
async change_to_model(model_id, type) {
|
|
121
|
+
return await _a.apiCallback('TCC.change_to_model', [model_id, type]);
|
|
208
122
|
},
|
|
209
123
|
/**
|
|
210
124
|
* Trigger the ai to act based on a trigger message
|
|
211
125
|
*
|
|
212
|
-
* @param {
|
|
213
|
-
* @returns {Promise<rpcResponseType<any>>}
|
|
214
|
-
*/
|
|
215
|
-
async trigger(conversation_id, message, eta_seconds) {
|
|
216
|
-
return await _a.apiCallback('TCC.trigger', [conversation_id, message, eta_seconds]);
|
|
217
|
-
},
|
|
218
|
-
/**
|
|
219
|
-
* This function is used to invoke the llm with a description and instruction
|
|
220
|
-
*
|
|
221
|
-
* @param {conversation_id: string, input: Partial<{ description: string, instruction: string, construct_id: string }> }
|
|
126
|
+
* @param {message: string, eta_seconds: number}
|
|
222
127
|
* @returns {Promise<rpcResponseType<any>>}
|
|
223
128
|
*/
|
|
224
|
-
async
|
|
225
|
-
return await _a.apiCallback('TCC.
|
|
129
|
+
async trigger(message, eta_seconds) {
|
|
130
|
+
return await _a.apiCallback('TCC.trigger', [message, eta_seconds]);
|
|
226
131
|
},
|
|
227
132
|
/**
|
|
228
133
|
* specifies a selected data on the client for the ai to work with
|
|
229
134
|
*
|
|
230
|
-
* @param {
|
|
135
|
+
* @param {data: string}
|
|
231
136
|
* @returns {Promise<rpcResponseType<any>>}
|
|
232
137
|
*/
|
|
233
|
-
async select_context(
|
|
234
|
-
return await _a.apiCallback('TCC.select_context', [
|
|
138
|
+
async select_context(data) {
|
|
139
|
+
return await _a.apiCallback('TCC.select_context', [data]);
|
|
235
140
|
},
|
|
236
141
|
};
|
|
237
142
|
_a.token_cb = token_cb;
|
package/dist/ttc_server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ttc_server.js","sourceRoot":"","sources":["../src/ttc_server.ts"],"names":[],"mappings":";;;;AACA,uDAA8C;AAU9C,IAAI,GAAG,GAAG,EAAE,CAAC;AAEN,MAAM,KAAK,GAAG,GAAG,EAAE;IAEtB,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IAEpB,MAAM,GAAG,GAAG,aAAa,CAAC;IAC1B,IAAI;QACA,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACZ,GAAG,GAAG,IAAI,CAAC;KACd;IACD,IAAI,CAAC,GAAG,EAAE;QACN,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,CAA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