WeixinChannel
public final class WeixinChannel implements Channel
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:47–644Weixin 渠道,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.weixin 包,实现 Channel。核心成员包括 fromProperties、create、channelId、config、init、start。
Personal Weixin adapter backed by Tencent's official iLink long-poll API.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
TYPEstaticfinal | String | 类型字段。 The TYPE field. |
方法摘要Method Summary
字段详情Field Detail
TYPE
public static final String TYPE
staticfinal
类型字段。声明为 public static final String TYPE。
The TYPE field.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:48方法详情Method Detail
fromProperties
public static WeixinChannel fromProperties(String id, ChannelConfig c, Map<String, Object> props)
static
执行来自属性相关操作。
Performs the from properties operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
c | ChannelConfig | c(类型 `ChannelConfig`)。The c. |
props | Map<String, Object> | props(类型 `Map`)。The props. |
WeixinChannel返回WeixinChannel。Returns weixin channel.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:110–131create
public static WeixinChannel create(String id, ChannelConfig config, WeixinChannelProperties properties, WeixinCredentialProvider credentialProvider, WeixinStateStore stateStore, WeixinRuntimeListener runtimeListener)
static
创建并返回实例。
Constructs a channel with host-provided credentials, state, and runtime observations.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
id | String | 标识(类型 `String`)。The id. |
config | ChannelConfig | 配置对象(类型 `ChannelConfig`)。The config. |
properties | WeixinChannelProperties | 属性(类型 `WeixinChannelProperties`)。The properties. |
credentialProvider | WeixinCredentialProvider | 凭证提供者(类型 `WeixinCredentialProvider`)。The credential provider. |
stateStore | WeixinStateStore | 状态存储(类型 `WeixinStateStore`)。The state store. |
runtimeListener | WeixinRuntimeListener | 运行时监听器(类型 `WeixinRuntimeListener`)。The runtime listener. |
WeixinChannel返回WeixinChannel。Returns weixin channel.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:134–148channelId
public String channelId()
返回渠道标识。
Returns the channel id.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:150–152config
public ChannelConfig config()
返回配置。
Returns the config.
ChannelConfig返回ChannelConfig。Returns channel config.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:154–156init
public void init(Gateway g)
初始化 WeixinChannel 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
g | Gateway | g(类型 `Gateway`)。The g. |
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:158–160start
public synchronized void start()
synchronized
执行启动相关操作。
Returns the start.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:162–169stop
public void stop()
执行停止相关操作。
Returns the stop.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:171–178dispatch
public Mono<Msg> dispatch(InboundMessage in)
设置该参数。
Performs the dispatch operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
in | InboundMessage | in(类型 `InboundMessage`)。The in. |
Mono<Msg>返回Mono。Returns mono.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:180–182deliverWithReceipt
public Mono<String> deliverWithReceipt(OutboundAddress address, Msg message, String deliveryId)
执行 deliverWithReceipt 方法。
Sends one host-persisted reply and returns the provider's receipt.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
address | OutboundAddress | address(类型 `OutboundAddress`)。The address. |
message | Msg | 消息(类型 `Msg`)。The message. |
deliveryId | String | delivery 标识(类型 `String`)。The delivery id. |
Mono<String>返回Mono。Returns mono.
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:234–247deliver
public void deliver(OutboundAddress address, List<Msg> messages)
执行 deliver 方法。
Performs the deliver operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
address | OutboundAddress | address(类型 `OutboundAddress`)。The address. |
messages | List<Msg> | 消息列表(类型 `List`)。The messages. |
源码Source
io/agentscope/extensions/channel/weixin/WeixinChannel.java:249–274