mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🐛 fix(ChatProcess.py): import missing 'characters' module from src.utils.variousclasses to fix NameError
✨ feat(ChatProcess.py): add support for custom temperature for each character in the 'characters' module to improve chat responses 🐛 fix(openaiChat.py): add 'temperature' parameter to the 'openaiChat' function to allow custom temperature for generating responses 🐛 fix(request.py): add 'custom_temp' parameter to the 'request' function to pass custom temperature to 'openaiChat' function 🐛 fix(openaicaller.py): reduce sleep time from 10 seconds to 5 seconds for retrying API calls to improve responsiveness ✨ feat(variousclasses.py): add 'custom_temp' dictionary to store custom temperature values for each character to improve chat responses
This commit is contained in:
@@ -147,21 +147,21 @@ class openai_caller:
|
||||
await recall_func(
|
||||
"`An APIError occurred. This is not your fault, it is OpenAI's fault. We apologize for the inconvenience. Retrying...`"
|
||||
)
|
||||
await asyncio.sleep(10)
|
||||
await asyncio.sleep(5)
|
||||
i += 1
|
||||
except Timeout as e:
|
||||
print(
|
||||
f"\n\n{bcolors.BOLD}{bcolors.WARNING}The request timed out. Retrying...{bcolors.ENDC}"
|
||||
)
|
||||
await recall_func("`The request timed out. Retrying...`")
|
||||
await asyncio.sleep(10)
|
||||
await asyncio.sleep(5)
|
||||
i += 1
|
||||
except RateLimitError as e:
|
||||
print(
|
||||
f"\n\n{bcolors.BOLD}{bcolors.WARNING}RateLimitError. You are being rate limited. Retrying...{bcolors.ENDC}"
|
||||
)
|
||||
await recall_func("`You are being rate limited. Retrying...`")
|
||||
await asyncio.sleep(10)
|
||||
await asyncio.sleep(5)
|
||||
i += 1
|
||||
except APIConnectionError as e:
|
||||
print(
|
||||
@@ -185,7 +185,7 @@ class openai_caller:
|
||||
f"\n\n{bcolors.BOLD}{bcolors.WARNING}ServiceUnavailableError. The OpenAI API is not responding. Retrying...{bcolors.ENDC}"
|
||||
)
|
||||
await recall_func("`The OpenAI API is not responding. Retrying...`")
|
||||
await asyncio.sleep(10)
|
||||
await asyncio.sleep(5)
|
||||
await recall_func()
|
||||
i += 1
|
||||
finally:
|
||||
|
||||
@@ -24,6 +24,11 @@ class characters:
|
||||
"Botator roleplay (premium)": "botator-roleplay",
|
||||
"Zenith - Asimov's Laws (premium)": "zenith",
|
||||
}
|
||||
custom_temp = {
|
||||
"zenith": 1.8,
|
||||
"botator-roleplay": 1.8,
|
||||
}
|
||||
|
||||
reverseMatchingDict = {v: k for k, v in matchingDict.items()}
|
||||
default = list(matchingDict.keys())[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user