AutoDoc ChatGPT
Autodoc-ChatGPT 1.0
AutoDoc-Chatgpt是一个Python脚本,它利用ChatGpt模型的力量自动为任何编程语言生成文档。
使用Autodoc-Chatgpt,您可以轻松地为代码库生成全面的文档。只需提供您希望记录的文件的路径,AutoDoc-Chatgpt将生成其功能,参数和自然语言返回值的详细说明。
克隆此存储库到您的本地机器:
git clone https://github.com/awekrx/AutoDoc-ChatGPT.git
然后安装所需的软件包:
pip install -r requirements.txt
还有其他...
disclaimer
:Typescript和Javscript有一些错误,并且正在测试
disclaimer_2.0
:有一个已知的错误评论文件,其中有2个或多个类别具有相同名称的方法。
如果您不使用OAuth授权,则打开config.ini
并在此处添加email
和password
。否则,打开chatgpt并获取__Secure-next-auth.session-token
cookie并将其写入session-token
。
py main.py -file " path to the file "
文件的路径可以是相对的或绝对的。
执行后,文件在文件夹中使用所需的文件创建了yourfilename_commented.language
。
或者
py main.py -file " path to the file "
不建议,很少测试。您可以指定具有注释选项的文件来创建此类注释。
您也可以将其用作Python中的功能。
from modules . autodoc import AutoDoc
import configparser
config = configparser . ConfigParser ()
config . read ( "config.ini" )
auth = {
"email" : config [ "ChatGPT" ][ "email" ],
"password" : config [ "ChatGPT" ][ "password" ],
"session_token" : config [ "ChatGPT" ][ "session_token" ]
}
result = AutoDoc (
auth ,
"Code for commenting" ,
"language code" ,
"example comment model (optional)"
). start ()
print ( result )
# out: Code with comments
并不总是创建正确的评论。这并不总是意味着您想要的。用作可能需要编辑的评论草案。
该项目已根据MIT许可获得许可。
非常感谢AI的开发,并分别感谢您产生了读数。
还有Acheong08用于创建ChatGpt。