print multiple lines of response from the OpenAI API

This commit is contained in:
konrad 2023-03-20 20:20:36 +00:00
parent f143682dff
commit 527008a9ee
1 changed files with 3 additions and 1 deletions

View File

@ -35,6 +35,8 @@ while True:
frequency_penalty=0,
presence_penalty=0
)
answer = response.choices[0].text.strip()
answers = response.choices[0].text.strip().split('\n')
for answer in answers:
irc.send(bytes("PRIVMSG " + channel + " :" + answer.strip() + "\n", "UTF-8"))
irc.send(bytes("PRIVMSG " + channel + " :" + answer + "\n", "UTF-8"))
time.sleep(1)