mirror of
https://github.com/AskDavis/nate-discord.git
synced 2026-01-01 05:05:58 -08:00
return changes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = []
|
||||
@@ -31,4 +31,5 @@ async def chatgpt_response(prompt):
|
||||
DIALOGUE_STACK.append({"role": "assistant", "content": response['choices'][0]['message']['content']})
|
||||
return response ['choices'][0]['message']['content']
|
||||
else:
|
||||
DIALOGUE_STACK.append({"role": "user", "content": prompt})
|
||||
DIALOGUE_STACK.append({"role": "user", "content": prompt})
|
||||
return
|
||||
Reference in New Issue
Block a user