seawolf2357 commited on
Commit
f324ab8
Β·
verified Β·
1 Parent(s): 702e906

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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, message.client)
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 = """