feat: 新增AI创作中心场景,支持改写/续写/创作
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user