FeishuChannel
public final class FeishuChannel implements Channel
io/agentscope/extensions/channel/feishu/FeishuChannel.java:49–284Feishu 渠道,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.feishu 包,实现 Channel。核心成员包括 fromProperties、channelId、config、init、start、stop。
Feishu (飞书 / Lark) channel adapter.
Inbound: relies on Spring-managed FeishuCallbackController which receives the URL
verification handshake and event-subscription callbacks, optionally decrypts via
FeishuCrypto, deduplicates by header.event_id, runs the bot-loop guard, and
dispatches into this channel.
Outbound: uses FeishuOutboundClient to call /open-apis/im/v1/messages,
authenticating with a tenant_access_token from FeishuAccessTokenProvider.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
TYPEstaticfinal | String | 类型字段。 `type` value used in `agentscope.json` and `io.agentscope.harness.agent.gateway.channel.ChannelFactory`. |
方法摘要Method Summary
字段详情Field Detail
TYPE
public static final String TYPE
类型字段。声明为 public static final String TYPE。
type value used in agentscope.json and io.agentscope.harness.agent.gateway.channel.ChannelFactory.
io/agentscope/extensions/channel/feishu/FeishuChannel.java:54方法详情Method Detail
fromProperties
public static FeishuChannel fromProperties(String channelId, ChannelConfig routing, Map<String, Object> rawProperties)
执行来自属性相关操作。
Factory used by io.agentscope.harness.agent.gateway.channel.ChannelFactory.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(类型 `String`)。The channel id. |
routing | ChannelConfig | 路由(类型 `ChannelConfig`)。The routing. |
rawProperties | Map<String, Object> | 原始属性(类型 `Map`)。The raw properties. |
FeishuChannelio/agentscope/extensions/channel/feishu/FeishuChannel.java:101–109fromProperties
public static FeishuChannel fromProperties(String channelId, ChannelConfig routing, Map<String, Object> rawProperties, InboundEventDeduplicator idempotency)
执行来自属性相关操作。
Factory variant that lets the application supply the InboundEventDeduplicator used to drop platform redeliveries — for example a shared-storage implementation so duplicates are recognized across instances.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(类型 `String`)。The channel id. |
routing | ChannelConfig | 路由(类型 `ChannelConfig`)。The routing. |
rawProperties | Map<String, Object> | 原始属性(类型 `Map`)。The raw properties. |
idempotency | InboundEventDeduplicator | idempotency(类型 `InboundEventDeduplicator`)。deduplicator for inbound events; must be thread-safe |
FeishuChannelio/agentscope/extensions/channel/feishu/FeishuChannel.java:120–127fromProperties
public static FeishuChannel fromProperties(String channelId, ChannelConfig routing, Map<String, Object> rawProperties, InboundEventDeduplicator idempotency, AccessTokenStore tokenStore)
执行来自属性相关操作。
Factory variant that additionally lets the application supply the AccessTokenStore caching the outbound access token — for example a shared-storage implementation so one instance's refresh or invalidation serves the whole deployment.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
channelId | String | 渠道标识(密钥 in`agentscope.json#channels`)。the channel id (key in `agentscope.json#channels`) |
routing | ChannelConfig | `ChannelConfig`已解析来自文件条目's 路由块。the `ChannelConfig` parsed from the file entry's routing block |
rawProperties | Map<String, Object> | 原始属性(类型 `Map`)。provider-specific properties (appId, appSecret, encryptKey, ...) |
idempotency | InboundEventDeduplicator | idempotency(类型 `InboundEventDeduplicator`)。deduplicator for inbound events; must be thread-safe |
tokenStore | AccessTokenStore | 令牌存储(类型 `AccessTokenStore`)。cache for this channel's access token — one instance per credential, not to be shared across channels with different credentials; must be thread-safe |
FeishuChannelio/agentscope/extensions/channel/feishu/FeishuChannel.java:142–167channelId
public String channelId()
返回渠道标识。
Returns the channel id.
Stringio/agentscope/extensions/channel/feishu/FeishuChannel.java:173–176config
public ChannelConfig config()
返回配置。
Returns the config.
ChannelConfigio/agentscope/extensions/channel/feishu/FeishuChannel.java:178–181init
public void init(Gateway gateway)
初始化 FeishuChannel 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
gateway | Gateway | 网关(类型 `Gateway`)。The gateway. |
io/agentscope/extensions/channel/feishu/FeishuChannel.java:183–188start
public void start()
执行启动相关操作。
Returns the start.
io/agentscope/extensions/channel/feishu/FeishuChannel.java:190–199stop
public void stop()
执行停止相关操作。
Returns the stop.
io/agentscope/extensions/channel/feishu/FeishuChannel.java:201–205dispatch
public Mono<Msg> dispatch(InboundMessage message)
设置该参数。
Performs the dispatch operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | InboundMessage | 消息(类型 `InboundMessage`)。The message. |
Mono<Msg>io/agentscope/extensions/channel/feishu/FeishuChannel.java:207–223deliverWithReceipt
public Mono<String> deliverWithReceipt(OutboundAddress address, Msg message, String deliveryId)
执行 deliverWithReceipt 方法。
Performs the deliver with receipt operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
address | OutboundAddress | address(类型 `OutboundAddress`)。The address. |
message | Msg | 消息(类型 `Msg`)。The message. |
deliveryId | String | delivery 标识(类型 `String`)。The delivery id. |
Mono<String>io/agentscope/extensions/channel/feishu/FeishuChannel.java:225–229deliver
public void deliver(OutboundAddress address, List<Msg> messages)
执行 deliver 方法。
Performs the deliver operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
address | OutboundAddress | address(类型 `OutboundAddress`)。The address. |
messages | List<Msg> | 消息列表(类型 `List`)。The messages. |
io/agentscope/extensions/channel/feishu/FeishuChannel.java:231–245