Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.x chore(sse): add space between field and value for compatibility #2148

Closed
wants to merge 1 commit into from

Commits on Aug 4, 2023

  1. chore(sse): add space between field and value for compatibility

    according to https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation
    using `field: value` style is OK.
    
    > Collect the characters on the line after the first U+003A COLON character (:), and let value be that string. If value starts with a U+0020 SPACE character, remove it from value.
    
    other client side tools may detect the `data` field rely on the space,
    
    like this one https://github.com/openai/openai-python/blob/b82a3f7e4c462a8a10fa445193301a3cefef9a4a/openai/api_requestor.py#L106
    
    and this one: https://github.com/sashabaranov/go-openai/blob/71a24931dbc5b7029901ff963dc4d0d2509aa7ed/stream_reader.go#L14
    ttys3 committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    63a7ea3 View commit details
    Browse the repository at this point in the history