GitHub

ChatAdapter

API reference for ChatAdapter.

What an adapter builds: the platform's ops, its descriptor and, when the platform has one, its native stream.

Attributes

AttributeTypeDescription
descriptorDescriptor
native_streamNativeStream | None

Functions

post

post(thread, *, markdown, reply_to=None, files=(), actions=()) -> Effect[Posted, ChatError]
ParameterTypeDescription
threadChatThread
markdownstr
reply_toReplyTo | None = None
filesSequence[File] = ()
actionsSequence[Action] = ()

Returns Effect[Posted, ChatError]

def post(
    self,
    thread: ChatThread,
    *,
    markdown: str,
    reply_to: ReplyTo | None = None,
    files: Sequence[File] = (),
    actions: Sequence[Action] = (),
) -> Effect[Posted, ChatError]: ...

edit

edit(thread, message_id, *, markdown, actions=()) -> Effect[None, ChatError]
ParameterTypeDescription
threadChatThread
message_idstr
markdownstr
actionsSequence[Action] = ()

Returns Effect[None, ChatError]

def edit(
    self, thread: ChatThread, message_id: str, *, markdown: str, actions: Sequence[Action] = ()
) -> Effect[None, ChatError]: ...

delete

delete(thread, message_id) -> Effect[None, ChatError]
ParameterTypeDescription
threadChatThread
message_idstr

Returns Effect[None, ChatError]

def delete(self, thread: ChatThread, message_id: str) -> Effect[None, ChatError]: ...

fetch_message

fetch_message(thread, message_id) -> Effect[ChatMessage, ChatError]
ParameterTypeDescription
threadChatThread
message_idstr

Returns Effect[ChatMessage, ChatError]

def fetch_message(
    self, thread: ChatThread, message_id: str
) -> Effect[ChatMessage, ChatError]: ...

history

history(thread, *, direction, from_=None) -> Stream[ChatMessage, ChatError]
ParameterTypeDescription
threadChatThread
directionDirection
from_str | None = None

Returns Stream[ChatMessage, ChatError]

def history(
    self, thread: ChatThread, *, direction: Direction, from_: str | None = None
) -> Stream[ChatMessage, ChatError]: ...

download

download(thread, attachment, *, max_bytes) -> Stream[bytes, ChatError]
ParameterTypeDescription
threadChatThread
attachmentAttachment
max_bytesint

Returns Stream[bytes, ChatError]

def download(
    self, thread: ChatThread, attachment: Attachment, *, max_bytes: int
) -> Stream[bytes, ChatError]: ...

start_thread

start_thread(thread, message_id, *, name=None) -> Effect[ChatThread, ChatError]
ParameterTypeDescription
threadChatThread
message_idstr
namestr | None = None

Returns Effect[ChatThread, ChatError]

def start_thread(
    self, thread: ChatThread, message_id: str, *, name: str | None = None
) -> Effect[ChatThread, ChatError]: ...

get_thread

get_thread(thread) -> Effect[ThreadInfo, ChatError]
ParameterTypeDescription
threadChatThread

Returns Effect[ThreadInfo, ChatError]

def get_thread(self, thread: ChatThread) -> Effect[ThreadInfo, ChatError]: ...

opener

opener(thread) -> Effect[ChatMessage | None, ChatError]
ParameterTypeDescription
threadChatThread

Returns Effect[ChatMessage | None, ChatError]

def opener(self, thread: ChatThread) -> Effect[ChatMessage | None, ChatError]: ...

get_user

get_user(id, *, in_=None) -> Effect[User, ChatError]
ParameterTypeDescription
idstr
in_ChatThread | None = None

Returns Effect[User, ChatError]

def get_user(self, id: str, *, in_: ChatThread | None = None) -> Effect[User, ChatError]: ...

follow_up

follow_up(deferred, *, markdown, actions=()) -> Effect[None, ChatError]
ParameterTypeDescription
deferredDefer
markdownstr
actionsSequence[Action] = ()

Returns Effect[None, ChatError]

def follow_up(
    self, deferred: Defer, *, markdown: str, actions: Sequence[Action] = ()
) -> Effect[None, ChatError]: ...