You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added and updated models as of December 11, 2023, including the new GPT-4 Vision, GPT-4 Turbo, and DALL-E 3. Support for text-to-speech, and the other new features shown at OpenAI DevDay will be coming soon, but are not yet implemented.
41
+
Adds updated models as of December 11, 2023, including the new [GPT-4 Vision](#gpt-vision), GPT-4 Turbo, and [DALL-E 3](#dall-e-3). Adds [json result format](#json-mode). Fixes chat result streaming bug.
42
+
Support for text-to-speech, and the other new features shown at OpenAI DevDay will be coming soon, but are not yet implemented.
40
43
41
44
## Requirements
42
45
@@ -225,6 +228,38 @@ It returns a `ChatResult` which is mostly metadata, so use its `.ToString()` met
225
228
226
229
There's also an async streaming API which works similarly to the [Completions endpoint streaming results](#streaming).
227
230
231
+
#### JSON Mode
232
+
233
+
With the new `Model.GPT4_Turbo` or `gpt-3.5-turbo-1106` models, you can set the `ChatRequest.ResponseFormat` to `ChatRequest.ResponseFormats.JsonObject` to enable JSON mode.
234
+
When JSON mode is enabled, the model is constrained to only generate strings that parse into valid JSON object.
235
+
See https://platform.openai.com/docs/guides/text-generation/json-mode for more details.
newChatMessage(ChatMessageRole.System, "You are a helpful assistant designed to output JSON."),
246
+
newChatMessage(ChatMessageRole.User, "Who won the world series in 2020? Return JSON of a 'wins' dictionary with the year as the numeric key and the winning team as the string value.")
The image result contains a URL for an online image or a base64-encoded image, depending on the ImageGenerationRequest.ResponseFormat (url is the default).
0 commit comments