feat: add title field to synopsis generation requests and update synopsis generation logic
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import apiClient from '@/lib/api'
|
||||
|
||||
export interface SynopsisGenerationRequest {
|
||||
title: string
|
||||
genre: string
|
||||
subgenre?: string
|
||||
protagonist_type?: string
|
||||
@@ -83,6 +84,7 @@ export interface LLMConfig {
|
||||
}
|
||||
|
||||
export interface NsfwSynopsisGenerationRequest {
|
||||
title: string
|
||||
genre: string
|
||||
subgenre?: string
|
||||
protagonist_type?: string
|
||||
|
||||
@@ -547,10 +547,12 @@ function AIScriptDialog({ open, onClose, onCreated }: { open: boolean; onClose:
|
||||
}
|
||||
|
||||
const handleGenerateSynopsis = async () => {
|
||||
if (!title) { toast.error('请输入作品标题'); return }
|
||||
if (!genre) { toast.error('请选择故事类型'); return }
|
||||
setGeneratingSynopsis(true)
|
||||
try {
|
||||
const result = await audiobookApi.generateSynopsis({
|
||||
title,
|
||||
genre: subgenre ? `${genre} - ${subgenre}` : genre,
|
||||
subgenre,
|
||||
protagonist_type: protagonistType,
|
||||
@@ -780,10 +782,12 @@ function NSFWScriptDialog({ open, onClose, onCreated }: { open: boolean; onClose
|
||||
}
|
||||
|
||||
const handleGenerateSynopsis = async () => {
|
||||
if (!title) { toast.error('请输入作品标题'); return }
|
||||
if (!genre) { toast.error('请选择故事类型'); return }
|
||||
setGeneratingSynopsis(true)
|
||||
try {
|
||||
const result = await audiobookApi.generateNsfwSynopsis({
|
||||
title,
|
||||
genre: subgenre ? `${genre} - ${subgenre}` : genre,
|
||||
subgenre,
|
||||
protagonist_type: protagonistType,
|
||||
|
||||
Reference in New Issue
Block a user