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:
parent
a5cfeb7763
commit
ea1f88dd29
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue