diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e6d6963..edce20c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,7 @@ jobs: with: flavor: latest=auto tags: | - type=edge + type=edge,branch=next type=ref,event=branch type=ref,event=tag type=semver,pattern={{version}} diff --git a/ChatGPTModule.py b/ChatGPTModule.py index 899d5fde..ad220ffc 100644 --- a/ChatGPTModule.py +++ b/ChatGPTModule.py @@ -22,6 +22,8 @@ import os.path import time import uuid +from revChatGPT.V1 import Chatbot as V1Chatbot +from revChatGPT.V3 import Chatbot as V3Chatbot from typing import List, Dict import BotHandler @@ -79,13 +81,11 @@ def initialize(self, proxy=None) -> None: if self.config["chatgpt"]["base_url"]: os.environ["CHATGPT_BASE_URL"] = self.config["chatgpt"]["base_url"] - from revChatGPT.V1 import Chatbot - self._chatbot = Chatbot(config=self._get_chatbot_config(proxy)) + self._chatbot = V1Chatbot(config=self._get_chatbot_config(proxy)) # API type 3 elif self.config["chatgpt"]["api_type"] == 3: logging.info("Initializing ChatGPT module with API type 3") - from revChatGPT.V3 import Chatbot engine = str(self.config["chatgpt"]["engine"]) # Check proxy @@ -94,11 +94,11 @@ def initialize(self, proxy=None) -> None: # Initialize chatbot if len(engine) > 0: - self._chatbot = Chatbot(str(self.config["chatgpt"]["api_key"]), + self._chatbot = V3Chatbot(str(self.config["chatgpt"]["api_key"]), proxy=proxy, engine=engine) else: - self._chatbot = Chatbot(str(self.config["chatgpt"]["api_key"]), + self._chatbot = V3Chatbot(str(self.config["chatgpt"]["api_key"]), proxy=proxy) # Wrong API type diff --git a/Dockerfile b/Dockerfile index aa403bfe..b2b9a1ac 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,6 +29,7 @@ RUN --mount=type=bind,from=build,source=/wheels,target=/wheels pip install --no- WORKDIR /src RUN --mount=type=bind,source=. \ pyinstaller --specpath /app --distpath /app/dist --workpath /app/work \ + --collect-all tls_client --collect-all tiktoken_ext.openai_public \ --onefile --name main main.py # Build application image