There was an error while loading. Please reload this page.
1 parent e7c0123 commit c223b80Copy full SHA for c223b80
1 file changed
sites/playground/server/src/chat-template.ts
@@ -124,7 +124,14 @@ export const createChatTemplate = () => {
124
\`\`\`
125
`;
126
if (messages.length > 0 && messages[messages.length - 1].role === 'user') {
127
- messages[messages.length - 1].content += schemaJsonContext;
+ if (Array.isArray(messages[messages.length - 1].content)) {
128
+ messages[messages.length - 1].content.push({
129
+ type: 'text',
130
+ text: schemaJsonContext,
131
+ });
132
+ } else {
133
+ messages[messages.length - 1].content += schemaJsonContext;
134
+ }
135
} else {
136
messages.push({
137
role: 'user',
0 commit comments