Split long answers into two mesages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
346280fa50
commit
e1d092583f
@ -213,6 +213,11 @@ async def on_message(ctx):
|
||||
|
||||
response = requests.post(url, json=payload, headers=headers)
|
||||
answer = response.json()["choices"][0]["message"]["content"]
|
||||
|
||||
if len(answer) > 2000:
|
||||
await ctx.reply(answer[:2000].replace("<|end_of_turn|>", ""))
|
||||
await ctx.reply(answer[2000:].replace("<|end_of_turn|>", ""))
|
||||
else:
|
||||
await ctx.reply(answer.replace("<|end_of_turn|>", ""))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user