Base class for transport adapters that translate external messaging
events into normalized aisdk channel events.
idUnique channel identifier.
configAdapter configuration.
new()Initialize a channel adapter.
ChannelAdapter$new(id, config = list())idChannel identifier.
configAdapter configuration list.
parse_request()Parse a raw channel request.
ChannelAdapter$parse_request(headers = NULL, body = NULL, ...)headersRequest headers as a named list.
bodyRaw body as JSON string or parsed list.
...Optional transport-specific values.
A normalized parse result list.
resolve_session_key()Resolve a stable session key for an inbound message.
ChannelAdapter$resolve_session_key(message, policy = list())messageNormalized inbound message list.
policySession policy list.
Character scalar session key.
format_inbound_message()Format an inbound prompt for a ChatSession.
ChannelAdapter$format_inbound_message(message)messageNormalized inbound message list.
Character scalar prompt.
prepare_inbound_message()Prepare an inbound message using session state.
ChannelAdapter$prepare_inbound_message(session, message)sessionCurrent ChatSession.
messageNormalized inbound message list.
Possibly enriched inbound message list.
send_text()Send a final text reply back to the channel.
ChannelAdapter$send_text(message, text, ...)messageOriginal normalized inbound message.
textFinal outbound text.
...Optional adapter-specific values.
Transport-specific response.
send_status()Optionally send an intermediate status message.
ChannelAdapter$send_status(
message,
status = c("thinking", "working", "error"),
text = NULL,
...
)messageOriginal normalized inbound message.
statusStatus name such as "thinking", "working", or "error".
textOptional status text override.
...Optional adapter-specific values.
Adapter-specific status result, or NULL if unsupported.
send_attachment()Optionally send a generated local attachment.
ChannelAdapter$send_attachment(message, path, ...)messageOriginal normalized inbound message.
pathAbsolute local file path.
...Optional adapter-specific values.
Adapter-specific attachment result, or NULL if unsupported.
clone()The objects of this class are cloneable with this method.
ChannelAdapter$clone(deep = FALSE)deepWhether to make a deep clone.