Files
Botator/src/chatUtils/requesters/request.py

40 lines
1.3 KiB
Python
Raw Normal View History

🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version 🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class 🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class 🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel 🔧 chore(Chat.py): add formatContext function to format the context for the bot to use 🔧 chore(Chat.py): raise an exception if no openai api key is set 🔧 chore(Chat.py): add logic to filter and format messages for the context 🔧 chore(Chat.py): fix typo in the import statement for ModerationError 🔧 chore(Chat.py): fix typo in the import statement for moderate 🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history 🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character 🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list 🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list 🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list 🔧 chore(requesters/llama.py): create llama function as a placeholder 🔧 chore(requesters/llama2.py): create llama2 function as a placeholder 🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module 🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder 🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder 🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules 🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
import discord
from src.chatUtils.requesters.openaiChat import openaiChat
from src.chatUtils.requesters.openaiText import openaiText
from src.chatUtils.requesters.llama import llama
from src.chatUtils.requesters.llama2 import llama2
🔧 chore(requirements.txt): update dependencies The `requirements.txt` file has been updated to include the following changes: - Removed the comment for the Google API dependency. - Added the `anthropic` dependency. - Added a newline at the end of the file. 🐛 fix(ChatProcess.py): fix removing reaction in Chat class The `remove_reaction` method in the `Chat` class was not awaited, causing it to not be executed properly. The fix ensures that the method is awaited before continuing execution. 🐛 fix(prompts.py): fix placeholder name in createPrompt function The placeholder name `[datetime]` in the `createPrompt` function has been changed to `[date-and-time]` to improve clarity and consistency. 🔧 chore(chat.txt): update Zenith prompt The Zenith prompt in the `chat.txt` file has been updated to include additional instructions for the AI character. The update provides more context and guidance for the AI's behavior. ✨ feat(claude.py): add support for Claude model A new file `claude.py` has been added to the `chatUtils/requesters` directory. This file contains the implementation for the `claude` function, which interacts with the Claude model from the Anthropoc API. The function takes a list of messages as input and generates a response using the Claude model. 🔧 chore(request.py): add support for Claude model in request function The `request` function in the `request.py` file has been updated to include support for the Claude model. When the `model` parameter is set to "claude", the function calls the `claude` function from the `claude.py` file to generate a response. 🔧 chore(variousclasses.py): add Claude model to models class The `models` class in the `variousclasses.py` file has been updated to include the Claude model as an option. The model name "claude" has been added to the `chatModels` list.
2023-10-31 12:08:32 +01:00
from src.chatUtils.requesters.claude import claude
🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version 🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class 🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class 🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel 🔧 chore(Chat.py): add formatContext function to format the context for the bot to use 🔧 chore(Chat.py): raise an exception if no openai api key is set 🔧 chore(Chat.py): add logic to filter and format messages for the context 🔧 chore(Chat.py): fix typo in the import statement for ModerationError 🔧 chore(Chat.py): fix typo in the import statement for moderate 🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history 🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character 🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list 🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list 🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list 🔧 chore(requesters/llama.py): create llama function as a placeholder 🔧 chore(requesters/llama2.py): create llama2 function as a placeholder 🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module 🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder 🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder 🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules 🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
class ModelNotFound(Exception):
pass
🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version 🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class 🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class 🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel 🔧 chore(Chat.py): add formatContext function to format the context for the bot to use 🔧 chore(Chat.py): raise an exception if no openai api key is set 🔧 chore(Chat.py): add logic to filter and format messages for the context 🔧 chore(Chat.py): fix typo in the import statement for ModerationError 🔧 chore(Chat.py): fix typo in the import statement for moderate 🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history 🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character 🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list 🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list 🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list 🔧 chore(requesters/llama.py): create llama function as a placeholder 🔧 chore(requesters/llama2.py): create llama2 function as a placeholder 🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module 🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder 🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder 🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules 🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
async def request(
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
model: str,
prompt: list[dict] | str,
openai_api_key: str,
funtcions: list[dict] = None,
custom_temp: float = 1.2,
🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version 🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class 🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class 🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel 🔧 chore(Chat.py): add formatContext function to format the context for the bot to use 🔧 chore(Chat.py): raise an exception if no openai api key is set 🔧 chore(Chat.py): add logic to filter and format messages for the context 🔧 chore(Chat.py): fix typo in the import statement for ModerationError 🔧 chore(Chat.py): fix typo in the import statement for moderate 🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history 🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character 🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list 🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list 🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list 🔧 chore(requesters/llama.py): create llama function as a placeholder 🔧 chore(requesters/llama2.py): create llama2 function as a placeholder 🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module 🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder 🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder 🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules 🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
):
if model == "gpt-3.5-turbo":
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
return await openaiChat(
messages=prompt,
openai_api_key=openai_api_key,
functions=funtcions,
model=model,
temperature=custom_temp,
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
)
🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version 🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class 🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class 🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel 🔧 chore(Chat.py): add formatContext function to format the context for the bot to use 🔧 chore(Chat.py): raise an exception if no openai api key is set 🔧 chore(Chat.py): add logic to filter and format messages for the context 🔧 chore(Chat.py): fix typo in the import statement for ModerationError 🔧 chore(Chat.py): fix typo in the import statement for moderate 🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history 🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character 🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list 🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list 🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list 🔧 chore(requesters/llama.py): create llama function as a placeholder 🔧 chore(requesters/llama2.py): create llama2 function as a placeholder 🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module 🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder 🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder 🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules 🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
elif model == "text-davinci-003":
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
# return await openaiText(prompt=prompt, openai_api_key=openai_api_key)
raise NotImplementedError("This model is not supported yet")
🔧 chore(requirements.txt): comment out py-cord and add pycord from GitHub repository to use the latest version 🔧 chore(ChatProcess.py): import fetch_messages_history function from Chat module to use it in Chat class 🔧 chore(ChatProcess.py): import moderate and ModerationError from utils.misc module to use them in Chat class 🔧 chore(Chat.py): add fetch_messages_history function to fetch message history from a channel 🔧 chore(Chat.py): add formatContext function to format the context for the bot to use 🔧 chore(Chat.py): raise an exception if no openai api key is set 🔧 chore(Chat.py): add logic to filter and format messages for the context 🔧 chore(Chat.py): fix typo in the import statement for ModerationError 🔧 chore(Chat.py): fix typo in the import statement for moderate 🔧 chore(Chat.py): fix typo in the import statement for fetch_messages_history 🔧 chore(prompts.py): create prompts dictionary and read chat and text prompts from files for each character 🔧 chore(prompts.py): create createPrompt function to create a prompt from the messages list 🔧 chore(prompts.py): create createTextPrompt function to create a text prompt from the messages list 🔧 chore(prompts.py): create createChatPrompt function to create a chat prompt from the messages list 🔧 chore(requesters/llama.py): create llama function as a placeholder 🔧 chore(requesters/llama2.py): create llama2 function as a placeholder 🔧 chore(requesters/openaiChat.py): import openai_caller from utils.openaicaller module 🔧 chore(requesters/openaiChat.py): create openaiChat function as a placeholder 🔧 chore(requesters/openaiText.py): create openaiText function as a placeholder 🔧 chore(requesters/request.py): import openaiChat, openaiText, llama, and llama2 functions from respective modules 🔧 chore(requesters/request.py): create request function to handle different models and make requests
2023-08-19 15:30:57 +02:00
elif model == "text-llama":
return await llama(prompt=prompt)
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
elif model == "text-llama2":
# return await llama2(prompt=prompt)
raise NotImplementedError("This model is not supported yet")
🔧 chore(requirements.txt): update dependencies The `requirements.txt` file has been updated to include the following changes: - Removed the comment for the Google API dependency. - Added the `anthropic` dependency. - Added a newline at the end of the file. 🐛 fix(ChatProcess.py): fix removing reaction in Chat class The `remove_reaction` method in the `Chat` class was not awaited, causing it to not be executed properly. The fix ensures that the method is awaited before continuing execution. 🐛 fix(prompts.py): fix placeholder name in createPrompt function The placeholder name `[datetime]` in the `createPrompt` function has been changed to `[date-and-time]` to improve clarity and consistency. 🔧 chore(chat.txt): update Zenith prompt The Zenith prompt in the `chat.txt` file has been updated to include additional instructions for the AI character. The update provides more context and guidance for the AI's behavior. ✨ feat(claude.py): add support for Claude model A new file `claude.py` has been added to the `chatUtils/requesters` directory. This file contains the implementation for the `claude` function, which interacts with the Claude model from the Anthropoc API. The function takes a list of messages as input and generates a response using the Claude model. 🔧 chore(request.py): add support for Claude model in request function The `request` function in the `request.py` file has been updated to include support for the Claude model. When the `model` parameter is set to "claude", the function calls the `claude` function from the `claude.py` file to generate a response. 🔧 chore(variousclasses.py): add Claude model to models class The `models` class in the `variousclasses.py` file has been updated to include the Claude model as an option. The model name "claude" has been added to the `chatModels` list.
2023-10-31 12:08:32 +01:00
elif model == "claude":
return await claude(messages=prompt)
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
2023-08-20 12:42:02 +02:00
else:
raise ModelNotFound(f"Model {model} not found")