1 Star 0 Fork 1

Sean1832 / GPT-Brain

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
initial_file_creator.py 910 Bytes
一键复制 编辑 原始数据 按行查看 历史
Sean1832 提交于 2023-02-23 20:40 . fix: cannot create API-KEYS.txt
import os
from modules import utilities as util
user_dir = r'.user'
def create():
# create brain data
util.create_json_not_exist(f'{user_dir}/brain-data.json', [])
print(f'brain data created: {user_dir}/brain-data.json')
# create brain memo
util.create_json_not_exist(f'{user_dir}/brain-memo.json',
{'note_dir': '', 'delimiter': '', 'append_mode': False, 'force_mode': False})
print(f'brain memo file created: {user_dir}/brain-memo.json')
util.create_file_not_exist(f'{user_dir}/input.txt', '')
print(f'input file created: {user_dir}/input.txt')
if not os.path.exists(f'{user_dir}/API-KEYS.txt'):
print('Create API profile...')
api_key = input('Enter your OpenAI API key: ')
util.create_file_not_exist(f'{user_dir}/API-KEYS.txt', api_key)
print(f'API key file created: {user_dir}/API-KEYS.txt')
create()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/sean1832/GPT-Brain.git
git@gitee.com:sean1832/GPT-Brain.git
sean1832
GPT-Brain
GPT-Brain
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891