Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DONE] Add the AI Enhancement application (#1025)
* Create the AI Enhancement application * Add the connection to the API * Create the function to connect to the API * Create the function to get the enrichment * Create the function to get a special enrichment * Add some tests * Add unit tests & view * Fix for Flake8 * Create the AIEnrichment models & test it * Add the USE_AI_ENHANCEMENT setting * Create the function to create an enrichmenet from an URL * Create the method to get the latest version of enrichment * Create the method to get the versions of an enrichment * Create the method to get a specific version of an enrichment * Update the unit tests * Create the AI_ENRICHMENT_CLIENT_ID & AI_ENRICHMENT_SECRET settings * Add the AI button * Begin to add the AI enhancement creation * Add the init file for the migraton * Add the enrichment creation with the button * Edit the video view to use the AI if the user ask it * Create the title and description field for the choice form * Fix the admin, model & template tags * Create the view to choose AI generated or human created field for the video informations * Fix flake8 * Renomme template * Rename variable to snake case * Create the view to choose AI generated or humain created field for the transcription * Change console.error for showalert * Add the view to toggle webhook * Add redirection when the user create an ai enhancement * Add the extract_json_from_str util function * Fix the decode bug in the choice form * Fix the discipline field in the choice form * Fix flake8 * Add unit tests for the extract_json_from_str function * Put the CSS code in css file * Add the AI Enhancement app in configuration.json * Update the subtitles choice with IA * Fix flake8 * Fix the empty discipline bug * Add pydoc * Realize the TODO * Add the deletion of the enrichment at the end * Fix some problem * Add the translations * Fix flake8 * Remove the AI_ENRICHMENT_DIR setting * Add the docs for the settings * Add a line at the end of the file * Fix flake8 * Add JS Doc & remove enrich-transcript.js file * Add & rename some settings & add the settings in the file test * Update the description * Remove print * Change 'enrichment' by 'enhancement' * Fix template tags * Update forms.py * Remove unused aria-label & some blank lines * Add global docs * Move some util functions to the main package * Fix the tilte page * Change 'warning' to 'success' * Translate * Change 'Aristotle' to 'Aristote' * Add the notify for thrid-party service * Fix the link * Fix flake8 * Make the translations * Change the default value for USE_AI_ENHANCEMENT * Rename user_can_enrich_video by user_can_enhance_video * Rename enrich_video & enrich_video_json by enhance_video & enhance_video_json * Rename enrich_subtitles by enhance_subtitles * Rename enrich_form by enhance_form * Rename settings * Update test settings * Restrict AI enhancement to the staff only * Remove title * Remove aria-label * Update the create_enhancement template * Update views * Remove console.log * Update the configuration file * Update the documentation * Update str in forms * Make enhancements available for staff only * Add help texts in the AIEnhancement model * Add version * Use bootstrap * Replace str by slug * Change 'my' bu 'the' * data-bs-toggle & data-bs-placement * Remove convert_time & pad_zero function * Move the stylesheet link in the page_extra_head block * Make lang * Update translations * Compile lang * Fix some bugs * Simplify the video view * Add some imports * 🐛 Fix the create_enhancement_from_url method * Handle the errors * ✅ Add unit tests for the get_token function * Add __str__ method & sites property * Make translations * Fix flake8 * ✅ Add unit tests for the model * ✅ Add unit tests for the enhance video route * 👕 Remove unnecessary imports * Make the Badatos requested changes * Add filter dans search fields for AIEnhancement * Change ForeignKey to OneToOneField * Add AI_ENHANCEMENT_FIELDS_HELP_TEXT setting * remove protocole to fetch, maybe get url in ai-enhancement/enrich-video template * mark False as default value tu USE_AI_ENHANCEMENT * add notify user at the end of IA improvement * add translations * add restrict access to ai enhancement - remove delete ai enhancement * add signal to delete enhancement - use update or create to create one - remove delete calling from video application and remove tag to show tooltips * add link to go to subtitle part and return to video - fix link to fetch * add translation * fix translation and unit test * fix unit test and check if ai enhancement exist before deletion * remove quote from ai title and use client get uel in test view * add login in test views * fix translation * Change MP4 format to MP3 format for Aristote * 🐛 Fix the media_types tab * refactor get video mp3 url * add link to get more information about third service * Feat implement quiz in Aristote enhancement * add AI_ENHANCEMENT_CGU_URL in configuration * 🐛 Fix the keywords field * Update JSDoc * Fix review requests * Fix missing function error * Fix translations * 🚸 Remove tag when it is in input tag in Aristote form * 🚸 Modify video position in quiz page * 🚸 Improve quiz access in video page * 🚸 Add scroll when click on collapse button * use hashlib to pseudonymise user with AI * 💄 Improve ui of some quiz pages * ✨ Add the button in the Aristote page to delete the enhancement * 🎨 Improve css quiz code * 🐛 Fix an error when submitting an empty quiz * 🌐 Add translations to delete the enhancement * delete all instance of enhancement when video encoding * 🧑💻 Add filter to get a value in dict * 📝 Update PyDoc * 📝 Update version in doc * 💄 Add border color when submitting quiz * ♻️ Create function to select an element * 💄 Improve question infos when submitting * 🚸 Improve buttons in quiz page * 🎨 Move decodeString & removeAccentsAndLowerCase function in main.js * 🧑💻 Remove log * 💄 Replace success by primary * 🌐 Change IA to AI * ⚡ Add penalty when select incorrect anwer in multiple choice question * 📝 Add commentary * 🌐 Update the french translation * 🔊 Add logs * 🚨 Apply Flake8 & black * 🚑 Fix bug that prevented deleting a question in a quiz * 🚸 Add delete quiz button in aside menu in video page * ♻️ Simplify update_questions function * 🚸 Add d-none class for the deleteIpnuts * 🔥 Remove unnecessary code * fix btn secondary and translation * 🐛 Fix non-creation question * add new line at the end of file * move import quizz to utils and add redirect to quiz edit * add question id in quizz form to update or create question * replace go to by import * fix dlete and create question for quizz * fix add quizz * put the default value of create quiz to 1 and fix bug when deleting new form * play video when show reponse quiz * keep user answer when submit quizz, show question form error, add play for video player * fix extra formset to 1 * fix translation and add pydoc and improve get question to prevent exception --------- Co-authored-by: ptitloup <[email protected]> Co-authored-by: Aymeric Jakobowski <[email protected]>
- Loading branch information