@flutchai/flutch-sdk 0.1.17 → 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.js CHANGED
@@ -13,6 +13,7 @@ import * as LangGraph from '@langchain/langgraph';
13
13
  import { DynamicStructuredTool } from '@langchain/core/tools';
14
14
  import { z } from 'zod';
15
15
  import axios2 from 'axios';
16
+ import { zodToJsonSchema } from 'zod-to-json-schema';
16
17
  import { parseCallbackConfigArg, CallbackManager } from '@langchain/core/callbacks/manager';
17
18
  import { ChatOpenAI, OpenAIEmbeddings } from '@langchain/openai';
18
19
  import { AzureChatOpenAI } from '@langchain/azure-openai';
@@ -4782,6 +4783,7 @@ var EventProcessor = class {
4782
4783
  EventProcessor = __decorateClass([
4783
4784
  Injectable()
4784
4785
  ], EventProcessor);
4786
+ var DEFAULT_RECURSION_LIMIT = 40;
4785
4787
  process.setMaxListeners(0);
4786
4788
  var LangGraphEngine = class {
4787
4789
  constructor(eventProcessor, configService) {
@@ -4799,7 +4801,11 @@ var LangGraphEngine = class {
4799
4801
  if (signal) {
4800
4802
  config.signal = signal;
4801
4803
  }
4802
- const result = await graph.invoke(config.input || {}, config);
4804
+ const recursionLimit = config.recursionLimit ?? DEFAULT_RECURSION_LIMIT;
4805
+ const result = await graph.invoke(config.input || {}, {
4806
+ ...config,
4807
+ recursionLimit
4808
+ });
4803
4809
  return this.processGraphResult(result);
4804
4810
  }
4805
4811
  async streamGraph(graph, config, onPartial, signal) {
@@ -4809,10 +4815,13 @@ var LangGraphEngine = class {
4809
4815
  if (signal) {
4810
4816
  config.signal = signal;
4811
4817
  }
4818
+ const recursionLimit = config.recursionLimit ?? DEFAULT_RECURSION_LIMIT;
4812
4819
  const eventStream = await graph.streamEvents(config.input || {}, {
4813
4820
  ...config,
4814
- version: "v2"
4821
+ version: "v2",
4815
4822
  // Important for correct operation
4823
+ recursionLimit
4824
+ // Prevent GraphRecursionError (default is 25)
4816
4825
  });
4817
4826
  for await (const event of eventStream) {
4818
4827
  try {
@@ -5461,7 +5470,6 @@ ${paramDescriptions.join("\n")}`;
5461
5470
  }
5462
5471
  }
5463
5472
  try {
5464
- const { zodToJsonSchema } = __require("zod-to-json-schema");
5465
5473
  const convertedJsonSchema = zodToJsonSchema(schema);
5466
5474
  logger2.warn(
5467
5475
  `\u{1F527} [${mcpTool.name}] JSON Schema that LangChain will use:`,