File size: 1,604 Bytes
ae90eca
 
 
195cad5
 
ae90eca
 
 
5e0943c
ae90eca
5e0943c
 
 
 
 
 
 
 
 
 
 
d5436e0
ae90eca
 
d5436e0
 
ae90eca
d5436e0
ae90eca
d5436e0
ae90eca
5e0943c
 
d5436e0
ae90eca
 
195cad5
 
ae90eca
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import logging

from typing import Optional

NAME = 'Chelsea_documentation.txt'

TEMPLATE = """
Documentation. 

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 5 commands. 
They are divided into categories: finance, main, agents, RAG. 

The list of commands and their use. 

Command documentation: the user downloads a text file that describes the commands in detail. 
The information on how to use the very first and main command will be announced during the first use. 
The following list of voice commands in English is available for calling the command: "Download commands", "download commands", "load commands", "boot commands", "install commands", "commands", "load", "boot", "download", "install". 
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)