fix(config.py): fix typo in max_uses variable declaration

feat(config.py): add support for TENOR_API_KEY environment variable to be able to use Tenor API for sending gifs
feat(functionscalls.py): add new function send_a_gif to send a gif in the channel
fix(makeprompt.py): add support for calling send_a_gif function in chatgpt_process function
This commit is contained in:
Paillat
2023-07-18 21:53:07 +02:00
parent 12f13ca6c4
commit e91fafdc51
3 changed files with 57 additions and 5 deletions

View File

@@ -3,25 +3,27 @@ import sqlite3
import json
from dotenv import load_dotenv
import os
import openai
# Loading environement variables
load_dotenv()
perspective_api_key = os.getenv("PERSPECTIVE_API_KEY")
discord_token = os.getenv("DISCORD_TOKEN")
webhook_url = os.getenv("WEBHOOK_URL")
max_uses: int = 400
tenor_api_key = os.getenv("TENOR_API_KEY")
# Logging
logging.basicConfig(level=logging.INFO)
# Setting up the google vision api
os.environ[
"GOOGLE_APPLICATION_CREDENTIALS"
] = "./../database/google-vision/botator.json"
with open(os.path.abspath(os.path.join("src", "prompts", "functions.json"))) as f:
functions = json.load(f)
# Defining a debug function
def debug(message):
# if the os is windows, we logging.info(message), if
if os.name == "nt":
logging.info(message)
else: