This commit is contained in:
北枳 2025-08-25 01:18:16 +08:00
parent f65fe63650
commit fc19d6e25b
2 changed files with 24 additions and 19 deletions

View File

@ -314,7 +314,7 @@ function transformSystemMessage(
type: 'progress',
value: customData.completed_count,
total: customData.total_count,
label: `${customData.completed_count} 个演员,剧本中共有 ${customData.total_count}`
label: `${customData.completed_count} 个演员,共有 ${customData.total_count}`
}, {
type: 'text',
text: `\n\n${content}`
@ -337,7 +337,7 @@ function transformSystemMessage(
type: 'progress',
value: customData.completed_count,
total: customData.total_count,
label: `${customData.completed_count} 个场景,剧本中共有 ${customData.total_count}`
label: `${customData.completed_count} 个场景,共有 ${customData.total_count}`
}, {
type: 'text',
text: `\n\n${content}`
@ -360,7 +360,7 @@ function transformSystemMessage(
type: 'progress',
value: customData.completed_count,
total: customData.total_count,
label: `${customData.completed_count} 个故事板静帧,剧本中共有 ${customData.total_count}`
label: `${customData.completed_count} 个故事板静帧,共有 ${customData.total_count}`
}, {
type: 'text',
text: `\n\n${content}`
@ -387,7 +387,7 @@ function transformSystemMessage(
type: 'progress',
value: customData.completed_count,
total: customData.total_count,
label: `${customData.completed_count} 个分镜视频剧本中共有 ${customData.total_count}`
label: `${customData.completed_count} 个分镜,共有 ${customData.total_count}分镜`
}, {
type: 'text',
text: `\n\n${content}`
@ -415,19 +415,24 @@ function transformMessage(apiMessage: RealApiMessage): ChatMessage {
};
if (role === 'assistant' || role === 'user') {
const contentObj = JSON.parse(content);
const contentArray = Array.isArray(contentObj) ? contentObj : [contentObj];
contentArray.forEach((c: ApiMessageContent) => {
if (c.type === "text") {
message.blocks.push({ type: "text", text: c.content });
} else if (c.type === "image") {
message.blocks.push({ type: "image", url: c.content });
} else if (c.type === "video") {
message.blocks.push({ type: "video", url: c.content });
} else if (c.type === "audio") {
message.blocks.push({ type: "audio", url: c.content });
}
});
try {
const contentObj = JSON.parse(content);
const contentArray = Array.isArray(contentObj) ? contentObj : [contentObj];
contentArray.forEach((c: ApiMessageContent) => {
if (c.type === "text") {
message.blocks.push({ type: "text", text: c.content });
} else if (c.type === "image") {
message.blocks.push({ type: "image", url: c.content });
} else if (c.type === "video") {
message.blocks.push({ type: "video", url: c.content });
} else if (c.type === "audio") {
message.blocks.push({ type: "audio", url: c.content });
}
});
} catch (error) {
// 如果 JSON 解析失败,将整个 content 作为文本内容
message.blocks.push({ type: "text", text: content });
}
} else if (role === 'system' && function_name && custom_data) {
// 处理系统消息
message.blocks = transformSystemMessage(function_name, content, custom_data);

View File

@ -207,7 +207,7 @@ const WorkFlow = React.memo(function WorkFlow() {
autoFocus={false}
mask={false}
zIndex={49}
className="backdrop-blur-md bg-white/10 border border-white/20 shadow-xl"
className="backdrop-blur-lg bg-black/30 border border-white/20 shadow-xl"
style={{
backgroundColor: 'transparent',
borderBottomLeftRadius: 10,
@ -226,7 +226,7 @@ const WorkFlow = React.memo(function WorkFlow() {
isSmartChatBoxOpen={isSmartChatBoxOpen}
setIsSmartChatBoxOpen={setIsSmartChatBoxOpen}
projectId={episodeId}
userId={51}
userId={userId}
/>
</Drawer>