@igniter-js/agents 0.1.12 → 0.1.13

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.mjs CHANGED
@@ -1170,10 +1170,20 @@ var IgniterAgentCore = class {
1170
1170
  });
1171
1171
  }
1172
1172
  }
1173
+ const serializableTools = {};
1174
+ for (const [toolName, tool2] of Object.entries(tools)) {
1175
+ if (!tool2) continue;
1176
+ const { execute, ...toolWithoutExecute } = tool2;
1177
+ serializableTools[toolName] = {
1178
+ ...toolWithoutExecute,
1179
+ execute: tool2.execute
1180
+ // Add back the function reference, not serialized
1181
+ };
1182
+ }
1173
1183
  return new ToolLoopAgent({
1174
1184
  model: this._agent.model,
1175
1185
  instructions: this._agent.instructions ? this._agent.instructions.build(context) : "",
1176
- tools,
1186
+ tools: serializableTools,
1177
1187
  callOptionsSchema: this._agent.schema
1178
1188
  });
1179
1189
  }