fix: Use '\n' seperator for EventSourceResponse (#1188)

this fixes compatibility with some OpenAI clients, including BetterChatGPT (https://github.com/ztjhz/BetterChatGPT/issues/537).

Co-authored-by: Andrei <abetlen@gmail.com>
This commit is contained in:
khimaros 2024-02-15 20:20:13 +00:00 committed by GitHub
parent a5cfeb7763
commit ea1f88dd29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -290,6 +290,7 @@ async def create_completion(
inner_send_chan=send_chan, inner_send_chan=send_chan,
iterator=iterator(), iterator=iterator(),
), ),
sep='\n',
) )
else: else:
return iterator_or_completion return iterator_or_completion
@ -382,6 +383,7 @@ async def create_chat_completion(
inner_send_chan=send_chan, inner_send_chan=send_chan,
iterator=iterator(), iterator=iterator(),
), ),
sep='\n',
) )
else: else:
return iterator_or_completion return iterator_or_completion