27
aiyunos.pyw
Normal file
27
aiyunos.pyw
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
from PyQt5.QtCore import QUrl
|
||||||
|
from PyQt5.QtWidgets import QApplication, QMainWindow, QToolBar, QAction
|
||||||
|
from PyQt5.QtWebEngineWidgets import QWebEngineView
|
||||||
|
|
||||||
|
class BrowserWindow(QMainWindow):
|
||||||
|
def __init__(self):
|
||||||
|
super().__init__()
|
||||||
|
self.setWindowTitle("Chat Browser")
|
||||||
|
self.setGeometry(100, 100, 800, 600)
|
||||||
|
|
||||||
|
# Create the QWebEngineView widget
|
||||||
|
self.web_view = QWebEngineView(self)
|
||||||
|
self.web_view.load(QUrl("https://chat2.aiyunos.top"))
|
||||||
|
self.setCentralWidget(self.web_view)
|
||||||
|
|
||||||
|
# Create the QToolBar widget and add a QAction for the refresh button
|
||||||
|
toolbar = QToolBar(self)
|
||||||
|
self.addToolBar(toolbar)
|
||||||
|
refresh_action = QAction("Refresh", self)
|
||||||
|
refresh_action.triggered.connect(self.web_view.reload)
|
||||||
|
toolbar.addAction(refresh_action)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app = QApplication([])
|
||||||
|
window = BrowserWindow()
|
||||||
|
window.show()
|
||||||
|
app.exec_()
|
||||||
47
chat_command.py
Normal file
47
chat_command.py
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import openai
|
||||||
|
import os
|
||||||
|
from time import sleep
|
||||||
|
import sys
|
||||||
|
|
||||||
|
ml = os.getcwd()
|
||||||
|
file_path = os.path.join(ml, "api_key.txt")
|
||||||
|
|
||||||
|
# 设置openai库的API认证密钥
|
||||||
|
def api_key():
|
||||||
|
input1 = input("请输入API_key:")
|
||||||
|
if input1 == None:
|
||||||
|
print('error: Not input')
|
||||||
|
sleep(4)
|
||||||
|
sys.exit()
|
||||||
|
else:
|
||||||
|
openai.api_key = input1
|
||||||
|
|
||||||
|
# 设置GPT-3.5模型的引擎ID
|
||||||
|
model_engine = 'text-davinci-003'
|
||||||
|
|
||||||
|
# 循环读入用户输入并输出聊天结果
|
||||||
|
def input_print():
|
||||||
|
while True:
|
||||||
|
# 获取用户输入
|
||||||
|
prompt = input("你好,请问有什么需要帮助的吗?\n")
|
||||||
|
|
||||||
|
# 调用openai.ChatCompletion.create()方法来获取聊天结果
|
||||||
|
response = openai.Completion.create(
|
||||||
|
engine='text-davinci-003',
|
||||||
|
prompt=prompt,
|
||||||
|
temperature=0.7,
|
||||||
|
max_tokens=210,
|
||||||
|
top_p=1,
|
||||||
|
frequency_penalty=0,
|
||||||
|
presence_penalty=0
|
||||||
|
)
|
||||||
|
result = response['choices'][0]['text'].strip()
|
||||||
|
print(f"chatGPT:{result}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print('注意,本程序是测试程序,如有问题,非常正常')
|
||||||
|
sleep(2)
|
||||||
|
api_key()
|
||||||
|
# 设置GPT-3.5模型的引擎ID
|
||||||
|
model_engine = 'text-davinci-003'
|
||||||
|
input_print()
|
||||||
@@ -5,12 +5,12 @@ from PyQt5.QtWebEngineWidgets import QWebEngineView
|
|||||||
class BrowserWindow(QMainWindow):
|
class BrowserWindow(QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.setWindowTitle("Chat Browser")
|
self.setWindowTitle("AI Browser")
|
||||||
self.setGeometry(100, 100, 800, 600)
|
self.setGeometry(100, 100, 800, 600)
|
||||||
|
|
||||||
# Create the QWebEngineView widget and set the URL to "https://chat.extkj.cn"
|
# Create the QWebEngineView widget and set the URL to "https://nav.chatkey.top/"
|
||||||
self.web_view = QWebEngineView(self)
|
self.web_view = QWebEngineView(self)
|
||||||
self.web_view.load(QUrl("https://chat.extkj.cn"))
|
self.web_view.load(QUrl("https://nav.chatkey.top/"))
|
||||||
self.setCentralWidget(self.web_view)
|
self.setCentralWidget(self.web_view)
|
||||||
|
|
||||||
# Create the QToolBar widget and add a QAction for the refresh button
|
# Create the QToolBar widget and add a QAction for the refresh button
|
||||||
26
client.pyw
26
client.pyw
@@ -3,12 +3,15 @@ from tkinter import *
|
|||||||
from tkinter import messagebox
|
from tkinter import messagebox
|
||||||
from time import sleep
|
from time import sleep
|
||||||
import sys
|
import sys
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
# Define constants
|
# Define constants
|
||||||
CURRENT_DIR = os.getcwd()
|
CURRENT_DIR = os.getcwd()
|
||||||
FILE_ERROR = '文件丢失,请检查文件内容并重新安装'
|
FILE_ERROR = '文件丢失,请检查文件内容并重新安装'
|
||||||
|
task = f'taskkill -f -t -im '
|
||||||
|
|
||||||
# Define functions
|
''' Define functions
|
||||||
|
程序文件检测'''
|
||||||
def open_exe(exe_name):
|
def open_exe(exe_name):
|
||||||
if os.path.exists(os.path.join(CURRENT_DIR, f"{exe_name}.exe")):
|
if os.path.exists(os.path.join(CURRENT_DIR, f"{exe_name}.exe")):
|
||||||
os.system(f"start {exe_name}.exe")
|
os.system(f"start {exe_name}.exe")
|
||||||
@@ -29,9 +32,9 @@ def update():
|
|||||||
open_exe("update")
|
open_exe("update")
|
||||||
|
|
||||||
def quit_exe():
|
def quit_exe():
|
||||||
os.system('taskkill -f -t -im qdymys.exe')
|
os.system('taskkill -f -t -im free2gpt.exe')
|
||||||
os.system('taskkill -f -t -im wuguokai.exe')
|
os.system('taskkill -f -t -im wuguokai.exe')
|
||||||
os.system('taskkill -f -t -im extkj.exe')
|
os.system('taskkill -f -t -im chatkey.exe')
|
||||||
os.system('taskkill -f -t -im bnu120.exe')
|
os.system('taskkill -f -t -im bnu120.exe')
|
||||||
os.system('taskkill -f -t -im 1chat.exe')
|
os.system('taskkill -f -t -im 1chat.exe')
|
||||||
os.system('taskkill -f -t -im chat_command.exe')
|
os.system('taskkill -f -t -im chat_command.exe')
|
||||||
@@ -39,29 +42,28 @@ def quit_exe():
|
|||||||
os.system('taskkill -f -t -im update.exe')
|
os.system('taskkill -f -t -im update.exe')
|
||||||
os.system('taskkill -f -t -im xz_chat.exe')
|
os.system('taskkill -f -t -im xz_chat.exe')
|
||||||
os.system('taskkill -f -t -im xz_main.exe')
|
os.system('taskkill -f -t -im xz_main.exe')
|
||||||
|
os.system('taskkill -f -t -im ol_web.exe')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
def jc():
|
def ol_web():
|
||||||
messagebox.showerror('system', '检测程序暂时无法使用!!!(应该以后都不会写完了......)')
|
messagebox.showwarning("Warning","这个程序为测试版,如有问题,请马上反馈!")
|
||||||
pass
|
open_exe('ol_web')
|
||||||
|
|
||||||
def gk():
|
|
||||||
open_exe("gk")
|
|
||||||
|
|
||||||
|
|
||||||
# Create GUI
|
# Create GUI
|
||||||
root = Tk()
|
root = Tk()
|
||||||
root.title('chatGPT')
|
root.title('chatWEB')
|
||||||
root.geometry('200x200+400+400')
|
root.geometry('200x200+400+400')
|
||||||
Label(root, text='chatGPT').pack()
|
Label(root, text='chatGPT').pack()
|
||||||
|
|
||||||
bt_web_xz = Button(root, text='网站选择', command=web_xz)
|
bt_web_xz = Button(root, text='网站选择', command=web_xz)
|
||||||
|
ol_web_b = Button(root ,text='官方网站', command=ol_web)
|
||||||
quit_bt = Button(root, text='退出', command=quit_exe)
|
quit_bt = Button(root, text='退出', command=quit_exe)
|
||||||
|
|
||||||
Label(root, text='chatWEB')
|
Label(root, text='chatWEB')
|
||||||
bt_web_xz.pack()
|
bt_web_xz.pack()
|
||||||
|
ol_web_b.pack()
|
||||||
quit_bt.pack()
|
quit_bt.pack()
|
||||||
Label(root,text='version 1.3 @2023-2024 dengrb1').pack()
|
Label(root,text='version 1.4 @2023-2024 dengrb1').pack()
|
||||||
|
|
||||||
# mainloop
|
# mainloop
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
@@ -10,7 +10,7 @@ class BrowserWindow(QMainWindow):
|
|||||||
|
|
||||||
# Create the QWebEngineView widget
|
# Create the QWebEngineView widget
|
||||||
self.web_view = QWebEngineView(self)
|
self.web_view = QWebEngineView(self)
|
||||||
self.web_view.load(QUrl("https://chatgpt.qdymys.cn/"))
|
self.web_view.load(QUrl("https://chatc.free2gpt.xyz/"))
|
||||||
self.setCentralWidget(self.web_view)
|
self.setCentralWidget(self.web_view)
|
||||||
|
|
||||||
# Create the QToolBar widget and add a QAction for the refresh button
|
# Create the QToolBar widget and add a QAction for the refresh button
|
||||||
39
ol_web.pyw
Normal file
39
ol_web.pyw
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import os
|
||||||
|
import webbrowser
|
||||||
|
from tkinter import *
|
||||||
|
from tkinter import messagebox
|
||||||
|
import sys
|
||||||
|
|
||||||
|
root = Tk()
|
||||||
|
ml = os.getcwd()
|
||||||
|
|
||||||
|
|
||||||
|
# def
|
||||||
|
def china_github():
|
||||||
|
webbrowser.open('https://kgithub.com/dengrb1/chatgpt')
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
def github():
|
||||||
|
webbrowser.open('https://github.com/dengrb1/chatgpt')
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
def quit_exe():
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
|
# Button
|
||||||
|
cg_b = Button(root, text='国内镜像官网', command=china_github)
|
||||||
|
g_b = Button(root , text='国外官网', command=github)
|
||||||
|
q_b = Button(root ,text='返回', command=quit_exe)
|
||||||
|
|
||||||
|
# pack
|
||||||
|
Label(root , text='官网').pack()
|
||||||
|
cg_b.pack()
|
||||||
|
g_b.pack()
|
||||||
|
q_b.pack()
|
||||||
|
|
||||||
|
|
||||||
|
# mainloop
|
||||||
|
root.title('chatWEB')
|
||||||
|
root.geometry('200x220')
|
||||||
|
root.mainloop()
|
||||||
38
update.pyw
38
update.pyw
@@ -17,11 +17,13 @@ def quit_exe():
|
|||||||
def update_now():
|
def update_now():
|
||||||
webbrowser.open("https://kgithub.com/dengrb1/chatgpt/releases/")
|
webbrowser.open("https://kgithub.com/dengrb1/chatgpt/releases/")
|
||||||
messagebox.showinfo('update', '请选择最新版本并下载运行安装程序,然后就可以更新了!')
|
messagebox.showinfo('update', '请选择最新版本并下载运行安装程序,然后就可以更新了!')
|
||||||
def downloads_update_now():
|
'''def downloads_update_now():
|
||||||
if os.path.exists(os.path.join(ml, "downloads_update_now.exe")):
|
if os.path.exists(os.path.join(ml, "downloads_update_now.exe")):
|
||||||
os.startfile("downloads_update_now")
|
os.startfile("downloads_update_now")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
messagebox.showerror(':( error','在线更新模块错误:文件不存在')
|
messagebox.showerror(':( error','在线更新模块错误:文件不存在')
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
# Label
|
# Label
|
||||||
@@ -29,22 +31,27 @@ update_now_bt = Button(root ,text='在线更新', command=update_now).pack(side=
|
|||||||
quit_bt = Button(root, text='返回', command=quit_exe).pack(side=RIGHT)
|
quit_bt = Button(root, text='返回', command=quit_exe).pack(side=RIGHT)
|
||||||
Label(root, text='更新日志').pack()
|
Label(root, text='更新日志').pack()
|
||||||
text = '''
|
text = '''
|
||||||
当前版本:1.3 (Not beta or demo)
|
当前版本:1.4 (Not beta or demo)
|
||||||
|
|
||||||
|
1.4 加入aiyunos、free2gpt、chatkey网站;删除qdymys、extkj等网站;加入在程序内
|
||||||
|
访问官网,加入cmd版本的chatGPT(测试版);修复一些很明显的BUG
|
||||||
|
|
||||||
0.1.0 DEMO制作完成
|
|
||||||
0.1.1 demo版本增加lbbAI网站
|
|
||||||
0.1.2 demo版本删除lbbAI网站,因为无法使用
|
|
||||||
0.1.3 修复BUG
|
|
||||||
1.0 加入关于模块,更新网站aitianhu.top;修复“退出”按钮
|
|
||||||
的问题
|
|
||||||
1.0.1 修复BUG:移除“检查文件完整度”程序使用
|
|
||||||
(可以在github仓库的old文件夹里面看;修复其他BUG......
|
|
||||||
1.1 修复BUG;紧急修复Windows7无法使用情况!;重新修正UI界面
|
|
||||||
1.1.1 更新chatGPT网站;修改update文本显示设置。新增bnu120聊天网站
|
|
||||||
移除lbbai网站入口
|
|
||||||
1.2 增加lbbai网站;修复BUG;完全移除“关于”模块......
|
|
||||||
1.3 删除lbbai网站;增加1chat网站,里面内涵AI画图功能!;加入WiFi功能
|
1.3 删除lbbai网站;增加1chat网站,里面内涵AI画图功能!;加入WiFi功能
|
||||||
检测;加入在线更新功能
|
检测;加入在线更新功能
|
||||||
|
|
||||||
|
1.2 增加lbbai网站;修复BUG;完全移除“关于”模块......
|
||||||
|
|
||||||
|
1.1.1 更新chatGPT网站;修改update文本显示设置。新增bnu120聊天网站
|
||||||
|
1.1 修复BUG;紧急修复Windows7无法使用情况!;重新修正UI界面
|
||||||
|
|
||||||
|
1.0.1 修复BUG:移除“检查文件完整度”程序使用
|
||||||
|
1.0 加入关于模块,更新网站aitianhu.top;修复“退出”按钮
|
||||||
|
的问题
|
||||||
|
|
||||||
|
0.1.3 修复BUG
|
||||||
|
0.1.2 demo版本删除lbbAI网站,因为无法使用
|
||||||
|
0.1.1 demo版本增加lbbAI网站
|
||||||
|
0.1 DEMO制作完成
|
||||||
'''
|
'''
|
||||||
|
|
||||||
text_box = ScrolledText(root)
|
text_box = ScrolledText(root)
|
||||||
@@ -55,10 +62,9 @@ text_box.configure(state='disabled')
|
|||||||
|
|
||||||
# Button
|
# Button
|
||||||
quit_bt = Button(root, text='返回', command=quit_exe).pack()
|
quit_bt = Button(root, text='返回', command=quit_exe).pack()
|
||||||
update_now_bt = Button(root, text='在线更新', command=downloads_update_now).pack()
|
update_now_bt = Button(root, text='在线更新', command=update_now).pack()
|
||||||
|
|
||||||
# mainloop
|
# mainloop
|
||||||
root.title('更新日志')
|
root.title('更新日志')
|
||||||
root.geometry('355x250+400+400')
|
root.geometry('355x250+400+400')
|
||||||
downloads_update_now()
|
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|||||||
26
xz_chat.pyw
26
xz_chat.pyw
@@ -35,39 +35,39 @@ def open_exe(exe_name):
|
|||||||
os.system(f"start {exe_name}.exe")
|
os.system(f"start {exe_name}.exe")
|
||||||
else:
|
else:
|
||||||
messagebox.showerror('system', file_error)
|
messagebox.showerror('system', file_error)
|
||||||
def extkj():
|
def aiyunos():
|
||||||
open_exe("extkj")
|
open_exe("aiyunos")
|
||||||
def wuguokai():
|
def wuguokai():
|
||||||
open_exe("wuguokai")
|
open_exe("wuguokai")
|
||||||
def qdymys():
|
def chatkey():
|
||||||
open_exe("qdymys")
|
open_exe("chatkey")
|
||||||
def bnu120():
|
def bnu120():
|
||||||
open_exe('bnu120')
|
open_exe('bnu120')
|
||||||
def xjai():
|
def free2gpt():
|
||||||
open_exe('xjai')
|
open_exe('free2gpt')
|
||||||
def fh():
|
def fh():
|
||||||
root.destroy()
|
root.destroy()
|
||||||
|
|
||||||
|
|
||||||
# Button
|
# Button
|
||||||
bt_wuguokai = Button(frame, text='wuguokai网站', command=wuguokai)
|
bt_wuguokai = Button(frame, text='wuguokai网站', command=wuguokai)
|
||||||
bt_extkj = Button(frame, text='extkj网站', command=extkj)
|
bt_aiyunos = Button(frame, text='aiyunos网站', command=aiyunos)
|
||||||
bt_qdymys = Button(frame, text='qdymys网站', command=qdymys)
|
bt_chatkey = Button(frame, text='chatkey网站', command=chatkey)
|
||||||
bt_xjai = Button(frame, text='xjai网站', command=xjai)
|
bt_free2gpt = Button(frame, text='free2gpt网站', command=free2gpt)
|
||||||
bt_bnu120 = Button(frame, text='bnu120网站', command=bnu120)
|
bt_bnu120 = Button(frame, text='bnu120网站', command=bnu120)
|
||||||
bt_fh = Button(frame, text='返回', command=fh)
|
bt_fh = Button(frame, text='返回', command=fh)
|
||||||
|
|
||||||
# pack and Label
|
# pack and Label
|
||||||
Label(root, text='选择界面').pack()
|
Label(root, text='选择界面').pack()
|
||||||
bt_wuguokai.pack()
|
bt_wuguokai.pack()
|
||||||
bt_extkj.pack()
|
bt_aiyunos.pack()
|
||||||
bt_xjai.pack()
|
bt_free2gpt.pack()
|
||||||
bt_qdymys.pack()
|
bt_chatkey.pack()
|
||||||
bt_bnu120.pack()
|
bt_bnu120.pack()
|
||||||
bt_fh.pack()
|
bt_fh.pack()
|
||||||
|
|
||||||
|
|
||||||
# mainloop
|
# mainloop
|
||||||
root.title('选择')
|
root.title('chatWEB')
|
||||||
root.geometry('200x220+440+600')
|
root.geometry('200x220+440+600')
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
36
xz_main.pyw
Normal file
36
xz_main.pyw
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import os
|
||||||
|
from tkinter import *
|
||||||
|
from tkinter import messagebox
|
||||||
|
from time import time
|
||||||
|
import sys
|
||||||
|
|
||||||
|
root = Tk()
|
||||||
|
ml = os.getcwd()
|
||||||
|
|
||||||
|
def open_exe(exe_name):
|
||||||
|
if os.path.exists(os.path.join(ml,f"{exe_name}.exe")):
|
||||||
|
os.system(f'start {exe_name}.exe')
|
||||||
|
else:
|
||||||
|
messagebox.showerror('system','文件丢失!')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def chat():
|
||||||
|
open_exe("xz_chat")
|
||||||
|
|
||||||
|
def quit_exe():
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
|
||||||
|
# Button
|
||||||
|
chat_b = Button(root ,text='聊天网站', command=chat)
|
||||||
|
q_b = Button(root ,text='返回', command= quit_exe)
|
||||||
|
|
||||||
|
# pack Button and label
|
||||||
|
Label(root, text='选择模式').pack()
|
||||||
|
chat_b.pack()
|
||||||
|
q_b.pack()
|
||||||
|
|
||||||
|
# mainloop
|
||||||
|
root.title('chatWEB')
|
||||||
|
root.geometry('200x220')
|
||||||
|
root.mainloop()
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
import openai
|
|
||||||
import os
|
|
||||||
from time import sleep
|
|
||||||
import sys
|
|
||||||
|
|
||||||
ml = os.getcwd()
|
|
||||||
file_path = os.path.join(ml, "api_key.txt")
|
|
||||||
|
|
||||||
# 设置openai库的API认证密钥
|
|
||||||
def api_key():
|
|
||||||
if os.path.exists(os.path.join(ml, f"api_key.txt")):
|
|
||||||
with open(file_path, 'r') as f:
|
|
||||||
openai.api_key = f.read().strip()
|
|
||||||
else:
|
|
||||||
print('文件丢失,请重新输入api_key')
|
|
||||||
sleep(1)
|
|
||||||
if os.path.exists(os.path.join(ml, "chat_command_GUI.exe")):
|
|
||||||
os.startfile("chat_command_GUI.exe")
|
|
||||||
else:
|
|
||||||
print('错误,文件不存在!?')
|
|
||||||
sleep(1)
|
|
||||||
sys.exit()
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# 设置GPT-3.5模型要使用的API_key
|
|
||||||
api_key()
|
|
||||||
|
|
||||||
# 设置GPT-3.5模型的引擎ID
|
|
||||||
model_engine = 'text-davinci-003'
|
|
||||||
|
|
||||||
# 循环读入用户输入并输出聊天结果
|
|
||||||
while True:
|
|
||||||
# 获取用户输入
|
|
||||||
prompt = input("你好,请问有什么需要帮助的吗?\n")
|
|
||||||
|
|
||||||
# 调用openai.ChatCompletion.create()方法来获取聊天结果
|
|
||||||
response = openai.Completion.create(
|
|
||||||
engine='text-davinci-003',
|
|
||||||
prompt=prompt,
|
|
||||||
temperature=0.7,
|
|
||||||
max_tokens=210,
|
|
||||||
top_p=1,
|
|
||||||
frequency_penalty=0,
|
|
||||||
presence_penalty=0
|
|
||||||
)
|
|
||||||
result = response['choices'][0]['text'].strip()
|
|
||||||
print(f"chatGPT:{result}")
|
|
||||||
@@ -45,6 +45,6 @@ fh_bt.grid(row=2,column=1)
|
|||||||
|
|
||||||
|
|
||||||
# mainloop
|
# mainloop
|
||||||
root.title('chatGPT')
|
root.title('chatWEB')
|
||||||
root.geometry('200x250+100+100')
|
root.geometry('200x250+100+100')
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
Reference in New Issue
Block a user