@open-wa/wa-automate 4.62.5 → 4.63.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1068,6 +1068,16 @@ export declare class Client {
1068
1068
  * @returns array of [Chat]
1069
1069
  */
1070
1070
  getAllChatsWithMessages(withNewMessageOnly?: boolean): Promise<Chat[]>;
1071
+ /**
1072
+ * Returns a properly formatted array of messages from to send to the openai api
1073
+ *
1074
+ * @param last The amount of previous messages to retrieve. Defaults to 10
1075
+ * @returns
1076
+ */
1077
+ getGptArray(last?: number): Promise<{
1078
+ role: "user" | "assistant";
1079
+ content: string;
1080
+ }[]>;
1071
1081
  /**
1072
1082
  * Retrieve all groups
1073
1083
  * @returns array of groups
@@ -2433,6 +2433,17 @@ class Client {
2433
2433
  return JSON.parse(yield this.pup(withNewMessageOnly => WAPI.getAllChatsWithMessages(withNewMessageOnly), withNewMessageOnly));
2434
2434
  });
2435
2435
  }
2436
+ /**
2437
+ * Returns a properly formatted array of messages from to send to the openai api
2438
+ *
2439
+ * @param last The amount of previous messages to retrieve. Defaults to 10
2440
+ * @returns
2441
+ */
2442
+ getGptArray(last = 10) {
2443
+ return __awaiter(this, void 0, void 0, function* () {
2444
+ return yield this.pup(last => WAPI.getGptArray(last), last);
2445
+ });
2446
+ }
2436
2447
  /**
2437
2448
  * Retrieve all groups
2438
2449
  * @returns array of groups
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-wa/wa-automate",
3
- "version": "4.62.5",
3
+ "version": "4.63.0",
4
4
  "licenseCheckUrl": "https://funcs.openwa.dev/license-check",
5
5
  "brokenMethodReportUrl": "https://funcs.openwa.dev/report-bm",
6
6
  "patches": "https://cdn.openwa.dev/patches.json",