@@ -8,27 +8,31 @@ object AssistantsRequestBody {
8
8
/** @param model
9
9
* ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for
10
10
* descriptions of them.
11
- *
12
11
* @param name
13
12
* The name of the assistant. The maximum length is 256 characters.
14
- *
15
13
* @param description
16
14
* The description of the assistant. The maximum length is 512 characters.
17
- *
18
15
* @param instructions
19
16
* The system instructions that the assistant uses. The maximum length is 32768 characters.
20
- *
17
+ * @param reasoningEffort
18
+ * o1 and o3-mini models only Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and
19
+ * high. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
21
20
* @param tools
22
21
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter,
23
22
* file_search, or function.
24
- *
25
23
* @param toolResources
26
24
* A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the
27
25
* code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs.
28
- *
29
26
* @param metadata
30
27
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object
31
28
* in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
29
+ * @param temperature
30
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like
31
+ * 0.2 will make it more focused and deterministic.
32
+ * @param topP
33
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p
34
+ * probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend
35
+ * altering this or temperature but not both.
32
36
*
33
37
* For more information please visit: [[https://platform.openai.com/docs/api-reference/assistants/createAssistant ]]
34
38
*/
@@ -37,9 +41,12 @@ object AssistantsRequestBody {
37
41
name : Option [String ] = None ,
38
42
description : Option [String ] = None ,
39
43
instructions : Option [String ] = None ,
44
+ reasoningEffort : Option [ReasoningEffort ] = None ,
40
45
tools : Seq [Tool ] = Seq .empty,
41
46
toolResources : Option [ToolResources ] = None ,
42
- metadata : Option [Map [String , String ]] = None
47
+ metadata : Option [Map [String , String ]] = None ,
48
+ temperature : Option [Float ] = None ,
49
+ topP : Option [Float ] = None
43
50
)
44
51
object CreateAssistantBody {
45
52
implicit val createAssistantBodyW : SnakePickle .Writer [CreateAssistantBody ] = SnakePickle .macroW[CreateAssistantBody ]
@@ -48,26 +55,33 @@ object AssistantsRequestBody {
48
55
/** @param model
49
56
* ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for
50
57
* descriptions of them.
51
- *
52
58
* @param name
53
59
* The name of the assistant. The maximum length is 256 characters.
54
- *
55
60
* @param description
56
61
* The description of the assistant. The maximum length is 512 characters.
57
- *
58
62
* @param instructions
59
63
* The system instructions that the assistant uses. The maximum length is 32768 characters.
64
+ * @param reasoningEffort
65
+ * o1 and o3-mini models only
60
66
*
67
+ * Constrains effort on reasoning for reasoning models. Currently supported values are low, medium, and high. Reducing reasoning effort
68
+ * can result in faster responses and fewer tokens used on reasoning in a response.
61
69
* @param tools
62
70
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types code_interpreter,
63
71
* file_search, or function.
64
- *
65
72
* @param toolResources
66
73
* A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the
67
74
* code_interpreter tool requires a list of file IDs, while the file_search tool requires a list of vector store IDs. v
68
75
* @param metadata
69
76
* Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object
70
77
* in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
78
+ * @param temperature
79
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like
80
+ * 0.2 will make it more focused and deterministic.
81
+ * @param topP
82
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p
83
+ * probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend
84
+ * altering this or temperature but not both.
71
85
*
72
86
* For more information please visit: [[https://platform.openai.com/docs/api-reference/assistants/modifyAssistant ]]
73
87
*/
@@ -76,12 +90,33 @@ object AssistantsRequestBody {
76
90
name : Option [String ] = None ,
77
91
description : Option [String ] = None ,
78
92
instructions : Option [String ] = None ,
93
+ reasoningEffort : Option [ReasoningEffort ] = None ,
79
94
tools : Seq [Tool ] = Seq .empty,
80
95
toolResources : Option [ToolResources ] = None ,
81
- metadata : Map [String , String ] = Map .empty
96
+ metadata : Map [String , String ] = Map .empty,
97
+ temperature : Option [Float ] = None ,
98
+ topP : Option [Float ] = None
82
99
)
83
100
84
101
object ModifyAssistantBody {
85
102
implicit val modifyAssistantBodyW : SnakePickle .Writer [ModifyAssistantBody ] = SnakePickle .macroW[ModifyAssistantBody ]
86
103
}
87
104
}
105
+
106
+ sealed abstract class ReasoningEffort (val value : String )
107
+
108
+ object ReasoningEffort {
109
+
110
+ implicit val reasoningEffortW : SnakePickle .Writer [ReasoningEffort ] = SnakePickle
111
+ .writer[ujson.Value ]
112
+ .comap[ReasoningEffort ](reasoningEffort => SnakePickle .writeJs(reasoningEffort.value))
113
+
114
+ case object Low extends ReasoningEffort (" low" )
115
+
116
+ case object Medium extends ReasoningEffort (" medium" )
117
+
118
+ case object High extends ReasoningEffort (" high" )
119
+
120
+ case class CustomReasoningEffort (customReasoningEffort : String ) extends ReasoningEffort (customReasoningEffort)
121
+
122
+ }
0 commit comments