AS AgentScopeAPI 手册 / API Reference

FeishuAccessTokenProvider

public final class FeishuAccessTokenProvider
源码Source io/agentscope/extensions/channel/feishu/FeishuAccessTokenProvider.java:40–119

Feishu 访问令牌提供者,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.channel.feishu 包。核心成员包括 token、invalidate、FeishuAccessTokenProvider。

Fetches and caches a Feishu tenant_access_token for one app_id + app_secret pair. Tokens are valid for ~7200 s; this provider proactively refreshes at ~80% of TTL.

The cache defaults to a process-local InMemoryAccessTokenStore; pass a shared-storage AccessTokenStore to share tokens across instances.

构造器摘要Constructor Summary

构造器Constructor说明Description
public FeishuAccessTokenProvider(String apiBase, String appId, String appSecret)
初始化 `FeishuAccessTokenProvider` 实例。
Creates a new instance.
public FeishuAccessTokenProvider(String apiBase, String appId, String appSecret, AccessTokenStore store)
初始化 `FeishuAccessTokenProvider` 实例。
Constructor variant that lets the application choose where the token is cached — for example a shared-storage `AccessTokenStore` so one refresh or invalidation serves all instances.

方法摘要Method Summary

方法Method说明Description
public Mono<String> token()
返回令牌。
Returns a valid tenant_access_token, refreshing in-band when missing or near-expiry.
public void invalidate()
执行 `invalidate` 方法。
Forces the next `#token()` call to refresh.

构造器详情Constructor Detail

FeishuAccessTokenProvider

public FeishuAccessTokenProvider(String apiBase, String appId, String appSecret)

初始化 FeishuAccessTokenProvider 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
apiBaseStringAPI 基类(类型 `String`)。The api base.
appIdString应用标识(类型 `String`)。The app id.
appSecretString应用密钥(类型 `String`)。The app secret.
源码Source io/agentscope/extensions/channel/feishu/FeishuAccessTokenProvider.java:49–51

FeishuAccessTokenProvider

public FeishuAccessTokenProvider(String apiBase, String appId, String appSecret, AccessTokenStore store)

初始化 FeishuAccessTokenProvider 实例。

Constructor variant that lets the application choose where the token is cached — for example a shared-storage AccessTokenStore so one refresh or invalidation serves all instances.

参数Parameters
名称Name类型Type说明Description
apiBaseStringAPI 基类(类型 `String`)。The api base.
appIdString应用标识(类型 `String`)。The app id.
appSecretString应用密钥(类型 `String`)。The app secret.
storeAccessTokenStore存储实例(类型 `AccessTokenStore`)。cache for the fetched token; must be thread-safe
源码Source io/agentscope/extensions/channel/feishu/FeishuAccessTokenProvider.java:60–66

方法详情Method Detail

token

public Mono<String> token()

返回令牌。

Returns a valid tenant_access_token, refreshing in-band when missing or near-expiry.

返回Returns Mono<String>
返回Mono。Returns mono.
源码Source io/agentscope/extensions/channel/feishu/FeishuAccessTokenProvider.java:69–75

invalidate

public void invalidate()

执行 invalidate 方法。

Forces the next #token() call to refresh.

源码Source io/agentscope/extensions/channel/feishu/FeishuAccessTokenProvider.java:116–118
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.