feat: AI 对话支持 A2UI 表单/审查/图表与 Agent 工具
This commit is contained in:
@@ -28,14 +28,6 @@ const ACCEPTED_MIME_TYPES = new Set([
|
||||
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
]);
|
||||
|
||||
interface MammothResult {
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface MammothModule {
|
||||
extractRawText(input: { buffer: Buffer }): Promise<MammothResult>;
|
||||
}
|
||||
|
||||
export interface AiAttachmentModelPart {
|
||||
attachment: AiAttachment;
|
||||
text?: string;
|
||||
@@ -218,7 +210,7 @@ export class AiAttachmentService {
|
||||
}
|
||||
}
|
||||
if (mimeType.includes('wordprocessingml')) {
|
||||
const mammoth = (await import('mammoth')) as unknown as MammothModule;
|
||||
const mammoth = await import('mammoth');
|
||||
const result = await mammoth.extractRawText({ buffer });
|
||||
return this.normalizeExtractedText(result.value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user