llmasaservice-client 0.2.4 → 0.2.5

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.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Debugging callback
8
+
3
9
  ## 0.2.4
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -182,8 +182,10 @@ var useLLM = (options) => {
182
182
  reader.cancel();
183
183
  setIdle(true);
184
184
  }
185
+ console.log("about to call callback", onCompleteCallback);
185
186
  if (onCompleteCallback) {
186
- onCompleteCallback();
187
+ onCompleteCallback(result);
188
+ console.log("called callback");
187
189
  }
188
190
  return result;
189
191
  });
package/dist/index.mjs CHANGED
@@ -145,8 +145,10 @@ var useLLM = (options) => {
145
145
  reader.cancel();
146
146
  setIdle(true);
147
147
  }
148
+ console.log("about to call callback", onCompleteCallback);
148
149
  if (onCompleteCallback) {
149
- onCompleteCallback();
150
+ onCompleteCallback(result);
151
+ console.log("called callback");
150
152
  }
151
153
  return result;
152
154
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "llmasaservice-client",
3
3
  "license": "MIT",
4
- "version": "0.2.4",
4
+ "version": "0.2.5",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
package/src/useLLM.ts CHANGED
@@ -120,7 +120,7 @@ export const useLLM = (options?: LLMServiceType): UseLLMReturnType => {
120
120
  decoder: TextDecoder,
121
121
  stream: Boolean = true,
122
122
  { signal: signal }: { signal: AbortSignal },
123
- onCompleteCallback?: Function
123
+ onCompleteCallback?: (result: string) => void
124
124
  ): Promise<string> {
125
125
  let errorInRead = "";
126
126
  let result = "";
@@ -171,8 +171,10 @@ export const useLLM = (options?: LLMServiceType): UseLLMReturnType => {
171
171
  setIdle(true);
172
172
  }
173
173
 
174
+ console.log("about to call callback", onCompleteCallback);
174
175
  if (onCompleteCallback) {
175
- onCompleteCallback();
176
+ onCompleteCallback(result);
177
+ console.log("called callback");
176
178
  }
177
179
 
178
180
  return result;