feat: 新增AI创作中心场景,支持改写/续写/创作

This commit is contained in:
2026-03-03 17:06:08 +08:00
parent cc0e39cccc
commit 699362cc7d
6 changed files with 1290 additions and 1 deletions

View File

@@ -144,4 +144,38 @@ export default class StoryManager {
return null;
}
}
/**
* AI续写故事
*/
async continueStory(storyId, prompt) {
try {
const result = await post(`/stories/${storyId}/continue`, {
current_node_key: this.currentNodeKey,
prompt: prompt
});
return result;
} catch (error) {
console.error('AI续写失败:', error);
return null;
}
}
/**
* AI创作新故事
*/
async createStory(params) {
try {
const result = await post('/stories/ai-create', {
genre: params.genre,
keywords: params.keywords,
protagonist: params.protagonist,
conflict: params.conflict
});
return result;
} catch (error) {
console.error('AI创作失败:', error);
return null;
}
}
}