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

Correct missing messages issue #45

Merged
merged 1 commit into from
Aug 20, 2023
Merged

Correct missing messages issue #45

merged 1 commit into from
Aug 20, 2023

Conversation

cpfiffer
Copy link
Collaborator

@cpfiffer cpfiffer commented Aug 9, 2023

I was running into an error where the first streaming message that OpenAI sends is usually multiple messages lumped together, i.e.

data: {\"id\":\"chatcmpl-7lTNCpsoZCMd0oaDY1pe9gGunI7ZJ\",\"object\":\"chat.completion.chunk\",\"created\":1691548682,\"model\":\"gpt-3.5-turbo-0613\",\"choices\":[{\"index\":0,\"delta\":{\"role\":\"assistant\",\"content\":\"\"},\"finish_reas
on\":null}]}\n\ndata: {\"id\":\"chatcmpl-7lTNCpsoZCMd0oaDY1pe9gGunI7ZJ\",\"object\":\"chat.completion.chunk\",\"created\":1691548682,\"model\":\"gpt-3.5-turbo-0613\",\"choices\":[{\"index\":0,\"delta\":{\"content\":\"This\"},\"finish_reason\":null}]}\n\n

Note the data: entry about halfway through.

This PR is a convenience add for users who may not notice this -- all it does it separate out the "masterchunk" into sub-chunks split on newlines.

I also added some simpler checks for data: [DONE] messages.

@cpfiffer
Copy link
Collaborator Author

cpfiffer commented Aug 9, 2023

Tests seem due to a missing API key. How does this repo typically test API calls?

@roryl23
Copy link
Collaborator

roryl23 commented Aug 9, 2023

There's a problem where running tests automatically from a fork doesn't work. I'm going to see if I can solve it right now. Currently we just run the tests manually before merge.

@roryl23
Copy link
Collaborator

roryl23 commented Aug 20, 2023

I ran the tests locally, LGTM!

@roryl23 roryl23 merged commit c73fb71 into JuliaML:main Aug 20, 2023
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants