feature:新增章节内容-局部重写功能,支持扩展内容

This commit is contained in:
xiamuceer-j
2026-01-29 15:33:43 +08:00
parent 997235550c
commit fe94dc3a51
7 changed files with 1314 additions and 5 deletions
+39
View File
@@ -616,6 +616,45 @@ export const chapterApi = {
completed_at: string | null;
}>;
}>(`/chapters/${chapterId}/regeneration/tasks`, { params: { limit } }),
// 局部重写相关
partialRegenerateStream: (
chapterId: string,
data: {
selected_text: string;
start_position: number;
end_position: number;
user_instructions: string;
context_chars?: number;
style_id?: number;
length_mode?: 'similar' | 'expand' | 'condense' | 'custom';
target_word_count?: number;
},
options?: SSEClientOptions
) => ssePost<{
new_text: string;
word_count: number;
original_word_count: number;
start_position: number;
end_position: number;
}>(
`/api/chapters/${chapterId}/partial-regenerate-stream`,
data,
options
),
applyPartialRegenerate: (chapterId: string, data: {
new_text: string;
start_position: number;
end_position: number;
}) =>
api.post<unknown, {
success: boolean;
chapter_id: string;
word_count: number;
old_word_count: number;
message: string;
}>(`/chapters/${chapterId}/apply-partial-regenerate`, data),
};
export const writingStyleApi = {