File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
api/src/main/java/com/launchableinc/openai/completion/chat Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,14 @@ public class ChatCompletionRequest {
2727 */
2828 List <ChatMessage > messages ;
2929
30+ /**
31+ * An object specifying the format that the model must output. Compatible with GPT-4 Turbo and all
32+ * GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.
33+ * https://platform.openai.com/docs/api-reference/chat/create#chat-create-response_format
34+ */
35+ @ JsonProperty ("response_format" )
36+ ChatResponseFormat responseFormat ;
37+
3038 /**
3139 * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output
3240 * more random, while lower values like 0.2 will make it more focused and deterministic.<br> We
Original file line number Diff line number Diff line change 1+ package com .launchableinc .openai .completion .chat ;
2+
3+ import com .fasterxml .jackson .annotation .JsonValue ;
4+ import lombok .Builder ;
5+ import lombok .Data ;
6+
7+ /*
8+ * OpenAI API Document:https://platform.openai.com/docs/api-reference/chat/create#chat-create-response_format
9+ */
10+ @ Data
11+ @ Builder
12+ public class ChatResponseFormat {
13+
14+ private ResponseFormat type ;
15+
16+ public enum ResponseFormat {
17+ TEXT ("text" ), JSON ("json_object" );
18+
19+ private final String value ;
20+
21+ ResponseFormat (String value ) {
22+ this .value = value ;
23+ }
24+
25+ @ JsonValue
26+ public String getValue () {
27+ return value ;
28+ }
29+ }
30+
31+ }
You can’t perform that action at this time.
0 commit comments