-
-
Notifications
You must be signed in to change notification settings - Fork 13
v2.0.0 - Breaking Changes and Functions #32
CJCrafter
announced in
Announcements
-
Unfortunately, due to how delta
is handled in streams, we were forced to implement breaking changes for ALL users who used streams, and all users who used gson to save their conversations to json. Since this effectively means that all production level users were effected, we decided now was a perfect time to completely recode the API.
See the examples for implementations of streams and tools.
Now, instead of using the consumer format, we use a "blocking iterable." This allows very easy syntax:
for (ChatResponseChunk chunk : openai.streamChatCompletion(request)) { String delta = chunk.get(0).getDeltaContent(); if (delta != null) System.out.print(delta); // When the response is finished, we can add it to the messages list. if (chunk.get(0).isFinished()) messages.add(chunk.get(0).getMessage()); }
We also have full support for functions! Try them out.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment