Class GatewayBootstrap

java.lang.Object
io.agentscope.harness.agent.gateway.GatewayBootstrap

public final class GatewayBootstrap extends Object
Multi-agent + channel routing bootstrap. The primary user-facing entry point for building a gateway-managed agent system.

Minimal usage — single agent + ChatUI


 HarnessAgent agent = HarnessAgent.builder()
     .model(model).name("assistant").sysPrompt("You are helpful.")
     .build();

 GatewayBootstrap gw = GatewayBootstrap.builder()
     .agent("main", agent)
     .build();

 ChatUiChannel chat = gw.chatUiChannel();
 Msg reply = chat.send("hello").block();
 

Multi-agent + binding routing


 GatewayBootstrap gw = GatewayBootstrap.builder()
     .agent("sales", salesAgent)
     .agent("support", supportAgent)
     .mainAgent("sales")
     .build();

 ChannelConfig config = ChannelConfig.builder("chatui")
     .dmScope(DmScope.PER_PEER)
     .binding(ChannelBinding.forPeer("direct:vip-user-1", "support"))
     .build();

 ChatUiChannel chat = gw.chatUiChannel(config);
 chat.send("vip-user-1", "help me").block();  // routes to support agent
 chat.send("normal-user", "hi").block();      // routes to sales (default)
 

External channels


 GatewayBootstrap gw = GatewayBootstrap.builder()
     .agent("main", agent)
     .channel(mySlackChannel)
     .build();

 gw.start();   // init + start all channels
 gw.stop();    // stop all channels