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

Switch to serde_json::Value for the response_format type #42

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Switch to serde_json::Value for the response_format type #42

merged 1 commit into from
Nov 8, 2023

Conversation

tdwells90
Copy link
Contributor

Hi,

My earlier PR was done in a bit of haste and I hadn't realized response_format was expecting an object. I thought I was expecting a string. My apologies!

So, I've changed it to Value type and it's now much better. For example:

let response_format = json!({
    "type": "json_object",
});

let request = ChatCompletionRequest::new(model, prompt).response_format(response_format);

Tested this locally and in production and working.

@dongri
Copy link
Owner

dongri commented Nov 8, 2023

LGTM

@dongri dongri merged commit 8bc51f6 into dongri:main Nov 8, 2023
1 check passed
ra0x3 added a commit to ra0x3/openai-rst that referenced this pull request May 3, 2024
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.

None yet

2 participants