You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.Filter: only services that have a `settings.agent`object AND`settings.agent.description`
68
+
3.Exclude self (services matching `this.name`)
69
+
4.Build `DiscoveredAgent`object from each found service:
70
+
-`name`: service name
71
71
-`description`: `settings.agent.description`
72
-
-`actions`: az adott service action-jei közül azok neve amelyeknek van `description`mezőjük (hasonlóan ahogy az AgentMixin szűr) — DE a `run`és`chat` meta-action-öket kiszűri
73
-
5.Visszaadja a tömböt
72
+
-`actions`: action names from that service which have a `description`field (similar to how AgentMixin filters) — BUT filter out the `run`and`chat` meta-actions
73
+
5.Return the array
74
74
75
-
**FONTOS:**A Moleculer 0.15-ben a `getServiceList`a remote node-ok settings-eit is visszaadja, tehát ez elosztott környezetben is működik. Nézd meg a Moleculer 0.15 forráskódját a pontos API-ért (a broker.registry vagy broker object-en kell keresni a megfelelő metódust, pl.`this.broker.registry.getServiceList`vagy`this.broker.getLocalNodeInfo`). Ha a Moleculer 0.15 API nem egyértelmű, használd a `this.broker.call("$node.services", { withActions: true })`belső action-t ami szintén visszaadja az összes service infót.
75
+
**IMPORTANT:**In Moleculer 0.15, `getServiceList`returns settings from remote nodes as well, so this works in distributed environments. Check the Moleculer 0.15 source for the exact API (look for the appropriate method on broker.registry or broker object, e.g.`this.broker.registry.getServiceList`or`this.broker.getLocalNodeInfo`). If the Moleculer 0.15 API is unclear, use `this.broker.call("$node.services", { withActions: true })`internal action which also returns all service info.
Az OrchestratorMixin a meglévő `settings.agent` scope alá nem ad új mezőket — a`strategy`mező már létezik az `AgentSettings` interface-ben.
86
+
OrchestratorMixin does not add new fields under the existing `settings.agent` scope — the`strategy`field already exists in the `AgentSettings` interface.
87
87
88
-
### Hogyan működik az orchestrator
88
+
### How the orchestrator works
89
89
90
-
Az OrchestratorMixin-t az AgentMixin-nel és opcionálisan a MemoryMixin-nel EGYÜTT kell használni:
90
+
OrchestratorMixin must be used TOGETHER with AgentMixin and optionally MemoryMixin:
Az orchestrator service-nek lehetnek **saját action-jei** (amik tool-ként jelennek meg az LLM számára), és ezek az action-ok hívhatják a `this.delegateTo()`metódust más agent-ekhez delegáláshoz.
96
+
The orchestrator service can have **its own actions** (which appear as tools for the LLM), and these actions can call `this.delegateTo()`to delegate to other agents.
97
97
98
-
**Direct strategy példa:**
98
+
**Direct strategy example:**
99
99
```typescript
100
100
actions: {
101
101
planTrip: {
@@ -115,63 +115,63 @@ actions: {
115
115
}
116
116
```
117
117
118
-
**LLM-router strategy:**Az orchestrator `created()` hook-jában ha`settings.agent.strategy === "llm-router"`, automatikusan generál egy extra tool-t (`_routeToAgent`) az LLM számára. Ez a tool:
-Az AgentMixin ReAct loop-ja automatikusan meghívja ha az LLM úgy dönt
118
+
**LLM-router strategy:**In the orchestrator's`created()` hook, if`settings.agent.strategy === "llm-router"`, it automatically generates an extra tool (`_routeToAgent`) for the LLM. This tool:
-The AgentMixin ReAct loop automatically invokes it if the LLM decides to
123
123
124
-
A`_routeToAgent` tool description-jébe bele kell írni a felfedezett agent-ek listáját és leírását, hogy az LLM tudja melyikhez delegáljon. A discovery a `started()` hook-ban történik (amikor a többi service már regisztrált), és `$services.changed` event-re frissül.
124
+
The`_routeToAgent` tool description must include the discovered agents list and descriptions so the LLM knows which agent to delegate to. Discovery happens in the `started()` hook (when other services are already registered), and refreshes on `$services.changed` event.
125
125
126
-
## 5. Tesztelési terv
126
+
## 5. Testing plan
127
127
128
-
### Unit tesztek (`test/unit/orchestrator.mixin.spec.ts`)
128
+
### Unit tests (`test/unit/orchestrator.mixin.spec.ts`)
-**discoverAgents**: Hozz létre broker-t 3 service-szel (2 agent + 1 nem-agent), ellenőrizd hogy a `discoverAgents()`csak az agent service-eket adja vissza, és kiszűri önmagát
133
-
-**delegateTo**: Mock agent service, ellenőrizd hogy`broker.call("agent-name.run", { task })`hívódik meg
134
-
-**LLM-router _routeToAgent tool**: Ellenőrizd hogy `strategy: "llm-router"` esetén a toolSchemas tartalmaz egy`_routeToAgent` tool-t
135
-
-**Direct strategy**: Ellenőrizd hogy `strategy: "direct"` esetén NEM generálódik `_routeToAgent` tool
132
+
-**discoverAgents**: Create a broker with 3 services (2 agents + 1 non-agent), verify that `discoverAgents()`returns only the agent services and excludes self
133
+
-**delegateTo**: Mock agent service, verify that`broker.call("agent-name.run", { task })`is called
134
+
-**LLM-router _routeToAgent tool**: Verify that with `strategy: "llm-router"`, toolSchemas contains a`_routeToAgent` tool
135
+
-**Direct strategy**: Verify that with `strategy: "direct"`, NO `_routeToAgent` tool is generated
0 commit comments