agent-swarm-kit 1.1.71 → 1.1.72
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/README.md +36 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -415,6 +415,42 @@ P.S. [openai threads](https://platform.openai.com/docs/api-reference/threads) do
|
|
|
415
415
|
|
|
416
416
|
---
|
|
417
417
|
|
|
418
|
+
## 🔌 Tool and System Prompt Reflection
|
|
419
|
+
|
|
420
|
+
Enhance your LLMs with flexible, runtime-configurable tools and system prompts using `agent-swarm-kit`. The library allows you to define tools with dynamic interfaces, enabling agents to adapt their functionality based on context or agent-specific requirements. This makes it easy to integrate specialized capabilities, like fetching real-time data or generating reports, with minimal boilerplate.
|
|
421
|
+
|
|
422
|
+
**Example**: Below is a tool that dynamically fetches short-range EMA (Exponential Moving Average) signals for a trading agent, with a description tailored to the agent's display name:
|
|
423
|
+
|
|
424
|
+
```tsx
|
|
425
|
+
addTool({
|
|
426
|
+
toolName: ToolName.FetchShortRangeEmaSignals,
|
|
427
|
+
type: "function",
|
|
428
|
+
call: async ({ toolId, clientId, agentName, isLast }) => {
|
|
429
|
+
const symbol = ioc.signalMetaService.getSymbolForAgent(agentName);
|
|
430
|
+
const content =
|
|
431
|
+
await ioc.shortRangeMathService.generateShortRangeReport(symbol);
|
|
432
|
+
await commitToolOutput(toolId, content, clientId, agentName);
|
|
433
|
+
if (isLast) {
|
|
434
|
+
await execute("", clientId, agentName);
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
function: (_, agentName) => {
|
|
438
|
+
const displayName = ioc.signalMetaService.getDispayNameForAgent(agentName);
|
|
439
|
+
return {
|
|
440
|
+
name: ToolName.FetchShortRangeEmaSignals,
|
|
441
|
+
description: `Fetch a short range EMA signals table for ${displayName}.`,
|
|
442
|
+
parameters: {
|
|
443
|
+
type: "object",
|
|
444
|
+
properties: {},
|
|
445
|
+
required: [],
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
418
454
|
## ✅ Tested & Reliable
|
|
419
455
|
|
|
420
456
|
`agent-swarm-kit` comes with a robust test suite covering:
|