Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,7 @@ class MyClient(discord.Client):
|
|
61 |
return
|
62 |
self.is_processing = True
|
63 |
try:
|
64 |
-
response = await generate_response(message)
|
65 |
await message.channel.send(response)
|
66 |
finally:
|
67 |
self.is_processing = False
|
@@ -71,13 +71,13 @@ class MyClient(discord.Client):
|
|
71 |
isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID
|
72 |
)
|
73 |
|
74 |
-
async def generate_response(message):
|
75 |
global conversation_history
|
76 |
user_input = message.content
|
77 |
user_mention = message.author.mention
|
78 |
|
79 |
# μ μ¬ν λ°μ΄ν° μ°ΎκΈ°
|
80 |
-
most_similar_data = find_most_similar_data(user_input,
|
81 |
|
82 |
system_message = f"{user_mention}, DISCORDμμ μ¬μ©μλ€μ κ΄κ³ μΉ΄νΌλΌμ΄ν
μμ²μ λ΅νλ μ΄μμ€ν΄νΈμ
λλ€."
|
83 |
system_prefix = """
|
|
|
61 |
return
|
62 |
self.is_processing = True
|
63 |
try:
|
64 |
+
response = await generate_response(message, self)
|
65 |
await message.channel.send(response)
|
66 |
finally:
|
67 |
self.is_processing = False
|
|
|
71 |
isinstance(message.channel, discord.Thread) and message.channel.parent_id == SPECIFIC_CHANNEL_ID
|
72 |
)
|
73 |
|
74 |
+
async def generate_response(message, client):
|
75 |
global conversation_history
|
76 |
user_input = message.content
|
77 |
user_mention = message.author.mention
|
78 |
|
79 |
# μ μ¬ν λ°μ΄ν° μ°ΎκΈ°
|
80 |
+
most_similar_data = find_most_similar_data(user_input, client)
|
81 |
|
82 |
system_message = f"{user_mention}, DISCORDμμ μ¬μ©μλ€μ κ΄κ³ μΉ΄νΌλΌμ΄ν
μμ²μ λ΅νλ μ΄μμ€ν΄νΈμ
λλ€."
|
83 |
system_prefix = """
|