@memori.ai/memori-api-client 0.9.0 → 0.10.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
 
2
2
 
3
+ ## [0.10.0](https://github.com/memori-ai/memori-api-client/compare/v0.9.0...v0.10.0) (2023-01-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * add new nlp apis ([9befc96](https://github.com/memori-ai/memori-api-client/commit/9befc9629e8f5d99b89e910b365f9c2306cffe1d))
9
+
10
+
11
+ ### Changes
12
+
13
+ * add memory type DRAFT ([fa64870](https://github.com/memori-ai/memori-api-client/commit/fa648709749a3220f038edeaacbdf78749f3f7e7))
14
+ * add memoryID in chat log lines ([52fa29d](https://github.com/memori-ai/memori-api-client/commit/52fa29db601037e4d11f5874a3a01a161b46bc1e))
15
+
3
16
  ## [0.9.0](https://github.com/memori-ai/memori-api-client/compare/v0.8.3...v0.9.0) (2023-01-19)
4
17
 
5
18
 
@@ -14,7 +14,7 @@ declare const _default: (apiUrl: string) => {
14
14
  * @param {number} howMany The number of items to return
15
15
  * @param {string=} type Optional type of the Memory objects to list: ALL, CONTENTS, DEFAULTS
16
16
  */
17
- getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | undefined) => Promise<ResponseSpec & {
17
+ getMemoriesPaginated: (sessionId: string, from: number, howMany: number, type?: "ALL" | "CONTENTS" | "DEFAULTS" | "DRAFTS" | undefined) => Promise<ResponseSpec & {
18
18
  count: number;
19
19
  memories: Memory[];
20
20
  }>;
@@ -57,6 +57,29 @@ declare const _default: (apiUrl: string) => {
57
57
  */
58
58
  undefinedWords: string[];
59
59
  }>;
60
+ /**
61
+ * Tries to suggest the answer for a question, using as much content as possible from the session's associated Memori object.
62
+ * @param {string} sessionId The session ID
63
+ * @param {string} text Text of the sentence.
64
+ */
65
+ suggestAnswer: (sessionId: string, text: string) => Promise<ResponseSpec & {
66
+ /**
67
+ * Suggested answer. May be null if no answer could be suggested.
68
+ */
69
+ answer: string;
70
+ }>;
71
+ /**
72
+ * Tries to suggest questions for an answer.
73
+ * Differently from ```SuggestAnswer```, no content from the session's associated Memori object is used.
74
+ * @param {string} sessionId The session ID
75
+ * @param {string} text Text of the sentence.
76
+ */
77
+ suggestQuestions: (sessionId: string, text: string) => Promise<ResponseSpec & {
78
+ /**
79
+ * Suggested questions. May be null or empty if no questions could be suggested.
80
+ */
81
+ questions: string[];
82
+ }>;
60
83
  };
61
84
  /***************
62
85
  * *
@@ -2753,6 +2753,75 @@ var nlp = (function (apiUrl) {
2753
2753
  }
2754
2754
 
2755
2755
  return checkWords;
2756
+ }(),
2757
+
2758
+ /**
2759
+ * Tries to suggest the answer for a question, using as much content as possible from the session's associated Memori object.
2760
+ * @param {string} sessionId The session ID
2761
+ * @param {string} text Text of the sentence.
2762
+ */
2763
+ suggestAnswer: function () {
2764
+ var _suggestAnswer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(sessionId, text) {
2765
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
2766
+ while (1) {
2767
+ switch (_context6.prev = _context6.next) {
2768
+ case 0:
2769
+ return _context6.abrupt("return", apiFetcher("/SuggestAnswer/" + sessionId, {
2770
+ method: 'POST',
2771
+ apiUrl: apiUrl,
2772
+ body: {
2773
+ text: text
2774
+ }
2775
+ }));
2776
+
2777
+ case 1:
2778
+ case "end":
2779
+ return _context6.stop();
2780
+ }
2781
+ }
2782
+ }, _callee6);
2783
+ }));
2784
+
2785
+ function suggestAnswer(_x14, _x15) {
2786
+ return _suggestAnswer.apply(this, arguments);
2787
+ }
2788
+
2789
+ return suggestAnswer;
2790
+ }(),
2791
+
2792
+ /**
2793
+ * Tries to suggest questions for an answer.
2794
+ * Differently from ```SuggestAnswer```, no content from the session's associated Memori object is used.
2795
+ * @param {string} sessionId The session ID
2796
+ * @param {string} text Text of the sentence.
2797
+ */
2798
+ suggestQuestions: function () {
2799
+ var _suggestQuestions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(sessionId, text) {
2800
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
2801
+ while (1) {
2802
+ switch (_context7.prev = _context7.next) {
2803
+ case 0:
2804
+ return _context7.abrupt("return", apiFetcher("/SuggestQuestions/" + sessionId, {
2805
+ method: 'POST',
2806
+ apiUrl: apiUrl,
2807
+ body: {
2808
+ text: text
2809
+ }
2810
+ }));
2811
+
2812
+ case 1:
2813
+ case "end":
2814
+ return _context7.stop();
2815
+ }
2816
+ }
2817
+ }, _callee7);
2818
+ }));
2819
+
2820
+ function suggestQuestions(_x16, _x17) {
2821
+ return _suggestQuestions.apply(this, arguments);
2822
+ }
2823
+
2824
+ return suggestQuestions;
2756
2825
  }()
2757
2826
  };
2758
2827
  });