Avatar's can't be random on the video endpoint since these will be called in batch

This commit is contained in:
Carlos-Mesquita
2024-11-09 10:33:05 +00:00
parent e955a16abf
commit cf1b676312
4 changed files with 4 additions and 19 deletions

View File

@@ -29,12 +29,7 @@ class Heygen(IVideoGeneratorService):
self._logger = logging.getLogger(__name__)
async def create_video(self, text: str, avatar: str):
if not avatar:
random_avatar_name = random.choice(list(self._avatars.keys()))
avatar = self._avatars[random_avatar_name]["id"]
#["id"]
else:
avatar = self._avatars[avatar]["id"]
avatar = self._avatars[avatar]["id"]
create_video_url = f'https://api.heygen.com/v2/template/{avatar}/generate'
data = {