Transport adapter for Feishu/Lark event callbacks and text replies.
aisdk::ChannelAdapter -> FeishuChannelAdapter
new()Initialize the Feishu adapter.
FeishuChannelAdapter$new(
app_id,
app_secret,
base_url = "https://open.feishu.cn",
verification_token = NULL,
encrypt_key = NULL,
verify_signature = TRUE,
send_text_fn = NULL,
send_status_fn = NULL,
download_resource_fn = NULL
)app_idFeishu app id.
app_secretFeishu app secret.
base_urlFeishu API base URL.
verification_tokenOptional callback verification token.
encrypt_keyOptional event subscription encryption key.
verify_signatureWhether to validate Feishu callback signatures when applicable.
send_text_fnOptional custom send function for tests or overrides.
send_status_fnOptional custom status function for tests or overrides.
download_resource_fnOptional custom downloader for inbound message resources.
parse_request()Parse a Feishu callback request.
FeishuChannelAdapter$parse_request(headers = NULL, body = NULL, ...)headersRequest headers.
bodyRaw JSON string or parsed list.
...Unused.
Channel request result.
resolve_session_key()Resolve a stable session key for a Feishu inbound message.
FeishuChannelAdapter$resolve_session_key(message, policy = list())messageNormalized inbound message.
policySession policy list.
Character scalar session key.
format_inbound_message()Format a Feishu inbound message for a ChatSession.
FeishuChannelAdapter$format_inbound_message(message)messageNormalized inbound message.
Character scalar prompt.
prepare_inbound_message()Prepare a Feishu inbound message using stored document context.
FeishuChannelAdapter$prepare_inbound_message(session, message)sessionCurrent ChatSession.
messageNormalized inbound message.
Enriched inbound message.
send_text()Send a final text reply to Feishu.
FeishuChannelAdapter$send_text(message, text, ...)messageOriginal normalized inbound message.
textFinal outbound text.
...Unused.
Parsed API response.
send_status()Send an intermediate status message to Feishu.
FeishuChannelAdapter$send_status(
message,
status = c("thinking", "working", "error"),
text = NULL,
...
)messageOriginal normalized inbound message.
statusStatus name.
textOptional status text.
...Unused.
Parsed API response or NULL.
send_attachment()Send a generated local attachment to Feishu.
FeishuChannelAdapter$send_attachment(message, path, ...)messageOriginal normalized inbound message.
pathAbsolute local file path.
...Unused.
Parsed API response or NULL.
clone()The objects of this class are cloneable with this method.
FeishuChannelAdapter$clone(deep = FALSE)deepWhether to make a deep clone.