apexify.js 2.2.0 → 2.2.2

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/lib/ai/models.js CHANGED
@@ -38,17 +38,19 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ApexChat = exports.ApexImagine = void 0;
40
40
  var hercai_1 = require("hercai");
41
- var api = require("api");
42
- var sdk = api("@prodia/v1.3.0#be019b2kls0gqss3");
41
+ var axios_1 = require("axios");
42
+ var api_1 = require("api");
43
+ var sdk = (0, api_1.default)("@prodia/v1.3.0#be019b2kls0gqss3");
43
44
  sdk.auth("43435e1c-cab1-493f-a224-f51e4b97ce8d");
44
45
  var herc = new hercai_1.Hercai();
46
+ var apexAI_1 = require("./apexAI");
45
47
  function ApexImagine(model, prompt, options) {
46
48
  return __awaiter(this, void 0, void 0, function () {
47
- var negative, number, neg, count, resultUrls, allowedModelsH, validProdiaModalsP, i, result, error_1, i, generateResponse, generatedJobId, result;
49
+ var negative, number, nsfw, neg, count, resultUrls, allowedModelsH, validProdiaModalsP, i, result, error_1, i, generateResponse, generatedJobId, result, checkedURLs, nsfwWords, _loop_1, _i, checkedURLs_1, text, state_1;
48
50
  return __generator(this, function (_a) {
49
51
  switch (_a.label) {
50
52
  case 0:
51
- negative = options.negative, number = options.number;
53
+ negative = options.negative, number = options.number, nsfw = options.nsfw;
52
54
  neg = '';
53
55
  count = 1;
54
56
  if (negative) {
@@ -61,7 +63,7 @@ function ApexImagine(model, prompt, options) {
61
63
  throw new Error('Invalid number parameter. It must be an integer between 1 and 4.');
62
64
  }
63
65
  resultUrls = [];
64
- allowedModelsH = ['v3', 'v2', 'v2-beta', 'lexica', 'prodia', 'animefy', 'raava', 'shonin'];
66
+ allowedModelsH = ['v1', 'v2', 'v2-beta', 'lexica', 'prodia', 'animefy', 'raava', 'shonin'];
65
67
  validProdiaModalsP = [
66
68
  "3Guofeng3_v34.safetensors [50f420de]",
67
69
  "absolutereality_V16.safetensors [37db0fc3]",
@@ -169,7 +171,332 @@ function ApexImagine(model, prompt, options) {
169
171
  case 11:
170
172
  i++;
171
173
  return [3 /*break*/, 8];
172
- case 12: return [2 /*return*/, resultUrls];
174
+ case 12:
175
+ if (!nsfw) return [3 /*break*/, 14];
176
+ return [4 /*yield*/, apexChecker(resultUrls)];
177
+ case 13:
178
+ checkedURLs = _a.sent();
179
+ nsfwWords = [
180
+ "porn",
181
+ "sex",
182
+ "nude",
183
+ "nsfw",
184
+ "xxx",
185
+ "adult",
186
+ "vagina",
187
+ "penis",
188
+ "boobs",
189
+ "fuck",
190
+ "orgasm",
191
+ "erotic",
192
+ "naughty",
193
+ "kinky",
194
+ "sensual",
195
+ "horny",
196
+ "lust",
197
+ "sperm",
198
+ "ejaculate",
199
+ "busty",
200
+ "booty",
201
+ "striptease",
202
+ "dildo",
203
+ "vibrator",
204
+ "fetish",
205
+ "bondage",
206
+ "anal",
207
+ "oral",
208
+ "blowjob",
209
+ "cumshot",
210
+ "gangbang",
211
+ "threesome",
212
+ "orgy",
213
+ "deepthroat",
214
+ "naked",
215
+ "undress",
216
+ "cum",
217
+ "suck",
218
+ "lick",
219
+ "spank",
220
+ "masturbate",
221
+ "clitoris",
222
+ "penetration",
223
+ "swinger",
224
+ "hooker",
225
+ "prostitute",
226
+ "escort",
227
+ "cumswap",
228
+ "creampie",
229
+ "rimjob",
230
+ "squirt",
231
+ "butt",
232
+ "ass",
233
+ "slut",
234
+ "whore",
235
+ "cumming",
236
+ "rimming",
237
+ "cunnilingus",
238
+ "fellatio",
239
+ "crotch",
240
+ "groin",
241
+ "erogenous",
242
+ "labia",
243
+ "testicles",
244
+ "climax",
245
+ "thrust",
246
+ "missionary",
247
+ "doggy",
248
+ "69",
249
+ "tits",
250
+ "pussy",
251
+ "cock",
252
+ "boobies",
253
+ "boner",
254
+ "cherry",
255
+ "virgin",
256
+ "cumming",
257
+ "anal beads",
258
+ "nipple",
259
+ "stripper",
260
+ "g-string",
261
+ "thong",
262
+ "fingering",
263
+ "handjob",
264
+ "voyeur",
265
+ "orgasmic",
266
+ "nudity",
267
+ "sexting",
268
+ "seduction",
269
+ "lustful",
270
+ "wet",
271
+ "hardcore",
272
+ "seduce",
273
+ "dirty",
274
+ "naughty",
275
+ "erotic",
276
+ "pleasure",
277
+ "aroused",
278
+ "intimate",
279
+ "eroticism",
280
+ "foreplay",
281
+ "dominate",
282
+ "submissive",
283
+ "bdsm",
284
+ "s&m",
285
+ "masochism",
286
+ "sadism",
287
+ "bukkake",
288
+ "gangbang",
289
+ "fetish",
290
+ "orgy",
291
+ "bondage",
292
+ "golden shower",
293
+ "dirty talk",
294
+ "pillow talk",
295
+ "sex slave",
296
+ "dirty dancing",
297
+ "striptease",
298
+ "pornographic",
299
+ "adult entertainment",
300
+ "sexual intercourse",
301
+ "titillating",
302
+ "sexy",
303
+ "hot",
304
+ "erotic",
305
+ "raunchy",
306
+ "stimulation",
307
+ "climax",
308
+ "horny",
309
+ "turn-on",
310
+ "kinky",
311
+ "lustful",
312
+ "sensual",
313
+ "passionate",
314
+ "intimate",
315
+ "provocative",
316
+ "tease",
317
+ "foreplay",
318
+ "satisfy",
319
+ "pleasure",
320
+ "erogenous",
321
+ "arousal",
322
+ "lust",
323
+ "desire",
324
+ "attraction",
325
+ "libido",
326
+ "orgasm",
327
+ "bedroom",
328
+ "undress",
329
+ "naked",
330
+ "kiss",
331
+ "touch",
332
+ "petting",
333
+ "cuddle",
334
+ "spooning",
335
+ "naughty",
336
+ "dirty",
337
+ "taboo",
338
+ "forbidden",
339
+ "sinful",
340
+ "sultry",
341
+ "risqué",
342
+ "racy",
343
+ "flirt",
344
+ "seduce",
345
+ "titillate",
346
+ "arouse",
347
+ "tempt",
348
+ "stimulate",
349
+ "seduction",
350
+ "pleasure",
351
+ "ecstasy",
352
+ "passion",
353
+ "intimacy",
354
+ "sensuality",
355
+ "eroticism",
356
+ "fetish",
357
+ "fantasy",
358
+ "kink",
359
+ "role-play",
360
+ "dominance",
361
+ "submission",
362
+ "bondage",
363
+ "masochism",
364
+ "sadism",
365
+ "orgy",
366
+ "swinging",
367
+ "voyeurism",
368
+ "exhibitionism",
369
+ "cunnilingus",
370
+ "fellatio",
371
+ "69",
372
+ "blowjob",
373
+ "anal",
374
+ "doggy style",
375
+ "missionary",
376
+ "cowgirl",
377
+ "reverse cowgirl",
378
+ "threesome",
379
+ "foursome",
380
+ "gangbang",
381
+ "rimming",
382
+ "golden shower",
383
+ "facial",
384
+ "creampie",
385
+ "cumshot",
386
+ "squirting",
387
+ "masturbation",
388
+ "orgasm",
389
+ "erect",
390
+ "nipple",
391
+ "pubic",
392
+ "erection",
393
+ "ejaculation",
394
+ "clitoris",
395
+ "penetration",
396
+ "vibrator",
397
+ "dildo",
398
+ "strap-on",
399
+ "butt plug",
400
+ "anal beads",
401
+ "crotchless",
402
+ "lingerie",
403
+ "corset",
404
+ "stockings",
405
+ "garter",
406
+ "bra",
407
+ "panties",
408
+ "thong",
409
+ "G-string",
410
+ "bikini",
411
+ "lingerie",
412
+ "boudoir",
413
+ "stripper",
414
+ "exotic dancer",
415
+ "burlesque",
416
+ "pole dance",
417
+ "erotic dance",
418
+ "nude",
419
+ "topless",
420
+ "lap dance",
421
+ "strip tease",
422
+ "private dance",
423
+ "camgirl",
424
+ "porn star",
425
+ "sex worker",
426
+ "escort",
427
+ "prostitute",
428
+ "whore",
429
+ "call girl",
430
+ "hooker",
431
+ "streetwalker",
432
+ "courtesan",
433
+ "madam",
434
+ "mistress",
435
+ "dominatrix",
436
+ "submissive",
437
+ "slave",
438
+ "master",
439
+ "mistress",
440
+ "sir",
441
+ "madame",
442
+ "domina",
443
+ "domme",
444
+ "sissy",
445
+ "bottom",
446
+ "top",
447
+ "fetish",
448
+ "kink",
449
+ "leather",
450
+ "latex",
451
+ "rubber",
452
+ "bondage",
453
+ "rope",
454
+ "chain",
455
+ "spanking",
456
+ "whipping",
457
+ "caning",
458
+ "flogging",
459
+ "paddling",
460
+ "torture",
461
+ "humiliation",
462
+ "degradation",
463
+ "submission",
464
+ "dominance",
465
+ "sadism",
466
+ "masochism",
467
+ "bukkake",
468
+ "facial",
469
+ "creampie",
470
+ "cum swap",
471
+ "cum play",
472
+ "cum shot",
473
+ "gang bang",
474
+ "double penetration",
475
+ "anal sex",
476
+ "oral sex",
477
+ "rimming",
478
+ "fingering",
479
+ "gay",
480
+ "lesbian",
481
+ "niga",
482
+ "underage",
483
+ "xnxx",
484
+ "xxx",
485
+ "pornhub",
486
+ ];
487
+ _loop_1 = function (text) {
488
+ if (nsfwWords.some(function (word) { return text.includes(word); })) {
489
+ return { value: "The generated text contains NSFW content." };
490
+ }
491
+ };
492
+ for (_i = 0, checkedURLs_1 = checkedURLs; _i < checkedURLs_1.length; _i++) {
493
+ text = checkedURLs_1[_i];
494
+ state_1 = _loop_1(text);
495
+ if (typeof state_1 === "object")
496
+ return [2 /*return*/, state_1.value];
497
+ }
498
+ _a.label = 14;
499
+ case 14: return [2 /*return*/, resultUrls];
173
500
  }
174
501
  });
175
502
  });
@@ -222,21 +549,89 @@ function ApexChat(model, prompt) {
222
549
  return __generator(this, function (_a) {
223
550
  switch (_a.label) {
224
551
  case 0:
225
- _a.trys.push([0, 4, , 5]);
552
+ _a.trys.push([0, 6, , 7]);
226
553
  if (!['v3', 'v3-32k', 'turbo', 'turbo-16k', 'gemini'].includes(model)) return [3 /*break*/, 2];
227
554
  return [4 /*yield*/, herc.question({ model: "".concat(model), content: "".concat(prompt) })];
228
555
  case 1:
229
556
  response = _a.sent();
230
557
  return [2 /*return*/, response.reply];
231
- case 2: throw new Error('Wrong modal being used please check documentation for valid modals');
232
- case 3: return [3 /*break*/, 5];
233
- case 4:
558
+ case 2:
559
+ if (!(model === 'apexChat')) return [3 /*break*/, 4];
560
+ return [4 /*yield*/, (0, apexAI_1.apexai)(prompt)];
561
+ case 3: return [2 /*return*/, _a.sent()];
562
+ case 4: throw new Error('Invalid model.');
563
+ case 5: return [3 /*break*/, 7];
564
+ case 6:
234
565
  e_1 = _a.sent();
235
566
  console.error(e_1.message);
236
567
  return [2 /*return*/, ''];
237
- case 5: return [2 /*return*/];
568
+ case 7: return [2 /*return*/];
238
569
  }
239
570
  });
240
571
  });
241
572
  }
242
573
  exports.ApexChat = ApexChat;
574
+ function apexChecker(urls) {
575
+ return __awaiter(this, void 0, void 0, function () {
576
+ var retryCount, maxRetries, fetchData, error_3, error_4;
577
+ var _this = this;
578
+ return __generator(this, function (_a) {
579
+ switch (_a.label) {
580
+ case 0:
581
+ _a.trys.push([0, 7, , 8]);
582
+ retryCount = 0;
583
+ maxRetries = 3;
584
+ fetchData = function () { return __awaiter(_this, void 0, void 0, function () {
585
+ var response, error_5;
586
+ return __generator(this, function (_a) {
587
+ switch (_a.label) {
588
+ case 0:
589
+ _a.trys.push([0, 2, , 3]);
590
+ return [4 /*yield*/, axios_1.default.post("https://api-inference.huggingface.co/models/Salesforce/blip-image-captioning-base", { image: urls }, {
591
+ headers: {
592
+ "Content-Type": "application/json",
593
+ Authorization: "Bearer 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",
594
+ },
595
+ })];
596
+ case 1:
597
+ response = _a.sent();
598
+ if (response.status === 200) {
599
+ return [2 /*return*/, response.data[0].generated_text];
600
+ }
601
+ else {
602
+ console.error("Failed to fetch image captioning API: ".concat(response.statusText));
603
+ return [2 /*return*/, null];
604
+ }
605
+ return [3 /*break*/, 3];
606
+ case 2:
607
+ error_5 = _a.sent();
608
+ console.error("Error fetching data: ".concat(error_5.message));
609
+ throw error_5;
610
+ case 3: return [2 /*return*/];
611
+ }
612
+ });
613
+ }); };
614
+ _a.label = 1;
615
+ case 1:
616
+ if (!(retryCount < maxRetries)) return [3 /*break*/, 6];
617
+ _a.label = 2;
618
+ case 2:
619
+ _a.trys.push([2, 4, , 5]);
620
+ return [4 /*yield*/, fetchData()];
621
+ case 3: return [2 /*return*/, _a.sent()];
622
+ case 4:
623
+ error_3 = _a.sent();
624
+ console.error("Error fetching data (Retry ".concat(retryCount + 1, "): ").concat(error_3.message));
625
+ retryCount++;
626
+ return [3 /*break*/, 5];
627
+ case 5: return [3 /*break*/, 1];
628
+ case 6: return [2 /*return*/, null];
629
+ case 7:
630
+ error_4 = _a.sent();
631
+ console.error("Error in attemptImageCaptioning: ".concat(error_4.message));
632
+ return [2 /*return*/, null];
633
+ case 8: return [2 /*return*/];
634
+ }
635
+ });
636
+ });
637
+ }
@@ -0,0 +1,37 @@
1
+ const utils = require('./utils');
2
+ const Hercai = require("hercai");
3
+ const axios = require("axios");
4
+ const utils1 = require("./utils");
5
+ const discord = require("discord.js");
6
+ const tools = require("../discord/events/handler/tools");
7
+ const drawMenu = require("../discord/events/handler/drawMenu");
8
+
9
+ const herc = new Hercai()
10
+
11
+
12
+ var unclearPhrases = [
13
+ "Can you please provide more information or clarify your question?",
14
+ "Could you please provide more context or clarify your question?",
15
+ "Could you please provide more context or clarify what you mean?",
16
+ "I'm not sure I understand the question.",
17
+ "Could you please provide more context or clarify your question",
18
+ "I'm not sure what you're asking for.",
19
+ "Could you please provide more context or rephrase your question?",
20
+ "I'm not sure what you're asking",
21
+ "Can you please rephrase or provide more context?",
22
+ "Could you please provide more context or clarify your request?",
23
+ "I couldn't understand your input",
24
+ "Could you please provide some more information or clarify what you mean?",
25
+ "Can you please provide more information or clarify your request?",
26
+ ];
27
+
28
+
29
+ async function apexAI(message, options) {
30
+
31
+ if (!message) {
32
+ throw new Error(`Invalid Usage: Please define the parameter (message) => apexAI(message, options)`)
33
+ }
34
+
35
+ }
36
+
37
+ module.exports = { apexAI };
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apexify.js",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Ai with Canvas and Database library. Supports typescript and javascript",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -132,9 +132,9 @@
132
132
  "dependencies": {
133
133
  "@iamtraction/google-translate": "^2.0.1",
134
134
  "@napi-rs/canvas": "^0.1.51",
135
- "api": "^2.6.0",
135
+ "apexify.js": "^2.2.0",
136
+ "api": "^6.1.1",
136
137
  "archiver": "^7.0.0",
137
- "ascii-table": "^0.0.9",
138
138
  "axios": "^1.6.7",
139
139
  "crypto": "^1.0.1",
140
140
  "express": "^4.18.3",
@@ -144,7 +144,6 @@
144
144
  "jimp": "^0.22.12",
145
145
  "mongodb": "^6.4.0",
146
146
  "pdf-parse": "^1.1.1",
147
- "phin": "^3.7.0",
148
147
  "riffy": "^1.0.3",
149
148
  "sharp": "^0.33.2",
150
149
  "stream": "^0.0.2",
package/declare.d.ts DELETED
@@ -1,137 +0,0 @@
1
- declare module 'apexify.js' {
2
- const ApexChat: any;
3
- const ApexImagine: any;
4
- const adminUser: any;
5
- const ecoSystem: any;
6
- const roleMenu: any;
7
- const contactInfo: any;
8
- const shopItem: any;
9
- const eventInfo: any;
10
- const blogPost: any;
11
- const productInfo: any;
12
- const userEco: any;
13
- const xpConfig: any;
14
- const xpCount: any;
15
- const forumPost: any;
16
- const orderInfo: any;
17
- const productReview: any;
18
- const recipeInfo: any;
19
- const musicTrack: any;
20
- const setGameCount: any;
21
- const gameCount: any;
22
- const employeeInfo: any;
23
- const setserverCounter: any;
24
- const guildInfo: any;
25
- const userTemplate: any;
26
- const updateAllExcept: any;
27
- const updateAll: any;
28
- const updateData: any;
29
- const migrateAndPrune: any;
30
- const migrateData: any;
31
- const textSearch: any;
32
- const searchMany: any;
33
- const removeSpecific: any;
34
- const removeManyExcept: any;
35
- const removeMany: any;
36
- const remove: any;
37
- const listCollections: any;
38
- const listIndexes: any;
39
- const geoNear: any;
40
- const find: any;
41
- const drop: any;
42
- const distinct: any;
43
- const dataSize: any;
44
- const countDocs: any;
45
- const createTable: any;
46
- const aggregate: any;
47
- const save: any;
48
- const initializeDb: any;
49
- const getDb: any;
50
- const mongoConnect: any;
51
- const NanoDb: any;
52
- const apexAI: any;
53
- const ApexPainter: any;
54
- const typeWriter: any;
55
- const starter: any;
56
- const previousCommand: any;
57
- const resumeCommand: any;
58
- const skipCommand: any;
59
- const stopCommand: any;
60
- const playCommand: any;
61
- const PermissionChecker: any;
62
- const Paginator: any;
63
- const SelectMenuManager: any;
64
- const ButtonManager: any;
65
- const cooldown: any;
66
- const whiteList: any;
67
- const blackList: any;
68
-
69
- export {
70
- ApexChat,
71
- ApexImagine,
72
- adminUser,
73
- ecoSystem,
74
- roleMenu,
75
- contactInfo,
76
- shopItem,
77
- eventInfo,
78
- blogPost,
79
- productInfo,
80
- userEco,
81
- xpConfig,
82
- xpCount,
83
- forumPost,
84
- orderInfo,
85
- productReview,
86
- recipeInfo,
87
- musicTrack,
88
- setGameCount,
89
- gameCount,
90
- employeeInfo,
91
- setserverCounter,
92
- guildInfo,
93
- userTemplate,
94
- updateAllExcept,
95
- updateAll,
96
- updateData,
97
- migrateAndPrune,
98
- migrateData,
99
- textSearch,
100
- searchMany,
101
- removeSpecific,
102
- removeManyExcept,
103
- removeMany,
104
- remove,
105
- listCollections,
106
- listIndexes,
107
- geoNear,
108
- find,
109
- drop,
110
- distinct,
111
- dataSize,
112
- countDocs,
113
- createTable,
114
- aggregate,
115
- save,
116
- initializeDb,
117
- getDb,
118
- mongoConnect,
119
- NanoDb,
120
- apexAI,
121
- ApexPainter,
122
- typeWriter,
123
- starter,
124
- previousCommand,
125
- resumeCommand,
126
- skipCommand,
127
- stopCommand,
128
- playCommand,
129
- PermissionChecker,
130
- Paginator,
131
- SelectMenuManager,
132
- ButtonManager,
133
- cooldown,
134
- whiteList,
135
- blackList,
136
- };
137
- }