bing-chat-api / networks /message_outputer.py
Hansimov's picture
:recycle: [Refactor] OpenaiStreamOutputer: Unify JSON output formatters
63998ab
raw
history blame
332 Bytes
import json
class OpenaiStreamOutputer:
def output(self, content=None, content_type=None) -> bytes:
return (
json.dumps(
{
"content": content,
"content_type": content_type,
}
)
+ "\n"
).encode("utf-8")