mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
🐛 fix(config.py): add missing newline at the end of the file
🐛 fix(makeprompt.py): remove unnecessary file close statement after reading prompt file ✨ feat(config.py): add gpt_3_5_turbo_prompt variable to store the content of the prompt file ✨ feat(makeprompt.py): use gpt_3_5_turbo_prompt variable instead of reading the prompt file again
This commit is contained in:
@@ -100,3 +100,6 @@ curs_premium.execute(
|
||||
curs_premium.execute(
|
||||
"""CREATE TABLE IF NOT EXISTS channels (guild_id text, channel0 text, channel1 text, channel2 text, channel3 text, channel4 text)"""
|
||||
)
|
||||
|
||||
with open(os.path.abspath(os.path.dirname(__file__), "./prompts/gpt-3.5-turbo.txt"), "r", encoding="utf-8") as file:
|
||||
gpt_3_5_turbo_prompt = file.read()
|
||||
@@ -1,10 +1,11 @@
|
||||
import asyncio
|
||||
import os
|
||||
from src.config import curs_data, max_uses, curs_premium
|
||||
import re
|
||||
import discord
|
||||
import datetime
|
||||
import json
|
||||
|
||||
from src.config import curs_data, max_uses, curs_premium, gpt_3_5_turbo_prompt
|
||||
from src.utils.misc import moderate
|
||||
from src.utils.openaicaller import openai_caller
|
||||
from src.functionscalls import (
|
||||
@@ -303,9 +304,7 @@ async def chat_process(self, message):
|
||||
prompt_path = os.path.abspath(
|
||||
os.path.join(os.path.dirname(__file__), f"./prompts/{model}.txt")
|
||||
)
|
||||
with open(prompt_path, "r") as f:
|
||||
prompt = f.read()
|
||||
f.close()
|
||||
prompt = gpt_3_5_turbo_prompt[:] # copy the prompt but to dnot reference it
|
||||
|
||||
prompt = (
|
||||
prompt.replace("[prompt-prefix]", prompt_prefix)
|
||||
|
||||
Reference in New Issue
Block a user