chatbotai-gui 1.0.5.post1__py3-none-any.whl → 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chatai/chatbotgui.py +51 -21
- {chatbotai_gui-1.0.5.post1.dist-info → chatbotai_gui-2.0.0.dist-info}/METADATA +2 -1
- chatbotai_gui-2.0.0.dist-info/RECORD +7 -0
- {chatbotai_gui-1.0.5.post1.dist-info → chatbotai_gui-2.0.0.dist-info}/WHEEL +1 -1
- chatbotai_gui-1.0.5.post1.dist-info/RECORD +0 -7
- {chatbotai_gui-1.0.5.post1.dist-info → chatbotai_gui-2.0.0.dist-info}/top_level.txt +0 -0
chatai/chatbotgui.py
CHANGED
@@ -5,12 +5,15 @@ import openai
|
|
5
5
|
import google.generativeai as genai
|
6
6
|
import os
|
7
7
|
from meta_ai_api import MetaAI
|
8
|
+
import openai as openai
|
9
|
+
import anthropic # Anthropic API import for Claude
|
8
10
|
|
9
11
|
class SoftwareInterpreter:
|
10
|
-
def __init__(self, ai_type="meta", api_key=None, font="Arial",openai_maxtoken=250):
|
12
|
+
def __init__(self, ai_type="meta", api_key=None, font="Arial", openai_maxtoken=250):
|
11
13
|
self.ai_type = ai_type
|
12
14
|
self.font = font
|
13
|
-
self.api_key = api_key
|
15
|
+
self.api_key = api_key
|
16
|
+
self.model = None # Set model to None initially
|
14
17
|
self.configure_ai()
|
15
18
|
self.muted = False # Initialize mute status
|
16
19
|
self.openai_maxtoken = openai_maxtoken
|
@@ -20,38 +23,59 @@ class SoftwareInterpreter:
|
|
20
23
|
def configure_ai(self):
|
21
24
|
if self.ai_type == "gemini":
|
22
25
|
genai.configure(api_key=self.api_key)
|
26
|
+
self.model = "gemini-1.5-flash" # Default model for Gemini
|
23
27
|
elif self.ai_type == "meta":
|
24
28
|
self.meta_ai = MetaAI()
|
29
|
+
self.model = "meta-ai-1.0" # Default model for Meta AI
|
25
30
|
elif self.ai_type == "chatgpt":
|
26
31
|
openai.api_key = self.api_key
|
32
|
+
self.model = "gpt-3.5-turbo" # Default model for ChatGPT
|
33
|
+
elif self.ai_type == "claude":
|
34
|
+
self.claude = anthropic.Anthropic(api_key=self.api_key)
|
35
|
+
self.model = "claude-3-7-sonnet-20250219" # Default model for Claude
|
27
36
|
else:
|
28
|
-
raise ValueError("Unsupported AI type. Choose from 'gemini', 'meta', or '
|
37
|
+
raise ValueError("Unsupported AI type. Choose from 'gemini', 'meta', 'chatgpt', 'deepseek', or 'claude'.")
|
29
38
|
|
30
39
|
def get_installed_fonts(self):
|
31
40
|
"""Returns a list of all installed fonts on the system."""
|
32
41
|
fonts = list(tkfont.families())
|
33
42
|
return sorted(fonts)
|
43
|
+
def search_font(self, search_term):
|
44
|
+
"""Searches for fonts that contain the search term and returns matching fonts."""
|
45
|
+
matching_fonts = [font for font in self.fonts_list if search_term.lower() in font.lower()]
|
46
|
+
return "\n".join(matching_fonts) if matching_fonts else f"No fonts found matching '{search_term}'."
|
47
|
+
|
34
48
|
|
35
49
|
def get_response(self, prompt):
|
36
50
|
if self.muted:
|
37
51
|
return "The bot is muted. Please unmute to receive responses."
|
38
52
|
|
39
53
|
if self.ai_type == "gemini":
|
40
|
-
model = genai.GenerativeModel(
|
54
|
+
model = genai.GenerativeModel(self.model)
|
41
55
|
response = model.generate_content(prompt)
|
42
56
|
return response.text
|
43
57
|
elif self.ai_type == "meta":
|
44
58
|
response = self.meta_ai.prompt(message=prompt)
|
45
59
|
return response['message']
|
46
60
|
elif self.ai_type == "chatgpt":
|
47
|
-
response = openai.
|
48
|
-
model=
|
49
|
-
|
50
|
-
|
61
|
+
response = openai.Completion.create(
|
62
|
+
model=self.model, # Using self.model here
|
63
|
+
prompt=prompt,
|
64
|
+
max_tokens=self.openai_maxtoken
|
51
65
|
)
|
52
|
-
return response.choices[0].
|
66
|
+
return response.choices[0].text.strip()
|
67
|
+
elif self.ai_type == "claude":
|
68
|
+
message = self.claude.messages.create(
|
69
|
+
model=self.model, # Using self.model here
|
70
|
+
max_tokens=1024,
|
71
|
+
messages=[
|
72
|
+
{"role": "user", "content": prompt}
|
73
|
+
]
|
74
|
+
)
|
75
|
+
return message.content
|
76
|
+
|
53
77
|
def toggle_mute(self):
|
54
|
-
"""Toggles the mute status."""
|
78
|
+
"""Toggles the mute status."""
|
55
79
|
self.muted = not self.muted
|
56
80
|
return "Bot muted." if self.muted else "Bot unmuted."
|
57
81
|
|
@@ -73,29 +97,27 @@ class SoftwareInterpreter:
|
|
73
97
|
|
74
98
|
def switch_bot(self, bot_type):
|
75
99
|
"""Switch between bots."""
|
76
|
-
if bot_type in ["gemini", "meta", "chatgpt"]:
|
100
|
+
if bot_type in ["gemini", "meta", "chatgpt", "deepseek", "claude"]:
|
77
101
|
self.ai_type = bot_type
|
78
102
|
self.configure_ai()
|
79
103
|
return f"Switched to {bot_type} bot."
|
80
104
|
else:
|
81
|
-
return "Invalid bot type. Choose from 'gemini', 'meta', or '
|
105
|
+
return "Invalid bot type. Choose from 'gemini', 'meta', 'chatgpt', or 'claude'."
|
82
106
|
|
83
|
-
def
|
84
|
-
"""
|
85
|
-
|
86
|
-
|
87
|
-
"/font list - List all available fonts installed on your system.\n"
|
88
|
-
"Note: Fonts are case-sensitive and must match the exact name."
|
89
|
-
)
|
107
|
+
def set_model(self, model_name):
|
108
|
+
"""Sets the AI model if it exists."""
|
109
|
+
self.model = model_name
|
110
|
+
return f"Model changed to {model_name}."
|
90
111
|
|
91
112
|
def show_help(self):
|
92
113
|
"""Returns general help text."""
|
93
114
|
return (
|
94
115
|
"/mute - Mute or unmute the bot.\n"
|
95
116
|
"/say <message> - Send a custom message without bot processing.\n"
|
96
|
-
"/font <set/list> - Change or
|
117
|
+
"/font <set/list/search> - Change, list, or search fonts.\n"
|
97
118
|
"/apikey <API_KEY> - Set or view the current API key.\n"
|
98
|
-
"/switch <bot_name> - Switch between 'gemini', 'meta', or '
|
119
|
+
"/switch <bot_name> - Switch between 'gemini', 'meta', 'chatgpt', 'deepseek', or 'claude' bots.\n"
|
120
|
+
"/model <set> - Set AI model to the specified model.\n"
|
99
121
|
"/help - Show this help message."
|
100
122
|
)
|
101
123
|
|
@@ -146,6 +168,9 @@ class ChatbotApp:
|
|
146
168
|
self.chat_area.config(font=(self.chatbot.font, 14))
|
147
169
|
elif user_message.startswith("/font list"):
|
148
170
|
bot_response = "\n".join(self.chatbot.fonts_list)
|
171
|
+
elif user_message.startswith("/font search"):
|
172
|
+
search_term = user_message[13:].strip()
|
173
|
+
bot_response = self.chatbot.search_font(search_term)
|
149
174
|
elif user_message.startswith("/font"):
|
150
175
|
bot_response = self.chatbot.show_font_help()
|
151
176
|
elif user_message.startswith("/apikey"):
|
@@ -157,6 +182,11 @@ class ChatbotApp:
|
|
157
182
|
elif user_message.startswith("/switch"):
|
158
183
|
bot_type = user_message[8:].strip()
|
159
184
|
bot_response = self.chatbot.switch_bot(bot_type)
|
185
|
+
elif user_message.startswith("/model set"):
|
186
|
+
model_name = user_message[10:].strip()
|
187
|
+
bot_response = self.chatbot.set_model(model_name)
|
188
|
+
elif user_message.startswith("/model"):
|
189
|
+
bot_response = self.chatbot.show_help()
|
160
190
|
elif user_message.startswith("/help"):
|
161
191
|
bot_response = self.chatbot.show_help()
|
162
192
|
else:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: chatbotai-gui
|
3
|
-
Version:
|
3
|
+
Version: 2.0.0
|
4
4
|
Summary: A chatbot GUI that uses OpenAI, MetaAI, and Google Generative AI.
|
5
5
|
Author: ProgMEM-CC
|
6
6
|
License: AGPL-3.0-or-later
|
@@ -8,6 +8,7 @@ Description-Content-Type: text/x-rst
|
|
8
8
|
Requires-Dist: openai
|
9
9
|
Requires-Dist: meta_ai_api
|
10
10
|
Requires-Dist: google-generativeai
|
11
|
+
Requires-Dist: anthropic
|
11
12
|
Provides-Extra: dev
|
12
13
|
Requires-Dist: pytest; extra == "dev"
|
13
14
|
Requires-Dist: pytest-cov; extra == "dev"
|
@@ -0,0 +1,7 @@
|
|
1
|
+
chatai/__init__.py,sha256=2xKUBq0-tjLn88n92IOS0eNZIgywDxHfZTY9w-Zgxbo,3282
|
2
|
+
chatai/__main__.py,sha256=4tAOzUAJrsa3st202WTvfNPsKh0LVXs8BD-JA1ar_rA,168
|
3
|
+
chatai/chatbotgui.py,sha256=5zWh451JMeEx6-L24LJT-edW3SJY_5tN7ulu4wOSiVs,9013
|
4
|
+
chatbotai_gui-2.0.0.dist-info/METADATA,sha256=CDghaqNEWyoG2eoxCnMZqGDzJdMes1u_IFJx_WKXsNM,2008
|
5
|
+
chatbotai_gui-2.0.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
6
|
+
chatbotai_gui-2.0.0.dist-info/top_level.txt,sha256=HDCQB7_6yio4QMbTcjAN9lFfqE3SGdOjJ-o7wtMtypM,7
|
7
|
+
chatbotai_gui-2.0.0.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
chatai/__init__.py,sha256=2xKUBq0-tjLn88n92IOS0eNZIgywDxHfZTY9w-Zgxbo,3282
|
2
|
-
chatai/__main__.py,sha256=4tAOzUAJrsa3st202WTvfNPsKh0LVXs8BD-JA1ar_rA,168
|
3
|
-
chatai/chatbotgui.py,sha256=sU89yngl4Ejtyuq_r_k0nUrGB1u0gk37ZfKzH5AobLc,7527
|
4
|
-
chatbotai_gui-1.0.5.post1.dist-info/METADATA,sha256=zqX0FiUcaGEh6tsrSL07wUBY1JWk9DaKExJJtnShxIg,1989
|
5
|
-
chatbotai_gui-1.0.5.post1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
6
|
-
chatbotai_gui-1.0.5.post1.dist-info/top_level.txt,sha256=HDCQB7_6yio4QMbTcjAN9lFfqE3SGdOjJ-o7wtMtypM,7
|
7
|
-
chatbotai_gui-1.0.5.post1.dist-info/RECORD,,
|
File without changes
|