@xuda.io/ai_module 1.1.4805 → 1.1.4806

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.
Files changed (2) hide show
  1. package/index.mjs +0 -650
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1069,656 +1069,6 @@ const check_studio_doc_tool = tool({
1069
1069
  },
1070
1070
  });
1071
1071
 
1072
- // export const submit_agentic_studio_chat_gpt_prompt = async function (req) {
1073
- // try {
1074
- // const { user_prompt, object_unit = 'app', uid, app_id } = req;
1075
- // // const model = 'ft:gpt-4o-2024-08-06:xuda-io:vps-hosting-plans:CDaxQiXo'; // 'gpt-4o'; //'gpt-4.1'; //
1076
-
1077
- // const app_obj = await get_app_obj(app_id);
1078
-
1079
- // // let check_results = {};
1080
- // const auth = async function () {
1081
- // if (app_obj.app_uId !== uid) {
1082
- // const db_team = get_xuda_couch('xuda_team');
1083
- // let master_auth_users = await db_team.view('xuda', 'user_active_shares', {
1084
- // key: [uid, app_id],
1085
- // });
1086
- // if (!master_auth_users.rows.includes(uid)) {
1087
- // throw new Error('user unauthorized');
1088
- // }
1089
- // }
1090
- // };
1091
-
1092
- // await auth();
1093
-
1094
- // const userName = await get_user_name(uid);
1095
-
1096
- // const get_zod_unit_schema = function (type) {
1097
- // init(app_obj, {}, _, true, null, null, UglifyJS, JSON5, _conf, false, z);
1098
- // const schema = get_zod_schema(type);
1099
- // const jsonSchema = zodToJsonSchema(schema);
1100
- // return JSON.stringify(jsonSchema, null, 2);
1101
- // };
1102
-
1103
- // const get_app_instructions = function (object_unit) {
1104
- // return `
1105
- // ### context ###
1106
- // uid=${uid}
1107
- // app_id=${app_id}
1108
-
1109
- // ### Persona & Role ###
1110
- // - You are a helpful and professional technical assistant named ${object_unit} builder.
1111
-
1112
- // ### Tasks ###
1113
-
1114
- // Your job is to assist the user with creating a ${user_prompt} that includes all tasks needed.
1115
-
1116
- // ### workflow ###
1117
-
1118
- // Steps:
1119
- // 1. list all the tables needed for the task.
1120
- // 2. prefix each table with the subject of the ${user_prompt} (e.g: CRM - Tasks).
1121
- // 3. iterate the table list and build tables array using the Table builder tool, add the Table builder tool results and the table name in array RESULTS_ARR.
1122
-
1123
- // ### Additional information ###
1124
-
1125
- // ### Output ###
1126
- // return the RESULTS_ARR Array.
1127
-
1128
- // ### Examples ###
1129
-
1130
- // `;
1131
- // };
1132
-
1133
- // const get_table_instructions = function (object_unit) {
1134
- // return `
1135
- // ### context ###
1136
- // uid=${uid}
1137
- // app_id=${app_id}
1138
-
1139
- // ### Persona & Role ###
1140
- // - You are a helpful and professional technical assistant named ${object_unit} builder.
1141
-
1142
- // ### Tasks ###
1143
-
1144
- // Your job is to assist the user with creating a ${user_prompt} that includes a full set of fields according to the provided ${object_unit} structure.
1145
-
1146
- // - You must include all relevant fields a typical ${user_prompt} would require
1147
- // - Add **multiple entries** in the "tableFields" array as needed to fully represent the structure.
1148
- // - Follow the format and conventions shown in the ${object_unit} structure example.
1149
- // - use uid for "createdByUid" and "checkedInUserId"
1150
-
1151
- // ### workflow ###
1152
-
1153
- // Steps:
1154
- // 1. Use create_initial_studio_doc_tool to create the initial doc assign the return result in "doc" variable.
1155
-
1156
- // 3. Use check_studio_doc_tool to check the ${object_unit} send the ${object_unit} as the doc, fix the issues if needed. if the check fail for 3 times the throw error, skip **Save Doc** tool if errors exist
1157
- // 4. Use **Save Doc** tool to save the ${object_unit} doc and update the result in save_result variable,NEVER save if errors exist after check_studio_doc_tool
1158
-
1159
- // ### Output ###
1160
- // if success: {code:1,data:save_result}
1161
- // if fail: {code:-1,data:error}
1162
-
1163
- // ### EXAMPLE
1164
-
1165
- // {
1166
- // "_id": "5b1_tbl_47f0ac6059ca",
1167
- // "app_id": "prj3937cb6f9a31c8c7dea25055bba845b1",
1168
- // "stat": 3,
1169
- // "docType": "studio",
1170
- // "docDate": 1714916369797,
1171
- // "ts": 1762953659001,
1172
- // "order_ts": 1714916369797,
1173
- // "studio_meta": {
1174
- // "created": 1714916369797,
1175
- // "createdByUid": "341cf2d32991a68e4d8aaba6c16e15cc",
1176
- // "checkedInUserId": "341cf2d32991a68e4d8aaba6c16e15cc",
1177
- // "checkedInUserName": "Ioshka Media",
1178
- // "parentId": "database",
1179
- // "savedByUid": "341cf2d32991a68e4d8aaba6c16e15cc"
1180
- // },
1181
- // "properties": {
1182
- // "menuType": "table",
1183
- // "menuName": "PT - Practice Table",
1184
- // "databaseSocket": "@xuda.io/xuda-dbs-plugin-xuda",
1185
- // "menuTitle": "PT - Practice Table"
1186
- // },
1187
- // "tableIndexes": [
1188
- // {
1189
- // "id": "76bbf201-997e-402c-b435-0649cc25d117",
1190
- // "data": {
1191
- // "name": "Primary_Index",
1192
- // "unique": true,
1193
- // "keys": [
1194
- // "PT_Id"
1195
- // ]
1196
- // },
1197
- // "props": {} <-- must appear even if empty
1198
- // },
1199
- // {
1200
- // "id": "89f1609d-de4e-4b61-9357-284b1261314c",
1201
- // "data": {
1202
- // "name": "Index_2",
1203
- // "unique": false,
1204
- // "keys": [
1205
- // "PT_Stat",
1206
- // "PT_Group_Id"
1207
- // ]
1208
- // },
1209
- // "props": {} <-- must appear even if empty
1210
- // }
1211
- // ],
1212
- // "tableFields": [
1213
- // {
1214
- // "id": "b41aa880-56ec-4029-a21b-60c89a52b62e",
1215
- // "data": {
1216
- // "field_id": "PT_Id"
1217
- // },
1218
- // "props": {
1219
- // "label":"Practice Id",
1220
- // "fieldType": "string",
1221
- // "mandatory": true
1222
- // }
1223
-
1224
- // },
1225
- // {
1226
- // "id": "8aec82db-35d9-4828-9fc7-49373c531cc3",
1227
- // "data": {
1228
- // "field_id": "PT_Type"
1229
- // },
1230
- // "props": {
1231
- // "label":"Practice Type",
1232
- // "fieldType": "string",
1233
- // "mandatory": true
1234
- // }
1235
-
1236
- // },
1237
- // {
1238
- // "id": "d27c56e5-faec-4a0a-ad42-7bf55f8c67b3",
1239
- // "data": {
1240
- // "field_id": "PT_Stat"
1241
- // },
1242
- // "props": {
1243
- // "label":"Practice Status",
1244
- // "fieldType": "number",
1245
- // "fieldComment": "1 = Draft\n2 = Private\n3 = Public\n4 = Deleted",
1246
- // "mandatory": true
1247
- // }
1248
-
1249
- // },
1250
- // {
1251
- // "id": "659fbfb3-7dcc-4ea0-b1e9-5dd9553a99fc",
1252
- // "data": {
1253
- // "field_id": "PT_Question"
1254
- // },
1255
- // "props": {
1256
- // "label":"Practice Question",
1257
- // "fieldType": "string"
1258
- // }
1259
-
1260
- // },
1261
- // {
1262
- // "id": "080c8ceb-5a51-437b-8ad1-9fc005c79011",
1263
- // "data": {
1264
- // "field_id": "PT_Options"
1265
- // },
1266
- // "props": {
1267
- // "label":"Practice Options",
1268
- // "fieldType": "array"
1269
- // }
1270
-
1271
- // },
1272
- // {
1273
- // "id": "72c04aac-b3e7-4e7a-8a74-31075de3dbec",
1274
- // "data": {
1275
- // "field_id": "PT_Answer"
1276
- // },
1277
- // "props": {
1278
- // "label":"Practice Answer",
1279
- // "fieldType": "string"
1280
- // }
1281
-
1282
- // },
1283
- // {
1284
- // "id": "e37b08c6-f340-425a-bf01-809b28a486d3",
1285
- // "data": {
1286
- // "field_id": "PT_Matching_Answer"
1287
- // },
1288
- // "props": {
1289
- // "label":"Practice Matching Answer",
1290
- // "fieldType": "object"
1291
- // },
1292
-
1293
- // },
1294
- // {
1295
- // "id": "8ca4ace1-2010-45be-b7aa-2672ce0e6fea",
1296
- // "data": {
1297
- // "field_id": "PT_Group_Id"
1298
- // },
1299
- // "props": {
1300
- // "label":"Practice Group Id",
1301
- // "fieldType": "string"
1302
- // }
1303
-
1304
- // },
1305
- // {
1306
- // "id": "ae749c6d-1f39-4750-b79e-f016d50b8a11",
1307
- // "data": {
1308
- // "field_id": "PT_Difficulty"
1309
- // },
1310
- // "props": {
1311
- // "label":"Practice Difficulty",
1312
- // "fieldType": "number"
1313
- // },
1314
-
1315
- // },
1316
- // {
1317
- // "id": "5c5e7cb5-feee-4bc7-9d94-0ccd04a5eb06",
1318
- // "data": {
1319
- // "field_id": "PT_Uid"
1320
- // },
1321
- // "props": {
1322
- // "label":"Practice User Id",
1323
- // "fieldType": "string"
1324
- // }
1325
-
1326
- // }
1327
- // ]
1328
- // }
1329
- // `;
1330
- // };
1331
-
1332
- // const get_folder_instructions = function (object_unit) {
1333
- // return `
1334
- // ### context ###
1335
- // uid=${uid}
1336
- // app_id=${app_id}
1337
-
1338
- // ### Persona & Role ###
1339
- // - You are a helpful and professional technical assistant named ${object_unit} builder.
1340
-
1341
- // ### Tasks ###
1342
-
1343
- // Your job is to assist the user with creating a ${user_prompt}.
1344
-
1345
- // - Follow the format and conventions shown in the ${object_unit} structure example.
1346
- // - use uid for "createdByUid" and "checkedInUserId"
1347
-
1348
- // ### workflow ###
1349
-
1350
- // Steps:
1351
- // 1. Use create_initial_studio_doc_tool to create the initial doc assign the return result in "doc" variable.
1352
- // 2. Get the ${object_unit} structure example from ### Structure and Examples ### section.
1353
- // 3. Build the ${object_unit} and validate against vs_68af4c84631c81919709268c2d0f1687
1354
- // 4. Use check_studio_doc_tool to check the ${object_unit} send the ${object_unit} as the doc, fix the issues if needed. if the check fail for 3 times the throw error, skip **Save Doc** tool if errors exist
1355
- // 5. Use **Save Doc** tool to save the ${object_unit} doc and update the result in save_result variable,NEVER save if errors exist after check_studio_doc_tool
1356
-
1357
- // ### Additional information ###
1358
- // ${studio_units[object_unit].short}
1359
-
1360
- // ### Output ###
1361
- // if success: {code:1,data:save_result}
1362
- // if fail: {code:-1,data:error}
1363
- // `;
1364
- // };
1365
-
1366
- // const get_component_instructions = function (object_unit) {
1367
- // return `
1368
- // ### context ###
1369
- // uid=${uid}
1370
- // app_id=${app_id}
1371
-
1372
- // ### Persona & Role ###
1373
- // - You are a helpful and professional technical assistant named ${object_unit} builder.
1374
-
1375
- // ### Tasks ###
1376
-
1377
- // Your job is to assist the user with creating a ${user_prompt} that includes modern ui using Tailwind
1378
-
1379
- // - You must include all relevant fields a typical ${user_prompt} would require
1380
-
1381
- // - Follow the format and conventions shown in the ${object_unit} structure example.
1382
- // - use uid for "createdByUid" and "checkedInUserId"
1383
-
1384
- // ### workflow ###
1385
-
1386
- // Steps:
1387
- // 1. Use create_initial_studio_doc_tool to create the initial doc assign the return result in "doc" variable.
1388
-
1389
- // 2. use ### Structure and Examples ### section to build the object
1390
- // 3. Use check_studio_doc_tool to check the ${object_unit} send the ${object_unit} as the doc, fix the issues if needed. if the check fail for 10 times the throw error, skip **Save Doc** tool if errors exist
1391
- // 4. Use **Save Doc** tool to save the ${object_unit} doc and update the result in save_result variable,NEVER save if errors exist after check_studio_doc_tool
1392
-
1393
- // ### Additional information ###
1394
- // ${studio_units[object_unit].short}
1395
-
1396
- // ### Structure and Examples ###
1397
-
1398
- // ${get_zod_unit_schema('component')}
1399
-
1400
- // ### Output ###
1401
- // if success: {code:1,data:save_result}
1402
- // if fail: {code:-1,data:error}
1403
- // `;
1404
- // };
1405
- // const get_get_data_instructions = function (object_unit) {
1406
- // return `
1407
- // ### context ###
1408
- // uid=${uid}
1409
- // app_id=${app_id}
1410
-
1411
- // ### Persona & Role ###
1412
- // - You are a helpful and professional technical assistant named ${object_unit} builder.
1413
-
1414
- // ### Tasks ###
1415
-
1416
- // Your job is to assist the user with creating a ${user_prompt}.
1417
-
1418
- // - You must include all relevant fields a typical ${user_prompt} would require
1419
-
1420
- // - Follow the format and conventions shown in the ${object_unit} structure example.
1421
- // - use uid for "createdByUid" and "checkedInUserId"
1422
-
1423
- // ### workflow ###
1424
-
1425
- // Steps:
1426
- // 1. Use create_initial_studio_doc_tool to create the initial doc assign the return result in "doc" variable.
1427
- // 2. Get the ${object_unit} structure example from ### Structure and Examples ### section.
1428
- // 3. Build the ${object_unit} and validate against vs_68af4c84631c81919709268c2d0f1687
1429
- // 4. Use check_studio_doc_tool to check the ${object_unit} send the ${object_unit} as the doc, fix the issues if needed. if the check fail for 10 times the throw error, skip **Save Doc** tool if errors exist
1430
- // 5. Use **Save Doc** tool to save the ${object_unit} doc and update the result in save_result variable,NEVER save if errors exist after check_studio_doc_tool
1431
-
1432
- // ### Additional information ###
1433
- // ${studio_units[object_unit].short}
1434
-
1435
- // ### Output ###
1436
- // if success: {code:1,data:save_result}
1437
- // if fail: {code:-1,data:error}
1438
- // `;
1439
- // };
1440
-
1441
- // const get_agents_as_a_tool = function (agent_list = []) {
1442
- // let _tools = [];
1443
- // for (const agent of agent_list) {
1444
- // const _agent = new Agent(studio_agents_obj[agent]);
1445
- // const tool = _agent.asTool({
1446
- // toolName: studio_agents_obj[agent].name,
1447
- // toolDescription: `Generate a ${agent} of the supplied text.`,
1448
- // });
1449
-
1450
- // _tools.push(tool);
1451
- // }
1452
-
1453
- // return _tools;
1454
- // };
1455
-
1456
- // let studio_agents_obj = {
1457
- // app: {
1458
- // name: 'App builder',
1459
- // instructions: get_app_instructions(),
1460
- // tools: [get_user_name_tool],
1461
- // model,
1462
- // modelSettings: {
1463
- // toolChoice: 'required', // ← this enables tool use
1464
- // responseFormat: {
1465
- // text: {
1466
- // format: {
1467
- // type: 'array', // or "markdown" if needed
1468
- // },
1469
- // },
1470
- // },
1471
- // outputType: z.array(z.object()),
1472
- // },
1473
- // },
1474
- // table: {
1475
- // name: 'Table builder',
1476
- // instructions: get_table_instructions('table'),
1477
- // tools: [get_user_name_tool, create_initial_studio_doc_tool, check_studio_doc_tool, save_doc_tool], //fileSearchTool('vs_68af4c84631c81919709268c2d0f1687'), fileSearchTool('vs_68af473196a88191afc6610fddfe4a62')
1478
- // model,
1479
- // modelSettings: {
1480
- // toolChoice: 'required', // ← this enables tool use
1481
- // responseFormat: {
1482
- // text: {
1483
- // format: {
1484
- // type: 'array', // or "markdown" if needed
1485
- // },
1486
- // },
1487
- // },
1488
- // outputType: z.array(
1489
- // z.object({
1490
- // _id: z.string(),
1491
- // stat: z.number(),
1492
- // docType: z.string(),
1493
- // docDate: z.number(),
1494
- // ts: z.number(),
1495
- // order_ts: z.number(),
1496
- // studio_meta: z.object({
1497
- // created: z.number(),
1498
- // createdByUid: z.string(),
1499
- // checkedInUserId: z.string(),
1500
- // savedByUid: z.string(),
1501
- // checkedInUserName: z.string(),
1502
- // parentId: z.string(),
1503
- // source: z.string(),
1504
- // }),
1505
- // properties: z.object({
1506
- // menuName: z.string(),
1507
- // menuType: z.string(),
1508
- // databaseSocket: z.string(),
1509
- // }),
1510
- // tableIndexes: z.array(
1511
- // z.object({
1512
- // id: z.string(),
1513
- // data: z.object({
1514
- // name: z.string(),
1515
- // unique: z.boolean(),
1516
- // keys: z.array(z.string()),
1517
- // }),
1518
- // props: z.object({}),
1519
- // }),
1520
- // ),
1521
- // tableFields: z.array(
1522
- // z.object({
1523
- // id: z.string(),
1524
- // data: z.object({
1525
- // field_id: z.string(),
1526
- // }),
1527
- // props: z.object({
1528
- // label: z.string(),
1529
- // fieldType: z.string(),
1530
- // }),
1531
- // }),
1532
- // ),
1533
- // }),
1534
- // ),
1535
- // },
1536
- // },
1537
- // folder: {
1538
- // name: 'Folder builder',
1539
- // instructions: get_folder_instructions('folder'),
1540
- // tools: [get_user_name_tool, create_initial_studio_doc_tool, check_studio_doc_tool, save_doc_tool], //fileSearchTool('vs_68af4c84631c81919709268c2d0f1687'), fileSearchTool('vs_68af44989e4881918fc8bf8e84c6ce03')
1541
- // model, //: 'gpt-4o'
1542
- // modelSettings: {
1543
- // toolChoice: 'required', // ← this enables tool use
1544
- // responseFormat: {
1545
- // text: {
1546
- // format: {
1547
- // type: 'array', // or "markdown" if needed
1548
- // },
1549
- // },
1550
- // },
1551
- // outputType: z.array(
1552
- // z.object({
1553
- // _id: z.string(),
1554
- // stat: z.number(),
1555
- // docType: z.string(),
1556
- // docDate: z.number(),
1557
- // ts: z.number(),
1558
- // order_ts: z.number(),
1559
- // studio_meta: z.object({
1560
- // created: z.number(),
1561
- // createdByUid: z.string(),
1562
- // checkedInUserId: z.string(),
1563
- // savedByUid: z.string(),
1564
- // checkedInUserName: z.string(),
1565
- // parentId: z.string(),
1566
- // source: z.string(),
1567
- // }),
1568
- // properties: z.object({
1569
- // menuName: z.string(),
1570
- // menuType: z.string(),
1571
- // databaseSocket: z.string(),
1572
- // }),
1573
- // }),
1574
- // ),
1575
- // },
1576
- // },
1577
- // component: {
1578
- // name: 'Component builder',
1579
- // instructions: get_component_instructions('component'),
1580
- // tools: [get_user_name_tool, create_initial_studio_doc_tool, check_studio_doc_tool, save_doc_tool], //, fileSearchTool('vs_68af48a65cf88191a48a0f530d7e3919')
1581
- // model,
1582
- // modelSettings: {
1583
- // toolChoice: 'required', // ← this enables tool use
1584
- // responseFormat: {
1585
- // text: {
1586
- // format: {
1587
- // type: 'array', // or "markdown" if needed
1588
- // },
1589
- // },
1590
- // },
1591
- // outputType: z.array(
1592
- // z.object({
1593
- // _id: z.string(),
1594
- // stat: z.number(),
1595
- // docType: z.string(),
1596
- // docDate: z.number(),
1597
- // ts: z.number(),
1598
- // order_ts: z.number(),
1599
- // studio_meta: z.object({
1600
- // created: z.number(),
1601
- // createdByUid: z.string(),
1602
- // checkedInUserId: z.string(),
1603
- // savedByUid: z.string(),
1604
- // checkedInUserName: z.string(),
1605
- // parentId: z.string(),
1606
- // source: z.string(),
1607
- // }),
1608
- // properties: z.object({
1609
- // menuName: z.string(),
1610
- // menuType: z.string(),
1611
- // databaseSocket: z.string(),
1612
- // }),
1613
- // progDataSource: z.object({}),
1614
- // progFields: z.array(z.object({})),
1615
- // progEvents: z.array(z.object({})),
1616
- // progUi: z.array(z.object({})),
1617
- // }),
1618
- // ),
1619
- // },
1620
- // },
1621
- // get_data: {
1622
- // name: 'Get data builder',
1623
- // instructions: get_get_data_instructions('get_data'),
1624
- // tools: [get_user_name_tool, create_initial_studio_doc_tool, check_studio_doc_tool, save_doc_tool], //fileSearchTool('vs_68af4c84631c81919709268c2d0f1687'), fileSearchTool('vs_68af530d4ba081919ca57eabb5ae117a')
1625
- // model,
1626
- // modelSettings: {
1627
- // toolChoice: 'required', // ← this enables tool use
1628
- // responseFormat: {
1629
- // text: {
1630
- // format: {
1631
- // type: 'array', // or "markdown" if needed
1632
- // },
1633
- // },
1634
- // },
1635
- // outputType: z.array(
1636
- // z.object({
1637
- // _id: z.string(),
1638
- // stat: z.number(),
1639
- // docType: z.string(),
1640
- // docDate: z.number(),
1641
- // ts: z.number(),
1642
- // order_ts: z.number(),
1643
- // studio_meta: z.object({
1644
- // created: z.number(),
1645
- // createdByUid: z.string(),
1646
- // checkedInUserId: z.string(),
1647
- // savedByUid: z.string(),
1648
- // checkedInUserName: z.string(),
1649
- // parentId: z.string(),
1650
- // source: z.string(),
1651
- // }),
1652
- // properties: z.object({
1653
- // menuName: z.string(),
1654
- // menuType: z.string(),
1655
- // databaseSocket: z.string(),
1656
- // }),
1657
- // progDataSource: z.object({}),
1658
- // progFields: z.array(z.object({})),
1659
- // progEvents: z.array(z.object({})),
1660
- // }),
1661
- // ),
1662
- // },
1663
- // },
1664
- // };
1665
-
1666
- // if (object_unit === 'app') {
1667
- // const agents_as_a_tool_arr = get_agents_as_a_tool(['table', 'folder', 'component', 'get_data']);
1668
- // studio_agents_obj.app.tools = [...studio_agents_obj.app.tools, ...agents_as_a_tool_arr];
1669
- // }
1670
-
1671
- // const run = async function (user_prompt, object_unit) {
1672
- // const _agent = new Agent(studio_agents_obj[object_unit]);
1673
- // const runner = new Runner();
1674
-
1675
- // const result = await runner.run(_agent, user_prompt, {
1676
- // context: { uid, app_id, userName },
1677
- // });
1678
-
1679
- // return result;
1680
- // };
1681
-
1682
- // const result = await run(user_prompt, object_unit);
1683
-
1684
- // return { code: 100, data: result.finalOutput };
1685
- // } catch (err) {
1686
- // debugger;
1687
- // console.error('>>>>> AI:', err);
1688
- // console.error('Cause:', err?.cause?.message);
1689
- // return { code: -100, data: err.message };
1690
- // }
1691
- // };
1692
-
1693
- // export const get_chat_conversation = async function (req) {
1694
- // let { conversation_id, order = 'asc', limit, after, _id, uid } = req;
1695
-
1696
- // const account_profile_info = await account_module.get_active_account_profile_info(uid);
1697
-
1698
- // if (_id) {
1699
-
1700
- // let data = await db_module.get_app_couch_doc(account_profile_info.app_id, _id);
1701
- // return data;
1702
- // }
1703
-
1704
- // try {
1705
- // // const project_db = await get_account_project_db(uid);
1706
- // // let conversation_doc = await project_db.get(conversation_id);
1707
- // let conversation_doc = await db_module.get_app_couch_doc(account_profile_info.app_id, conversation_id);
1708
- // let reference_doc;
1709
- // if (conversation_doc.shared_from_uid) {
1710
- // reference_doc = _.cloneDeep(conversation_doc);
1711
- // conversation_doc = await db_module.get_app_couch_doc_native(reference_doc.shared_from_app_id, reference_doc.share_item_id);
1712
- // conversation_doc.reference_doc = reference_doc;
1713
- // }
1714
- // let conversation = await client.conversations.items.list(conversation_id, { limit, order, after });
1715
-
1716
- // return { code: 15, data: { conversation, ...conversation_doc } };
1717
- // } catch (err) {
1718
- // return { code: -15, data: err.message };
1719
- // }
1720
- // };
1721
-
1722
1072
  export const get_chat_conversation = async function (req) {
1723
1073
  let { conversation_id, order = 'asc', limit = 9999, skip = 0, _id, uid } = req;
1724
1074
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4805",
3
+ "version": "1.1.4806",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",