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