mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 12:06:35 +08:00
feat: split individual semantic change (#13155)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Introduced a new AI-powered document update feature, allowing users to apply multiple independent block-level edits to Markdown documents. * Added support for applying document updates via a new GraphQL query, enabling seamless integration with the frontend. * **Enhancements** * Improved the document editing tool to handle and display multiple simultaneous edit operations with better UI feedback and state management. * Expanded model support with new "morph-v3-fast" and "morph-v3-large" options for document update operations. * Enhanced frontend components and services to support asynchronous application and acceptance of multiple document edits independently. * **Bug Fixes** * Enhanced error handling and user notifications for failed document update operations. * **Documentation** * Updated tool descriptions and examples to clarify the new multi-edit workflow and expected input/output formats. <!-- end of auto-generated comment: release notes by coderabbit.ai --> > CLOSE AI-337
This commit is contained in:
@@ -472,10 +472,18 @@ export class TextStreamParser {
|
||||
result = this.addPrefix(result);
|
||||
switch (chunk.toolName) {
|
||||
case 'doc_edit': {
|
||||
if (chunk.result && typeof chunk.result === 'object') {
|
||||
result += `\n${chunk.result.result}\n`;
|
||||
if (
|
||||
chunk.result &&
|
||||
typeof chunk.result === 'object' &&
|
||||
Array.isArray(chunk.result.result)
|
||||
) {
|
||||
result += chunk.result.result
|
||||
.map(item => {
|
||||
return `\n${item.changedContent}\n`;
|
||||
})
|
||||
.join('');
|
||||
this.docEditFootnotes[this.docEditFootnotes.length - 1].result =
|
||||
chunk.result.result;
|
||||
result;
|
||||
} else {
|
||||
this.docEditFootnotes.pop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user