Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
kytpbs committed Oct 18, 2023
1 parent 25e634c commit a9f0488
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/GPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ def chat(main_message: str, message_history: dict[discord.User, str]):
},
]
for user, message in message_history.items():
messages.append({
"role": "assistant" if user.bot else "user",
"name": user.name,
"content": message,
})
if user.bot:
messages.append({
"role": "assistant",
"content": message,
})
else:
messages.append({
"role": "user",
"name": user.name,
"content": message,
})

messages.append({
"role": "user",
Expand Down

0 comments on commit a9f0488

Please sign in to comment.