import os import logging from typing import Optional TEMPLATE = """ A complete list of commands that are designed to facilitate the use of the voice assistant Chelsea. The complete list consists of no more than 100 commands written in a txt file. The list of commands will be updated as the assistant is developed. The first version of the programme (Arctic Monkeys) contains a total of 6 commands. The list of commands and their use. documentation command: first used to inform you how you able to interact with assistant. To call this command just say Documentation in english or Документація in Ukrainian. Note you can use assistant without those commands, however for getting more advance expirience i strongly recommend use them. bmac command: Support author on Buy Me a Coffee. To activate this command you can spell in english Buy Me A Coffee, BMAC, Coffee, Pay the ghost and in Ukrainian Кава, Заплати примарі. translate command: Use for translating speech in language which you choice. Commands to use it in english is Translate and in Ukrainian is Переклад. change model command: You able to choose model using hugging face api (hf) or local model using Llama. List of models for hf are: Mistaril and Tinyllama and for lc: Phi 3 and TinyLlama either. To call command use in english Change model and in Ukrainian Змінити модель. yes command: Command to confirm your consent. To call command use in english Yes, Yeah, Yep and in Ukrainian Так, Ага. no command: Command to confirm your disagreement. To call command use in english No, Nah and in Ukrainian Ні, Ніт, Ніц. """ def generate_doc(path: Optional[str] = None) -> Optional[str]: if path is not None: file = os.path.join(path, NAME) else: current_dir = os.path.dirname(os.path.realpath(__file__)) file = os.path.join(current_dir, NAME) logging.info(file) try: with open(file, 'w') as f: f.write(TEMPLATE) return file except IOError as e: logging.error(e)