Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Add response_format to allow use of new JSON mode #449

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rijekaDrina
Copy link

@rijekaDrina rijekaDrina commented Jan 6, 2024

Changes

I added an attribute to the ChatCompletionRequest class to support JSON mode. Resolves issue #448 .

New API Checklist

See CONTRIBUTING.md for more info.

  1. Documentation for every variable
  2. Class-level documentation
  3. POJO JSON parsing tests, wasn't necessary
  4. Service integration tests

* When specifying 'json_object' as the request format it's still necessary to instruct the model to return JSON.
* You may use {@link ChatResponseFormat.ResponseFormat} enum.
*/
@JsonProperty("response_format")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can just put the class ChatResponseFormat within the request class

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to follow the format that was used for other attributes.

Copy link
Contributor

@mzhu-ai mzhu-ai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants