agentnet 0.1.7 → 0.1.8
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/package.json +1 -1
- package/src/agent/agent-loader.js +20 -0
package/package.json
CHANGED
|
@@ -123,6 +123,7 @@ async function processV1Alpha1Definition(definition, agentBuilder, bindings) {
|
|
|
123
123
|
agentBuilder = configureStore(agentBuilder, spec.store, bindings);
|
|
124
124
|
agentBuilder = await configureLLM(agentBuilder, spec.llm);
|
|
125
125
|
agentBuilder = configureDiscoverySchemas(agentBuilder, spec.discoverySchemas);
|
|
126
|
+
agentBuilder = configureRunner(agentBuilder, spec.runner);
|
|
126
127
|
|
|
127
128
|
// Set up tools
|
|
128
129
|
const toolMap = configureTools(agentBuilder, spec.tools);
|
|
@@ -270,6 +271,25 @@ function configureTools(agentBuilder, toolsSpec) {
|
|
|
270
271
|
return toolMap;
|
|
271
272
|
}
|
|
272
273
|
|
|
274
|
+
/**
|
|
275
|
+
* Configures runner for an agent
|
|
276
|
+
* @param {object} agentBuilder - Agent builder instance
|
|
277
|
+
* @param {object} runnerSpec - Runner specification
|
|
278
|
+
* @returns {object} Updated agent builder
|
|
279
|
+
*/
|
|
280
|
+
function configureRunner(agentBuilder, runnerSpec) {
|
|
281
|
+
if (!runnerSpec) {
|
|
282
|
+
return agentBuilder;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Apply runner configuration to the agent's config
|
|
286
|
+
if (runnerSpec.maxRuns !== undefined) {
|
|
287
|
+
agentBuilder._config.runner.maxRuns = runnerSpec.maxRuns;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
return agentBuilder;
|
|
291
|
+
}
|
|
292
|
+
|
|
273
293
|
/**
|
|
274
294
|
* Creates an agent interface
|
|
275
295
|
* @param {object} agentBuilder - Agent builder instance
|