Skip to content

Commit f79bf06

Browse files
committed
refactor: modify markdown append message content structure to use array format
Change the message content from a plain string to an array of objects with type and text fields to support future extensibility of message formats
1 parent 0017d29 commit f79bf06

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

app/components/chat/Markdown.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,25 @@ export const Markdown = memo(
110110
} else if (type === 'message' && append) {
111111
append({
112112
id: `quick-action-message-${Date.now()}`,
113-
content: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
113+
content: [
114+
{
115+
type: 'text',
116+
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
117+
},
118+
] as any,
114119
role: 'user',
115120
});
116121
console.log('Message appended:', message);
117122
} else if (type === 'implement' && append && setChatMode) {
118123
setChatMode('build');
119124
append({
120125
id: `quick-action-implement-${Date.now()}`,
121-
content: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
126+
content: [
127+
{
128+
type: 'text',
129+
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
130+
},
131+
] as any,
122132
role: 'user',
123133
});
124134
} else if (type === 'link' && typeof href === 'string') {

0 commit comments

Comments
 (0)