Fix avatar API to return all fields, add TMPDIR workaround to import script

- Use to_encoach_dict() for /api/exam/avatars so voiceId, voiceProvider,
  canvas are included in the response
- Set TMPDIR=/tmp in import script for PyTorch compatibility in Docker

Made-with: Cursor
This commit is contained in:
Talal Sharabi
2026-03-15 01:38:13 +04:00
parent f7c780e7e6
commit 32d987c7cf
2 changed files with 5 additions and 7 deletions

View File

@@ -208,12 +208,7 @@ class ExamsController(EncoachMixin, http.Controller):
return self._error_response('Unauthorized', 401)
avatars = request.env['encoach.elai.avatar'].sudo().search([])
data = [{
'name': a.name,
'avatar_code': a.avatar_code,
'avatar_url': a.avatar_url or '',
'gender': a.gender or '',
} for a in avatars]
data = [a.to_encoach_dict() for a in avatars]
return self._json_response(data)
except Exception:
_logger.exception("List avatars error")