Table of Contents

Class ServiceCollectionExtensions

Namespace
JD.AI.Channels.OpenClaw
Assembly
JD.AI.Channels.OpenClaw.dll

DI registration helpers for the OpenClaw bridge channel.

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddOpenClawBridge(IServiceCollection, Action<OpenClawConfig>)

Registers OpenClawBridgeChannel as an IChannel with WebSocket JSON-RPC connectivity to an OpenClaw gateway.

public static IServiceCollection AddOpenClawBridge(this IServiceCollection services, Action<OpenClawConfig> configure)

Parameters

services IServiceCollection
configure Action<OpenClawConfig>

Returns

IServiceCollection

AddOpenClawRouting(IServiceCollection, Action<OpenClawRoutingConfig>, Func<string, string, Task<string?>>?)

Registers the OpenClaw routing infrastructure with per-channel mode configuration. Call after AddOpenClawBridge(IServiceCollection, Action<OpenClawConfig>) to enable intelligent message routing.

public static IServiceCollection AddOpenClawRouting(this IServiceCollection services, Action<OpenClawRoutingConfig> configure, Func<string, string, Task<string?>>? messageProcessor = null)

Parameters

services IServiceCollection

The service collection.

configure Action<OpenClawRoutingConfig>

Configure routing options (modes, channels, agent profiles).

messageProcessor Func<string, string, Task<string>>

Callback that processes a user message through JD.AI's agent. Parameters: (sessionKey, content) → response string.

Returns

IServiceCollection