Problem Statement
Hey guys,
appreciate your amazing work!
Right now using e.g. the matrix (beeper) platform adapter does not allow to use the chat.openDm(userId) functionality because
|
private inferAdapterFromUserId(userId: string): Adapter { |
has a fixed set of inference rules and will throw an error because matrix adapter inference is not implemented in here.
Can't go on checking if it's even working for now..
Proposed Solution
A platform adapter should implement it's own inference rules and register it's inference rule to the chat sdk.
If an rule already exists it should be overriden or throw an exception - whatever is your opinion on that.
Alternatives Considered
Other approaches are welcome
Use Case
import { createMatrixAdapter } from "@beeper/chat-adapter-matrix";
import { Chat } from "chat";
const adapterOptions = {
baseURL: process.env.MATRIX_BASE_URL!,
auth: {
type: "accessToken",
accessToken: process.env.MATRIX_ACCESS_TOKEN!,
userID: process.env.MATRIX_USER_ID,
},
} satisfies MatrixAdapterConfig;
export const bot = new Chat({
userName: "botbotbot",
adapters: {
matrix: createMatrixAdapter(adapterOptions),
},
state: createMemoryState(),
});
await bot.initialize();
const dmThread = await bot.openDM("@user_id:matrix.org");
await dmThread.post("I'm aliveeeeee");
Priority
None
Contribution
Additional Context
No response
Problem Statement
Hey guys,
appreciate your amazing work!
Right now using e.g. the matrix (beeper) platform adapter does not allow to use the
chat.openDm(userId)functionality becausechat/packages/chat/src/chat.ts
Line 1527 in 9182017
Can't go on checking if it's even working for now..
Proposed Solution
A platform adapter should implement it's own inference rules and register it's inference rule to the chat sdk.
If an rule already exists it should be overriden or throw an exception - whatever is your opinion on that.
Alternatives Considered
Other approaches are welcome
Use Case
Priority
None
Contribution
Additional Context
No response