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
This commit is contained in:
KevIsDev 2025-05-30 14:45:05 +01:00
parent 0017d29154
commit f79bf06e38

View File

@ -110,7 +110,12 @@ export const Markdown = memo(
} else if (type === 'message' && append) {
append({
id: `quick-action-message-${Date.now()}`,
content: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
content: [
{
type: 'text',
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
},
] as any,
role: 'user',
});
console.log('Message appended:', message);
@ -118,7 +123,12 @@ export const Markdown = memo(
setChatMode('build');
append({
id: `quick-action-implement-${Date.now()}`,
content: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
content: [
{
type: 'text',
text: `[Model: ${model}]\n\n[Provider: ${provider?.name}]\n\n${message}`,
},
] as any,
role: 'user',
});
} else if (type === 'link' && typeof href === 'string') {