Add prompts to video generation and final message in listening audios.
This commit is contained in:
8
app.py
8
app.py
@@ -634,7 +634,11 @@ def generate_speaking_video():
|
||||
try:
|
||||
data = request.get_json()
|
||||
avatar = data.get("avatar", random.choice(list(AvatarEnum)).value)
|
||||
sp1_result = create_video(data["question"], avatar)
|
||||
prompts = data.get("prompts", [])
|
||||
question = data.get("question")
|
||||
if len(prompts) > 0:
|
||||
question = question + " In your answer you should consider: " + " ".join(prompts)
|
||||
sp1_result = create_video(question, avatar)
|
||||
if sp1_result is not None:
|
||||
sound_file_path = VIDEO_FILES_PATH + sp1_result
|
||||
firebase_file_path = FIREBASE_SPEAKING_VIDEO_FILES_PATH + sp1_result
|
||||
@@ -644,7 +648,7 @@ def generate_speaking_video():
|
||||
|
||||
return {
|
||||
"text": data["question"],
|
||||
"prompts": data["prompts"] if "prompts" in data else [],
|
||||
"prompts": prompts,
|
||||
"title": data["topic"],
|
||||
"video_url": sp1_video_url,
|
||||
"video_path": sp1_video_path,
|
||||
|
||||
Reference in New Issue
Block a user