@steedos/ai 3.0.0-beta.133 → 3.0.0-beta.135
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 +29 -0
- package/dist/ai/ai.controller.d.ts +1 -0
- package/dist/ai/ai.controller.js +9 -0
- package/dist/ai/ai.controller.js.map +1 -1
- package/dist/ai/ai.service.d.ts +3 -0
- package/dist/ai/ai.service.js +18 -1
- package/dist/ai/ai.service.js.map +1 -1
- package/main/default/data/ai_chatbots.data.json +17 -0
- package/main/default/objects/ai_chatbots/fields/model.field.yml +20 -2
- package/main/default/pages/ai_chatbots_detail.page.amis.json +393 -0
- package/main/default/pages/ai_chatbots_detail.page.yml +13 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1 +1,30 @@
|
|
|
1
1
|
# Builder6 AI
|
|
2
|
+
|
|
3
|
+
系统使用 OpenAI SDK 进行 AI 能力的调用。
|
|
4
|
+
|
|
5
|
+
需配置如下环境变量:
|
|
6
|
+
|
|
7
|
+
- OPENAI_API_KEY: OpenAI API 密钥
|
|
8
|
+
- OPENAI_BASE_URL: OpenAI API 基础 URL
|
|
9
|
+
|
|
10
|
+
## 使用 OpenAI 官方 API
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
OPENAI_API_KEY=your_openai_api_key
|
|
14
|
+
OPENAI_BASE_URL=https://api.openai.com/v1
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## 使用阿里云
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
OPENAI_API_KEY=your_aliyun_api_key
|
|
21
|
+
OPENAI_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 使用 Vercel AI Gateway
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
AI_GATEWAY_API_KEY=your_vercel_ai_gateway_api_key
|
|
28
|
+
OPENAI_API_KEY=your_vercel_ai_gateway_api_key
|
|
29
|
+
OPENAI_BASE_URL=https://ai-gateway.vercel.sh/v1
|
|
30
|
+
```
|
|
@@ -8,4 +8,5 @@ export declare class AiController {
|
|
|
8
8
|
constructor(aiService: AiService, mongodbService: MongodbService);
|
|
9
9
|
streamText(chatbotId: string, messages: UIMessage[], res: Response): Promise<void>;
|
|
10
10
|
chatStreamText(chatId: string, messages: UIMessage[], res: Response): Promise<void>;
|
|
11
|
+
getModels(): Promise<any>;
|
|
11
12
|
}
|
package/dist/ai/ai.controller.js
CHANGED
|
@@ -68,6 +68,9 @@ let AiController = class AiController {
|
|
|
68
68
|
});
|
|
69
69
|
return result.pipeUIMessageStreamToResponse(res);
|
|
70
70
|
}
|
|
71
|
+
async getModels() {
|
|
72
|
+
return this.aiService.getAvailableModels();
|
|
73
|
+
}
|
|
71
74
|
};
|
|
72
75
|
exports.AiController = AiController;
|
|
73
76
|
__decorate([
|
|
@@ -88,6 +91,12 @@ __decorate([
|
|
|
88
91
|
__metadata("design:paramtypes", [String, Array, Object]),
|
|
89
92
|
__metadata("design:returntype", Promise)
|
|
90
93
|
], AiController.prototype, "chatStreamText", null);
|
|
94
|
+
__decorate([
|
|
95
|
+
(0, common_1.Get)("models"),
|
|
96
|
+
__metadata("design:type", Function),
|
|
97
|
+
__metadata("design:paramtypes", []),
|
|
98
|
+
__metadata("design:returntype", Promise)
|
|
99
|
+
], AiController.prototype, "getModels", null);
|
|
91
100
|
exports.AiController = AiController = __decorate([
|
|
92
101
|
(0, swagger_1.ApiTags)("AI"),
|
|
93
102
|
(0, common_1.Controller)("/api/v6/ai"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.controller.js","sourceRoot":"","sources":["../../src/ai/ai.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"ai.controller.js","sourceRoot":"","sources":["../../src/ai/ai.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAw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iBAAO,EAAC,IAAI,CAAC;IACb,IAAA,mBAAU,EAAC,YAAY,CAAC;qCAGO,sBAAS;QACJ,qBAAc;GAHtC,YAAY,CAmExB"}
|
package/dist/ai/ai.service.d.ts
CHANGED
package/dist/ai/ai.service.js
CHANGED
|
@@ -5,13 +5,30 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
8
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
15
|
exports.AiService = void 0;
|
|
10
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
+
const openai_1 = __importDefault(require("openai"));
|
|
11
18
|
let AiService = class AiService {
|
|
19
|
+
constructor() {
|
|
20
|
+
if (process.env.OPENAI_API_KEY) {
|
|
21
|
+
this.openai = new openai_1.default({ apiKey: process.env.OPENAI_API_KEY });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async getAvailableModels() {
|
|
25
|
+
const models = await this.openai?.models.list();
|
|
26
|
+
return models?.data;
|
|
27
|
+
}
|
|
12
28
|
};
|
|
13
29
|
exports.AiService = AiService;
|
|
14
30
|
exports.AiService = AiService = __decorate([
|
|
15
|
-
(0, common_1.Injectable)()
|
|
31
|
+
(0, common_1.Injectable)(),
|
|
32
|
+
__metadata("design:paramtypes", [])
|
|
16
33
|
], AiService);
|
|
17
34
|
//# sourceMappingURL=ai.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.service.js","sourceRoot":"","sources":["../../src/ai/ai.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ai.service.js","sourceRoot":"","sources":["../../src/ai/ai.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAMA,2CAA4C;AAE5C,oDAA4B;AAGrB,IAAM,SAAS,GAAf,MAAM,SAAS;IAGpB;QACE,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,gBAAM,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IACD,KAAK,CAAC,kBAAkB;QAEtB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAGhD,OAAO,MAAM,EAAE,IAAI,CAAC;IACtB,CAAC;CACF,CAAA;AAfY,8BAAS;oBAAT,SAAS;IADrB,IAAA,mBAAU,GAAE;;GACA,SAAS,CAerB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[{
|
|
2
|
+
"_id": "${space_id}_functions_agent",
|
|
3
|
+
"defaultMessage": "我今天能帮您什么?",
|
|
4
|
+
"defaultMessageMode": "static",
|
|
5
|
+
"defaultPrompt": "打个招呼,告诉我你能做什么。",
|
|
6
|
+
"directive": "You are helping users develop on the Steedos, which is a low-code development platform similar to Salesforce.\n\n**Instructions:**\n\n- When given a user request, write only the function body of a Steedos function to fulfill the request.\n- If the request involves querying or updating data of a specific object, first prompt the user to provide the object's `apiName` so you can retrieve the relevant object definition.\n- In your function, you have access to the following parameter:\n - `db`: an instance of the native MongoDB Node.js driver, which you can use to query and update the database.\n\n**Example:**\n```javascript\nconst data = await db.collection('space_users').find().toArray();\nreturn data;\n```\n\nWait for the user's request. If any data object is involved, ask for the `apiName`. Then, provide only the function body as your response.\n",
|
|
7
|
+
"disclosureText": "这是一个自动化的聊天助手回复。[了解更多](https://builder6.com)",
|
|
8
|
+
"locked": false,
|
|
9
|
+
"owner": "68f750532c9f3e739fb3096a",
|
|
10
|
+
"placeholder": "问我任何事情",
|
|
11
|
+
"temperature": 0.7,
|
|
12
|
+
"label": "Steedos Functions Agent",
|
|
13
|
+
"name": "functions_agent",
|
|
14
|
+
"model": "openai/gpt-5",
|
|
15
|
+
"listViewId": null,
|
|
16
|
+
"displayAs": null
|
|
17
|
+
}]
|
|
@@ -7,5 +7,23 @@ label: Model
|
|
|
7
7
|
required: true
|
|
8
8
|
searchable: true
|
|
9
9
|
sort_no: 20
|
|
10
|
-
type:
|
|
11
|
-
|
|
10
|
+
type: select
|
|
11
|
+
amis:
|
|
12
|
+
searchable: true,
|
|
13
|
+
multiple: false
|
|
14
|
+
source:
|
|
15
|
+
url: ${context.rootUrl}/api/v6/ai/models
|
|
16
|
+
method: get
|
|
17
|
+
requestAdaptor: ""
|
|
18
|
+
adaptor: |
|
|
19
|
+
return {
|
|
20
|
+
status: 0,
|
|
21
|
+
msg: '',
|
|
22
|
+
data: {
|
|
23
|
+
options: payload.map(item => ({
|
|
24
|
+
label: item.id,
|
|
25
|
+
value: item.id
|
|
26
|
+
}))
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
messages: {}
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "page",
|
|
3
|
+
"title": "Welcome to Steedos",
|
|
4
|
+
"body": [
|
|
5
|
+
{
|
|
6
|
+
"type": "flex",
|
|
7
|
+
"id": "u:1ba760c11831",
|
|
8
|
+
"items": [
|
|
9
|
+
{
|
|
10
|
+
"type": "container",
|
|
11
|
+
"body": [
|
|
12
|
+
{
|
|
13
|
+
"id": "u:3638656e8e37",
|
|
14
|
+
"type": "steedos-object-form",
|
|
15
|
+
"label": "对象表单",
|
|
16
|
+
"objectApiName": "ai_chatbots",
|
|
17
|
+
"recordId": "${recordId}",
|
|
18
|
+
"appId": "${appId}",
|
|
19
|
+
"mode": "edit",
|
|
20
|
+
"className": "mb-4",
|
|
21
|
+
"enableInitApi": false,
|
|
22
|
+
"form": {
|
|
23
|
+
"id": "u:2efee5835bf6",
|
|
24
|
+
"actions": [
|
|
25
|
+
{
|
|
26
|
+
"type": "submit",
|
|
27
|
+
"label": "保存",
|
|
28
|
+
"primary": true,
|
|
29
|
+
"disabled": true,
|
|
30
|
+
"id": "u:66a9cecdc4bb"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"feat": "Insert",
|
|
34
|
+
"dsType": "api",
|
|
35
|
+
"submitOnChange": false,
|
|
36
|
+
"onEvent": {
|
|
37
|
+
"submitSucc": {
|
|
38
|
+
"weight": 0,
|
|
39
|
+
"actions": [
|
|
40
|
+
{
|
|
41
|
+
"actionType": "reload"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"componentId": "u:66a9cecdc4bb",
|
|
45
|
+
"ignoreError": false,
|
|
46
|
+
"actionType": "disabled"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"actionType": "wait",
|
|
50
|
+
"args": {
|
|
51
|
+
"time": 2000
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"actionType": "reload",
|
|
56
|
+
"componentId": "u:d0cb32b561f2"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"change": {
|
|
61
|
+
"actions": [
|
|
62
|
+
{
|
|
63
|
+
"componentId": "u:66a9cecdc4bb",
|
|
64
|
+
"ignoreError": false,
|
|
65
|
+
"actionType": "enabled"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"debug": false,
|
|
71
|
+
"className": "",
|
|
72
|
+
"panelClassName": " shadow border-none p-4",
|
|
73
|
+
"mode": "normal"
|
|
74
|
+
},
|
|
75
|
+
"height": "100%"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"size": "none",
|
|
79
|
+
"style": {
|
|
80
|
+
"position": "static",
|
|
81
|
+
"display": "block",
|
|
82
|
+
"flex": "0 0 150px",
|
|
83
|
+
"flexBasis": "650px"
|
|
84
|
+
},
|
|
85
|
+
"wrapperBody": false,
|
|
86
|
+
"isFixedHeight": false,
|
|
87
|
+
"isFixedWidth": false,
|
|
88
|
+
"id": "u:05614dd5e285"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "container",
|
|
92
|
+
"className": "shadow rounded bg-white",
|
|
93
|
+
"body": [
|
|
94
|
+
{
|
|
95
|
+
"id": "u:d9c07905e0e5",
|
|
96
|
+
"type": "container",
|
|
97
|
+
"body": [
|
|
98
|
+
{
|
|
99
|
+
"type": "container",
|
|
100
|
+
"body": [
|
|
101
|
+
{
|
|
102
|
+
"type": "button-group",
|
|
103
|
+
"id": "u:77ff1aca25d2",
|
|
104
|
+
"className": "float-end",
|
|
105
|
+
"buttons": [
|
|
106
|
+
{
|
|
107
|
+
"type": "button",
|
|
108
|
+
"label": "共享",
|
|
109
|
+
"onEvent": {
|
|
110
|
+
"click": {
|
|
111
|
+
"actions": [
|
|
112
|
+
{
|
|
113
|
+
"ignoreError": false,
|
|
114
|
+
"actionType": "dialog",
|
|
115
|
+
"dialog": {
|
|
116
|
+
"type": "dialog",
|
|
117
|
+
"title": "",
|
|
118
|
+
"body": [
|
|
119
|
+
{
|
|
120
|
+
"type": "tpl",
|
|
121
|
+
"tpl": "<p>Upgrade Plan</p>",
|
|
122
|
+
"id": "u:5b4399733b7e"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"id": "u:edc8fd90ad49",
|
|
126
|
+
"actions": [
|
|
127
|
+
{
|
|
128
|
+
"type": "button",
|
|
129
|
+
"actionType": "cancel",
|
|
130
|
+
"label": "取消",
|
|
131
|
+
"id": "u:562235bb4625"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"type": "button",
|
|
135
|
+
"actionType": "confirm",
|
|
136
|
+
"label": "确定",
|
|
137
|
+
"primary": true,
|
|
138
|
+
"id": "u:0458a9c5d81b"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"showCloseButton": true,
|
|
142
|
+
"closeOnOutside": false,
|
|
143
|
+
"closeOnEsc": false,
|
|
144
|
+
"showErrorMsg": true,
|
|
145
|
+
"showLoading": true,
|
|
146
|
+
"draggable": false
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"id": "u:9b13e1cf1b23"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"type": "button",
|
|
156
|
+
"label": "嵌入",
|
|
157
|
+
"onEvent": {
|
|
158
|
+
"click": {
|
|
159
|
+
"actions": [
|
|
160
|
+
{
|
|
161
|
+
"ignoreError": false,
|
|
162
|
+
"actionType": "dialog",
|
|
163
|
+
"dialog": {
|
|
164
|
+
"type": "dialog",
|
|
165
|
+
"title": "",
|
|
166
|
+
"body": [
|
|
167
|
+
{
|
|
168
|
+
"type": "tpl",
|
|
169
|
+
"tpl": "<p>Upgrade Plan</p>",
|
|
170
|
+
"id": "u:5b4399733b7e"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"id": "u:edc8fd90ad49",
|
|
174
|
+
"actions": [
|
|
175
|
+
{
|
|
176
|
+
"type": "button",
|
|
177
|
+
"actionType": "cancel",
|
|
178
|
+
"label": "取消",
|
|
179
|
+
"id": "u:562235bb4625"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"type": "button",
|
|
183
|
+
"actionType": "confirm",
|
|
184
|
+
"label": "确定",
|
|
185
|
+
"primary": true,
|
|
186
|
+
"id": "u:0458a9c5d81b"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"showCloseButton": true,
|
|
190
|
+
"closeOnOutside": false,
|
|
191
|
+
"closeOnEsc": false,
|
|
192
|
+
"showErrorMsg": true,
|
|
193
|
+
"showLoading": true,
|
|
194
|
+
"draggable": false
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"id": "u:2ac0c15683f3"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"vertical": false,
|
|
204
|
+
"tiled": false,
|
|
205
|
+
"visible": false
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"type": "button",
|
|
209
|
+
"label": "预览",
|
|
210
|
+
"onEvent": {
|
|
211
|
+
"click": {
|
|
212
|
+
"actions": [
|
|
213
|
+
{
|
|
214
|
+
"ignoreError": false,
|
|
215
|
+
"actionType": "url",
|
|
216
|
+
"args": {
|
|
217
|
+
"url": "/ai/chatbot/${recordId}",
|
|
218
|
+
"blank": true
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"id": "u:617338ddfe5b",
|
|
225
|
+
"className": "mr-2",
|
|
226
|
+
"level": "primary"
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"style": {
|
|
230
|
+
"position": "relative",
|
|
231
|
+
"display": "flex",
|
|
232
|
+
"inset": "auto",
|
|
233
|
+
"flexWrap": "nowrap",
|
|
234
|
+
"flexDirection": "row-reverse",
|
|
235
|
+
"alignItems": "baseline",
|
|
236
|
+
"justifyContent": "space-between",
|
|
237
|
+
"flex": "0 0 auto"
|
|
238
|
+
},
|
|
239
|
+
"size": "none",
|
|
240
|
+
"wrapperBody": false,
|
|
241
|
+
"id": "u:1b82cb69d311",
|
|
242
|
+
"isFixedHeight": false
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"type": "button",
|
|
246
|
+
"id": "u:284e51032f92",
|
|
247
|
+
"label": "刷新",
|
|
248
|
+
"onEvent": {
|
|
249
|
+
"click": {
|
|
250
|
+
"actions": [
|
|
251
|
+
{
|
|
252
|
+
"actionType": "reload",
|
|
253
|
+
"componentId": "u:d0cb32b561f2"
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"block": false,
|
|
259
|
+
"size": "md",
|
|
260
|
+
"level": "link",
|
|
261
|
+
"className": "float-start",
|
|
262
|
+
"icon": "fa fa-refresh"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
"style": {
|
|
266
|
+
"position": "static",
|
|
267
|
+
"display": "flex",
|
|
268
|
+
"flexWrap": "nowrap",
|
|
269
|
+
"flexDirection": "row-reverse",
|
|
270
|
+
"alignItems": "center",
|
|
271
|
+
"justifyContent": "space-between",
|
|
272
|
+
"height": "46px",
|
|
273
|
+
"overflowY": "visible"
|
|
274
|
+
},
|
|
275
|
+
"size": "none",
|
|
276
|
+
"wrapperBody": false,
|
|
277
|
+
"isFixedHeight": true,
|
|
278
|
+
"isFixedWidth": false,
|
|
279
|
+
"themeCss": {
|
|
280
|
+
"baseControlClassName": {
|
|
281
|
+
"background:default": "#ffffff"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"className": "mx-2 p-0"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"id": "u:d0cb32b561f2",
|
|
288
|
+
"type": "iframe",
|
|
289
|
+
"src": "/ai/chatbot/${recordId}",
|
|
290
|
+
"className": "bg-white m-0 sm:rounded-b-lg shadow-none border-t antd-Panel--form chatbots-chat",
|
|
291
|
+
"editorState": "default",
|
|
292
|
+
"height": "calc(100% - 48px)"
|
|
293
|
+
}
|
|
294
|
+
],
|
|
295
|
+
"size": "none",
|
|
296
|
+
"style": {
|
|
297
|
+
"position": "static",
|
|
298
|
+
"display": "block",
|
|
299
|
+
"flex": "1 1 auto",
|
|
300
|
+
"flexGrow": 2,
|
|
301
|
+
"flexBasis": "0px"
|
|
302
|
+
},
|
|
303
|
+
"wrapperBody": false,
|
|
304
|
+
"isFixedHeight": false,
|
|
305
|
+
"isFixedWidth": false,
|
|
306
|
+
"id": "u:582091f4824e"
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"style": {
|
|
310
|
+
"position": "relative",
|
|
311
|
+
"rowGap": "10px",
|
|
312
|
+
"columnGap": "10px"
|
|
313
|
+
},
|
|
314
|
+
"isFixedHeight": false,
|
|
315
|
+
"isFixedWidth": false,
|
|
316
|
+
"className": "steedos-chatbot-page"
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
"regions": [
|
|
320
|
+
"body"
|
|
321
|
+
],
|
|
322
|
+
"data": {
|
|
323
|
+
},
|
|
324
|
+
"id": "page_b6_chatbots_record_detail",
|
|
325
|
+
"name": "page_b6_chatbots_record_detail",
|
|
326
|
+
"objectApiName": "${objectName}",
|
|
327
|
+
"bodyClassName": "",
|
|
328
|
+
"className": "object-detail-page steedos-record-content overflow-y-auto p-0 m-0 flex-1 h-full",
|
|
329
|
+
"asideResizor": false,
|
|
330
|
+
"editorState": "default",
|
|
331
|
+
"pullRefresh": {
|
|
332
|
+
"disabled": true
|
|
333
|
+
},
|
|
334
|
+
"css": {
|
|
335
|
+
".chatbots-chat": {
|
|
336
|
+
"height": "calc(100 - 45px) !important"
|
|
337
|
+
},
|
|
338
|
+
".antd-Card-avtar": {
|
|
339
|
+
"display": "flex",
|
|
340
|
+
"justify-content": "center",
|
|
341
|
+
"align-items": "center",
|
|
342
|
+
"border-radius": "unset",
|
|
343
|
+
"height": "64px",
|
|
344
|
+
"border-width": "2px"
|
|
345
|
+
},
|
|
346
|
+
".antd-Card-img": {
|
|
347
|
+
"height": "auto !important",
|
|
348
|
+
"border-radius": "unset !important",
|
|
349
|
+
"width": "30px !important"
|
|
350
|
+
},
|
|
351
|
+
".antd-Card-subTitle": {
|
|
352
|
+
"color": "rgba(0, 0, 0, 0.85)"
|
|
353
|
+
},
|
|
354
|
+
".add-knowledge-source-form .antd-ListControl-item":{
|
|
355
|
+
"display": "inline-flex",
|
|
356
|
+
"justify-content": "center",
|
|
357
|
+
"align-items": "center",
|
|
358
|
+
"width": "120px",
|
|
359
|
+
"height": "120px"
|
|
360
|
+
},
|
|
361
|
+
".steedos-object-form":{
|
|
362
|
+
"margin-bottom": "0px !important",
|
|
363
|
+
"height": "100%"
|
|
364
|
+
},
|
|
365
|
+
".steedos-object-form>.antd-Panel":{
|
|
366
|
+
"margin-bottom": "0px !important",
|
|
367
|
+
"padding-bottom": "0px !important",
|
|
368
|
+
"height": "100%"
|
|
369
|
+
},
|
|
370
|
+
".steedos-object-form>.antd-Panel>div":{
|
|
371
|
+
"height": "calc(100% - 50px)"
|
|
372
|
+
},
|
|
373
|
+
".antd-Panel-footerWrap": {
|
|
374
|
+
"height": "unset !important"
|
|
375
|
+
},
|
|
376
|
+
".steedos-amis-form":{
|
|
377
|
+
"height": "100%"
|
|
378
|
+
},
|
|
379
|
+
".steedos-amis-form>.antd-Wrapper":{
|
|
380
|
+
"height": "100%"
|
|
381
|
+
},
|
|
382
|
+
".steedos-amis-form>.antd-Wrapper>.antd-Tabs":{
|
|
383
|
+
"height": "100%"
|
|
384
|
+
},
|
|
385
|
+
".antd-Tabs-content":{
|
|
386
|
+
"overflow": "auto",
|
|
387
|
+
"height": "calc(100% - 50px)"
|
|
388
|
+
},
|
|
389
|
+
".steedos-chatbot-page": {
|
|
390
|
+
"height": "100% !important"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name: ai_chatbots_detail
|
|
2
|
+
is_active: true
|
|
3
|
+
label: ai_chatbots detail
|
|
4
|
+
locked: false
|
|
5
|
+
object_name: ai_chatbots
|
|
6
|
+
pageAssignments:
|
|
7
|
+
- type: orgDefault
|
|
8
|
+
page: ai_chatbots_detail
|
|
9
|
+
desktop: true
|
|
10
|
+
mobile: true
|
|
11
|
+
render_engine: amis
|
|
12
|
+
type: record
|
|
13
|
+
widgets: []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/ai",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.135",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@ai-sdk/openai": "^2.0.52",
|
|
18
|
-
"@steedos/objectql": "3.0.0-beta.
|
|
19
|
-
"ai": "^5.0.71"
|
|
18
|
+
"@steedos/objectql": "3.0.0-beta.135",
|
|
19
|
+
"ai": "^5.0.71",
|
|
20
|
+
"openai": "^6.8.1"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|
|
22
23
|
"@builder6/core": "^3.1.0-alpha.0",
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"publishConfig": {
|
|
29
30
|
"access": "public"
|
|
30
31
|
},
|
|
31
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "c145c558cece638878fd1c0688326fc20c7529f5",
|
|
32
33
|
"devDependencies": {
|
|
33
34
|
"@types/node": "^18.0.3",
|
|
34
35
|
"typescript": "5.7.3"
|