return changes

This commit is contained in:
William Lane
2023-03-20 10:56:52 -07:00
parent be00ef3e50
commit b5b7048784
3 changed files with 10 additions and 9 deletions

View File

@@ -1,8 +1,9 @@
# This dockerfile runs the run.py python file
# This dockerfile runs the mabel-chat service as a production application. the run.py
# python file is where the service is started.
# which is the main file for the application
# Use an official Python runtime as a parent image
FROM python:3.9
FROM python:3.8
# Set the working directory to /app
WORKDIR /
@@ -13,8 +14,6 @@ ADD . .
# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Run run.py when the container launches
# Run app.py when the container launches
CMD ["python", "run.py"]

View File

@@ -3,7 +3,7 @@ import os
import discord
from app.mabel.connect_openai import chatgpt_response
#load_dotenv()
load_dotenv()
discord_token=os.getenv('DISCORD_TOKEN')
print("DISCORD_TOKEN: ", discord_token)
class MyClient(discord.Client):
@@ -16,6 +16,7 @@ class MyClient(discord.Client):
prompt = message.content[7:]
response = await chatgpt_response(prompt)
await message.channel.send(response)
return
intents=discord.Intents.default()
intents.messages=True

View File

@@ -2,7 +2,7 @@ from dotenv import load_dotenv
import openai
import os
import json
#load_dotenv()
load_dotenv()
openai.api_key=os.getenv('OPENAI_KEY')
SYSTEM_DIRECTIVES = []
@@ -32,3 +32,4 @@ async def chatgpt_response(prompt):
return response ['choices'][0]['message']['content']
else:
DIALOGUE_STACK.append({"role": "user", "content": prompt})
return