@cellaware/utils 7.0.2 → 7.0.4

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.
@@ -70,8 +70,12 @@ export class SingleActionChain extends BaseChain {
70
70
  for (const inputKey of this._inputKeys) {
71
71
  llmInputs[inputKey] = values[inputKey];
72
72
  }
73
+ let callbacks = undefined;
74
+ if (!!runManager && !!runManager.getChild()) {
75
+ callbacks = runManager.getChild().handlers;
76
+ }
73
77
  const llmAnswer = await llmChain.invoke(llmInputs, {
74
- callbacks: runManager ? [runManager.getChild()] : undefined,
78
+ callbacks
75
79
  });
76
80
  output[this._outputKey] = llmAnswer;
77
81
  return output;
@@ -233,7 +237,7 @@ Your translation here:
233
237
  return chain.invoke(args, {
234
238
  callbacks: [
235
239
  {
236
- handleLLMEnd: (output) => {
240
+ handleLLMEnd: async (output) => {
237
241
  console.log(output);
238
242
  const usage = output?.llmOutput?.tokenUsage;
239
243
  tokenUsages.push(ChainStore.getTokenUsage(chain._chainType(), chain.getModelName(), usage));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cellaware/utils",
3
- "version": "7.0.2",
3
+ "version": "7.0.4",
4
4
  "description": "Cellaware Utilities for Node.js",
5
5
  "author": "Cellaware Technologies",
6
6
  "type": "module",