@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.cjs +12 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -15,6 +15,7 @@ var LangGraph = require('@langchain/langgraph');
|
|
|
15
15
|
var tools = require('@langchain/core/tools');
|
|
16
16
|
var zod = require('zod');
|
|
17
17
|
var axios2 = require('axios');
|
|
18
|
+
var zodToJsonSchema = require('zod-to-json-schema');
|
|
18
19
|
var manager = require('@langchain/core/callbacks/manager');
|
|
19
20
|
var openai = require('@langchain/openai');
|
|
20
21
|
var azureOpenai = require('@langchain/azure-openai');
|
|
@@ -4811,6 +4812,7 @@ exports.EventProcessor = class EventProcessor {
|
|
|
4811
4812
|
exports.EventProcessor = __decorateClass([
|
|
4812
4813
|
common.Injectable()
|
|
4813
4814
|
], exports.EventProcessor);
|
|
4815
|
+
var DEFAULT_RECURSION_LIMIT = 40;
|
|
4814
4816
|
process.setMaxListeners(0);
|
|
4815
4817
|
exports.LangGraphEngine = class LangGraphEngine {
|
|
4816
4818
|
constructor(eventProcessor, configService) {
|
|
@@ -4828,7 +4830,11 @@ exports.LangGraphEngine = class LangGraphEngine {
|
|
|
4828
4830
|
if (signal) {
|
|
4829
4831
|
config.signal = signal;
|
|
4830
4832
|
}
|
|
4831
|
-
const
|
|
4833
|
+
const recursionLimit = config.recursionLimit ?? DEFAULT_RECURSION_LIMIT;
|
|
4834
|
+
const result = await graph.invoke(config.input || {}, {
|
|
4835
|
+
...config,
|
|
4836
|
+
recursionLimit
|
|
4837
|
+
});
|
|
4832
4838
|
return this.processGraphResult(result);
|
|
4833
4839
|
}
|
|
4834
4840
|
async streamGraph(graph, config, onPartial, signal) {
|
|
@@ -4838,10 +4844,13 @@ exports.LangGraphEngine = class LangGraphEngine {
|
|
|
4838
4844
|
if (signal) {
|
|
4839
4845
|
config.signal = signal;
|
|
4840
4846
|
}
|
|
4847
|
+
const recursionLimit = config.recursionLimit ?? DEFAULT_RECURSION_LIMIT;
|
|
4841
4848
|
const eventStream = await graph.streamEvents(config.input || {}, {
|
|
4842
4849
|
...config,
|
|
4843
|
-
version: "v2"
|
|
4850
|
+
version: "v2",
|
|
4844
4851
|
// Important for correct operation
|
|
4852
|
+
recursionLimit
|
|
4853
|
+
// Prevent GraphRecursionError (default is 25)
|
|
4845
4854
|
});
|
|
4846
4855
|
for await (const event of eventStream) {
|
|
4847
4856
|
try {
|
|
@@ -5490,8 +5499,7 @@ ${paramDescriptions.join("\n")}`;
|
|
|
5490
5499
|
}
|
|
5491
5500
|
}
|
|
5492
5501
|
try {
|
|
5493
|
-
const
|
|
5494
|
-
const convertedJsonSchema = zodToJsonSchema(schema);
|
|
5502
|
+
const convertedJsonSchema = zodToJsonSchema.zodToJsonSchema(schema);
|
|
5495
5503
|
logger2.warn(
|
|
5496
5504
|
`\u{1F527} [${mcpTool.name}] JSON Schema that LangChain will use:`,
|
|
5497
5505
|
JSON.stringify(convertedJsonSchema, null, 2)
|