Skip to content

Commit 7e5b354

Browse files
authored
fix: AI generation with empty document (#1740)
* fix: AI generate with empty document * missing files
1 parent accb2a6 commit 7e5b354

File tree

285 files changed

+1684
-1935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+1684
-1935
lines changed

packages/xl-ai/src/api/LLMRequest.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,10 @@ export async function doLLMRequest(
152152
: editor.getTextCursorPosition().block;
153153

154154
const deleteCursorBlock: string | undefined =
155-
cursorBlock && deleteEmptyCursorBlock && isEmptyParagraph(cursorBlock)
155+
cursorBlock &&
156+
deleteEmptyCursorBlock &&
157+
isEmptyParagraph(cursorBlock) &&
158+
editor.document.length > 1
156159
? cursorBlock.id
157160
: undefined;
158161

packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/Add heading (h1) and code block_1_112bacb4ae22459e8e8b87c510a5a1ab.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add a list (end)_1_fd2cdf7edb597b5eee87ae1b4c9d8a9e.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add a new paragraph (end)_1_f9f8cec49b3218519501c03ff5c4a3ba.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Add/__msw_snapshots__/albert-etalab.chat/neuralmagic/Meta-Llama-3.1-70B-Instruct-FP8 (non-streaming)/add a new paragraph (start)_1_d152c585ba7d2fa6e68b1d4b063f266c.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)