llmasaservice-client 0.2.2 → 0.2.3

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,11 @@
1
1
  # llmasaservice-client
2
2
 
3
+ ## 0.2.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed callback
8
+
3
9
  ## 0.2.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -161,9 +161,6 @@ var useLLM = (options) => {
161
161
  }
162
162
  if (done) {
163
163
  setIdle(true);
164
- if (onCompleteCallback) {
165
- onCompleteCallback(result);
166
- }
167
164
  break;
168
165
  }
169
166
  result += decoder.decode(value);
@@ -185,6 +182,9 @@ var useLLM = (options) => {
185
182
  reader.cancel();
186
183
  setIdle(true);
187
184
  }
185
+ if (onCompleteCallback) {
186
+ onCompleteCallback();
187
+ }
188
188
  return result;
189
189
  });
190
190
  }
package/dist/index.mjs CHANGED
@@ -124,9 +124,6 @@ var useLLM = (options) => {
124
124
  }
125
125
  if (done) {
126
126
  setIdle(true);
127
- if (onCompleteCallback) {
128
- onCompleteCallback(result);
129
- }
130
127
  break;
131
128
  }
132
129
  result += decoder.decode(value);
@@ -148,6 +145,9 @@ var useLLM = (options) => {
148
145
  reader.cancel();
149
146
  setIdle(true);
150
147
  }
148
+ if (onCompleteCallback) {
149
+ onCompleteCallback();
150
+ }
151
151
  return result;
152
152
  });
153
153
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "llmasaservice-client",
3
3
  "license": "MIT",
4
- "version": "0.2.2",
4
+ "version": "0.2.3",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
package/src/useLLM.ts CHANGED
@@ -144,12 +144,6 @@ export const useLLM = (options?: LLMServiceType): UseLLMReturnType => {
144
144
  // If the stream has been read to the end, exit the loop
145
145
  if (done) {
146
146
  setIdle(true);
147
-
148
- if (onCompleteCallback) {
149
- onCompleteCallback(result);
150
-
151
- }
152
-
153
147
  break;
154
148
  }
155
149
 
@@ -176,6 +170,10 @@ export const useLLM = (options?: LLMServiceType): UseLLMReturnType => {
176
170
  setIdle(true);
177
171
  }
178
172
 
173
+ if (onCompleteCallback) {
174
+ onCompleteCallback();
175
+ }
176
+
179
177
  return result;
180
178
  }
181
179