Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,11 +15,11 @@ intents.messages = True
|
|
15 |
intents.guilds = True
|
16 |
intents.guild_messages = True
|
17 |
|
18 |
-
# OpenAI ํด๋ผ์ด์ธํธ ์ค์
|
19 |
-
openai.api_key =
|
20 |
|
21 |
-
# ํน์ ์ฑ๋ ID
|
22 |
-
SPECIFIC_CHANNEL_ID =
|
23 |
|
24 |
# ๋ํ ํ์คํ ๋ฆฌ๋ฅผ ์ ์ฅํ ์ ์ญ ๋ณ์
|
25 |
conversation_history = []
|
@@ -70,7 +70,7 @@ async def generate_response(message):
|
|
70 |
|
71 |
try:
|
72 |
response = openai.ChatCompletion.create(
|
73 |
-
model="gpt-
|
74 |
messages=[{"role": "system", "content": system_message}, {"role": "user", "content": user_input}],
|
75 |
max_tokens=1000,
|
76 |
temperature=0.7,
|
@@ -97,5 +97,6 @@ async def send_long_message(channel, message):
|
|
97 |
await channel.send(part)
|
98 |
|
99 |
if __name__ == "__main__":
|
|
|
100 |
discord_client = MyClient(intents=intents)
|
101 |
-
discord_client.run(
|
|
|
15 |
intents.guilds = True
|
16 |
intents.guild_messages = True
|
17 |
|
18 |
+
# OpenAI ํด๋ผ์ด์ธํธ ์ค์ - ์ง์ API ํค ์
๋ ฅ
|
19 |
+
openai.api_key = "YOUR_OPENAI_API_KEY" # ์ฌ๊ธฐ์ OpenAI API ํค๋ฅผ ์
๋ ฅํ์ธ์.
|
20 |
|
21 |
+
# ํน์ ์ฑ๋ ID - ์ง์ ์ฑ๋ ID ์
๋ ฅ
|
22 |
+
SPECIFIC_CHANNEL_ID = 123456789012345678 # ์ฌ๊ธฐ์ Discord ์ฑ๋ ID๋ฅผ ์
๋ ฅํ์ธ์.
|
23 |
|
24 |
# ๋ํ ํ์คํ ๋ฆฌ๋ฅผ ์ ์ฅํ ์ ์ญ ๋ณ์
|
25 |
conversation_history = []
|
|
|
70 |
|
71 |
try:
|
72 |
response = openai.ChatCompletion.create(
|
73 |
+
model="gpt-4",
|
74 |
messages=[{"role": "system", "content": system_message}, {"role": "user", "content": user_input}],
|
75 |
max_tokens=1000,
|
76 |
temperature=0.7,
|
|
|
97 |
await channel.send(part)
|
98 |
|
99 |
if __name__ == "__main__":
|
100 |
+
discord_token = "YOUR_DISCORD_TOKEN" # ์ฌ๊ธฐ์ Discord ํ ํฐ์ ์
๋ ฅํ์ธ์.
|
101 |
discord_client = MyClient(intents=intents)
|
102 |
+
discord_client.run(discord_token)
|