Compare commits
12 Commits
release/as
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
792502be9a | ||
|
|
9f9d5608dc | ||
|
|
7212150df6 | ||
|
|
b097345c08 | ||
|
|
8144fa49ad | ||
|
|
0c28dd6aee | ||
|
|
6c156ea876 | ||
|
|
7ceade5d40 | ||
|
|
39b5d48e67 | ||
|
|
26ad153f7c | ||
|
|
7d04b144c4 | ||
|
|
111108556b |
@@ -51,13 +51,22 @@ class DependencyInjector:
|
||||
|
||||
with open('ielts_be/services/impl/third_parties/elai/avatars.json', 'r') as file:
|
||||
elai_avatars = json.load(file)
|
||||
|
||||
with open('ielts_be/services/impl/third_parties/elai/elai_conf.json', 'r') as file:
|
||||
elai_conf = json.load(file)
|
||||
"""
|
||||
|
||||
with open('ielts_be/services/impl/third_parties/heygen/avatars.json', 'r') as file:
|
||||
heygen_avatars = json.load(file)
|
||||
with open('ielts_be/services/impl/third_parties/elai/avatars.json', 'r') as file:
|
||||
elai_avatars = json.load(file)
|
||||
|
||||
with open('ielts_be/services/impl/third_parties/elai/conf.json', 'r') as file:
|
||||
elai_conf = json.load(file)
|
||||
|
||||
self._container.vid_gen = providers.Factory(
|
||||
Heygen, client=self._container.http_client, token=os.getenv("HEY_GEN_TOKEN"), avatars=heygen_avatars
|
||||
ELAI, client=self._container.http_client,
|
||||
token=os.getenv("ELAI_TOKEN"),
|
||||
avatars=elai_avatars,
|
||||
conf=elai_conf
|
||||
)
|
||||
self._container.ai_detector = providers.Factory(
|
||||
GPTZero, client=self._container.http_client, gpt_zero_key=os.getenv("GPT_ZERO_API_KEY")
|
||||
|
||||
@@ -35,14 +35,14 @@ class ELAI(IVideoGeneratorService):
|
||||
voice_provider = self._avatars[avatar].get("voice_provider")
|
||||
|
||||
self._conf["slides"][0]["canvas"]["objects"][0]["src"] = avatar_url
|
||||
self._conf["slides"]["avatar"] = {
|
||||
self._conf["slides"][0]["avatar"] = {
|
||||
"code": avatar_code,
|
||||
"gender": avatar_gender,
|
||||
"canvas": avatar_canvas
|
||||
}
|
||||
self._conf["slides"]["speech"] = text
|
||||
self._conf["slides"]["voice"] = voice_id
|
||||
self._conf["slides"]["voiceProvider"] = voice_provider
|
||||
self._conf["slides"][0]["speech"] = text
|
||||
self._conf["slides"][0]["voice"] = voice_id
|
||||
self._conf["slides"][0]["voiceProvider"] = voice_provider
|
||||
|
||||
response = await self._http_client.post(self._ELAI_ENDPOINT, headers=self._POST_HEADER, json=self._conf)
|
||||
|
||||
@@ -60,7 +60,7 @@ class ELAI(IVideoGeneratorService):
|
||||
else:
|
||||
return Task(status=TaskStatus.ERROR)
|
||||
|
||||
async def pool_status(self, video_id: str) -> Task:
|
||||
async def poll_status(self, video_id: str) -> Task:
|
||||
response = await self._http_client.get(f'{self._ELAI_ENDPOINT}/{video_id}', headers=self._GET_HEADER)
|
||||
response_data = response.json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user