fix 文档管理模块 & 法规对话模块
This commit is contained in:
@@ -250,11 +250,20 @@ export const CompliancePage: React.FC = () => {
|
||||
setChatInput('');
|
||||
setChatLoading(true);
|
||||
|
||||
const segmentContext = [
|
||||
`意图:${chunk.intent}`,
|
||||
`内容:${chunk.content.slice(0, 300)}`,
|
||||
chunk.regulations.length > 0
|
||||
? `相关法规:${chunk.regulations.slice(0, 3).map(r => `${r.name}${r.clause ? ' ' + r.clause : ''}(相关性 ${Math.round(r.score * 100)}%)`).join(';')}`
|
||||
: '',
|
||||
].filter(Boolean).join('\n');
|
||||
|
||||
let currentResponse = '';
|
||||
|
||||
complianceChat(
|
||||
activeChunkId,
|
||||
chatInput,
|
||||
segmentContext,
|
||||
(data: unknown) => {
|
||||
const sseData = data as { type: string; text?: string };
|
||||
if (sseData.type === 'chunk' && sseData.text) {
|
||||
|
||||
Reference in New Issue
Block a user