@flutchai/flutch-sdk 0.1.18 → 0.1.19

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/dist/index.cjs CHANGED
@@ -4812,6 +4812,7 @@ exports.EventProcessor = class EventProcessor {
4812
4812
  exports.EventProcessor = __decorateClass([
4813
4813
  common.Injectable()
4814
4814
  ], exports.EventProcessor);
4815
+ var DEFAULT_RECURSION_LIMIT = 40;
4815
4816
  process.setMaxListeners(0);
4816
4817
  exports.LangGraphEngine = class LangGraphEngine {
4817
4818
  constructor(eventProcessor, configService) {
@@ -4829,7 +4830,11 @@ exports.LangGraphEngine = class LangGraphEngine {
4829
4830
  if (signal) {
4830
4831
  config.signal = signal;
4831
4832
  }
4832
- const result = await graph.invoke(config.input || {}, config);
4833
+ const recursionLimit = config.recursionLimit ?? DEFAULT_RECURSION_LIMIT;
4834
+ const result = await graph.invoke(config.input || {}, {
4835
+ ...config,
4836
+ recursionLimit
4837
+ });
4833
4838
  return this.processGraphResult(result);
4834
4839
  }
4835
4840
  async streamGraph(graph, config, onPartial, signal) {
@@ -4839,10 +4844,13 @@ exports.LangGraphEngine = class LangGraphEngine {
4839
4844
  if (signal) {
4840
4845
  config.signal = signal;
4841
4846
  }
4847
+ const recursionLimit = config.recursionLimit ?? DEFAULT_RECURSION_LIMIT;
4842
4848
  const eventStream = await graph.streamEvents(config.input || {}, {
4843
4849
  ...config,
4844
- version: "v2"
4850
+ version: "v2",
4845
4851
  // Important for correct operation
4852
+ recursionLimit
4853
+ // Prevent GraphRecursionError (default is 25)
4846
4854
  });
4847
4855
  for await (const event of eventStream) {
4848
4856
  try {