summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchark <jordan@schark.online>2023-12-02 09:18:48 -0800
committerSchark <jordan@schark.online>2023-12-02 09:18:48 -0800
commit1f88bb51a3ab9f1ce1d0fa1058a851521a02d017 (patch)
tree056097fad105b7c931555bf4028c23f04d0d2583
parentf580735aaafdc8e0c9128955fcb93c039d10b8b9 (diff)
downloadcli-gpt-1f88bb51a3ab9f1ce1d0fa1058a851521a02d017.tar.gz
cli-gpt-1f88bb51a3ab9f1ce1d0fa1058a851521a02d017.zip
Style hotfix
-rw-r--r--chat.py5
-rw-r--r--style.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/chat.py b/chat.py
index 5b4f2aa..be2d77d 100644
--- a/chat.py
+++ b/chat.py
@@ -6,7 +6,7 @@ import time
from openai import OpenAI
from help import HelpCommands, start_chat
-from style import StyleLog as styler
+from style import StyleLog
# Read in token from "token" file
# TODO: env variable in future?
@@ -37,6 +37,7 @@ def main():
model = "gpt-3.5-turbo"
helper = HelpCommands(model)
+ styler = StyleLog()
messages = start_chat(model)
while True:
@@ -59,7 +60,7 @@ def main():
response_thread = threading.Thread(target=text_call, args=(api_call_queue, messages, model,))
response_thread.start()
- ellipsis_thread = threading.Thread(target=show_ellipsis)
+ ellipsis_thread = threading.Thread(target=styler.show_ellipsis, args=(api_call_done,))
ellipsis_thread.start()
response_thread.join()
diff --git a/style.py b/style.py
index 129bdd7..65fecf1 100644
--- a/style.py
+++ b/style.py
@@ -1,4 +1,5 @@
import sys
+import time
from prompt_toolkit import prompt
from prompt_toolkit.styles import Style
@@ -6,9 +7,9 @@ from prompt_toolkit.styles import Style
class StyleLog:
def prompt(role: str):
+ return
-
- def show_ellipsis():
+ def show_ellipsis(self, api_call_done):
loop = True
while loop:
for i in range(0, 4):