mirror of https://github.com/knrd1/chatgpt.git
split longer answers into multiple lines
This commit is contained in:
parent
997e6c9c49
commit
0b5a38aadb
|
@ -35,7 +35,9 @@ while True:
|
|||
frequency_penalty=0,
|
||||
presence_penalty=0
|
||||
)
|
||||
answers = response.choices[0].text.strip().split('\n')
|
||||
answers = [x.strip() for x in response.choices[0].text.strip().split('\n')]
|
||||
for answer in answers:
|
||||
irc.send(bytes("PRIVMSG " + channel + " :" + answer.strip() + "\n", "UTF-8"))
|
||||
while len(answer) > 0:
|
||||
irc.send(bytes("PRIVMSG " + channel + " :" + answer[:350] + "\n", "UTF-8"))
|
||||
answer = answer[350:]
|
||||
time.sleep(1)
|
||||
|
|
Loading…
Reference in New Issue