Skip to content

Commit 2f53c62

Browse files
committed
fix: Fix the continuation feature
1 parent ddc0873 commit 2f53c62

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

components/EditableArea.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,9 @@ function EditableArea({ content: originalContent, isEditing, onChange, onCancel
180180
model,
181181
content,
182182
})
183+
const originalContent = content + '\n'
183184
await textStream(readableStream, (text) => {
184-
setContent((prevContent) => prevContent + text)
185+
setContent(originalContent + text)
185186
})
186187
} catch (err) {
187188
console.error(err)

utils/prompt.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ Rules and guidelines:
300300
export function continuation(content: string, systemInstruction: string = '') {
301301
return `
302302
Your task is to continue writing the following artifact.
303-
Ensure you do not change the meaning or story behind the artifact, only the continued artifact needs to be returned, without including the current artifact.
303+
Maintain the following artifact writing style, including but not limited to typesetting, punctuation, etc.
304+
Only the continued artifact needs to be returned, without including the current artifact.
304305
305306
Here is the current content of the artifact:
306307
<artifact>

0 commit comments

Comments
 (0)