Created
October 24, 2024 08:00
-
-
Save warrenkc/50049a04bec9452aecd918895414d1f9 to your computer and use it in GitHub Desktop.
To turn on JSON mode with the Chat Completions or Assistants API you can set the response_format to { "type": "json_object" }.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dictionary < string, string > responseFormat = new Dictionary < string, string > { | |
{ | |
"type", | |
"json_object" | |
} | |
}; | |
var payload = new { | |
model = "gpt-4o-mini", | |
messages = messages, | |
max_tokens = 300, | |
response_format = responseFormat | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment