forked from bai/curriculum-project-hub
fix(hub): 保留飞书回复上下文
This commit is contained in:
@@ -24,11 +24,14 @@ interface LarkMessage {
|
||||
message_id?: string;
|
||||
msg_type?: string;
|
||||
content?: string;
|
||||
body?: { content?: string };
|
||||
create_time?: string;
|
||||
sender?: { id?: string; sender_type?: string };
|
||||
chat_id?: string;
|
||||
parent_id?: string;
|
||||
parent_message_id?: string;
|
||||
root_id?: string;
|
||||
thread_id?: string;
|
||||
}
|
||||
|
||||
interface ImV1Message {
|
||||
@@ -84,14 +87,17 @@ export async function readFeishuContext(
|
||||
|
||||
/** Project a lark message down to the fields the model actually needs. */
|
||||
function compact(m: LarkMessage): Record<string, unknown> {
|
||||
const parentId = m.parent_id ?? m.parent_message_id;
|
||||
return {
|
||||
message_id: m.message_id,
|
||||
msg_type: m.msg_type,
|
||||
content: m.content,
|
||||
content: m.body?.content ?? m.content,
|
||||
create_time: m.create_time,
|
||||
chat_id: m.chat_id,
|
||||
sender_id: m.sender?.id,
|
||||
parent_message_id: m.parent_message_id,
|
||||
parent_id: parentId,
|
||||
parent_message_id: parentId,
|
||||
root_id: m.root_id,
|
||||
thread_id: m.thread_id,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user