Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

v2.0.0 - Breaking Changes and Functions #32

Discussion options

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.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /