@sprucelabs/sprucebot-llm 13.1.7 → 13.1.8

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.
@@ -92,6 +92,11 @@ class ResponseParser {
92
92
  }
93
93
  }
94
94
  }
95
+ const { match, regex } = this.parseState(message);
96
+ if (match && regex) {
97
+ message = message.replace(regex, '').trim();
98
+ state = JSON.parse(match);
99
+ }
95
100
  const matchedCallback = this.findFirstBadCallback(message);
96
101
  if (matchedCallback) {
97
102
  throw new SpruceError({
@@ -100,11 +105,6 @@ class ResponseParser {
100
105
  matchedCallback,
101
106
  });
102
107
  }
103
- const { match, regex } = this.parseState(message);
104
- if (match && regex) {
105
- message = message.replace(regex, '').trim();
106
- state = JSON.parse(match);
107
- }
108
108
  return {
109
109
  isDone: this.doesIncludeDoneToken(response),
110
110
  state,
@@ -75,6 +75,11 @@ class ResponseParser {
75
75
  }
76
76
  }
77
77
  }
78
+ const { match, regex } = this.parseState(message);
79
+ if (match && regex) {
80
+ message = message.replace(regex, '').trim();
81
+ state = JSON.parse(match);
82
+ }
78
83
  const matchedCallback = this.findFirstBadCallback(message);
79
84
  if (matchedCallback) {
80
85
  throw new SpruceError_1.default({
@@ -83,11 +88,6 @@ class ResponseParser {
83
88
  matchedCallback,
84
89
  });
85
90
  }
86
- const { match, regex } = this.parseState(message);
87
- if (match && regex) {
88
- message = message.replace(regex, '').trim();
89
- state = JSON.parse(match);
90
- }
91
91
  return {
92
92
  isDone: this.doesIncludeDoneToken(response),
93
93
  state,
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "eta"
9
9
  ]
10
10
  },
11
- "version": "13.1.7",
11
+ "version": "13.1.8",
12
12
  "files": [
13
13
  "build"
14
14
  ],