feature:新增章节内容-局部重写功能,支持扩展内容
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user