@@ -142,13 +142,47 @@ export interface Assistant {
142
142
*/
143
143
tools : Array < AssistantTool > ;
144
144
145
+ /**
146
+ * Specifies the format that the model must output. Compatible with
147
+ * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
148
+ * all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
149
+ *
150
+ * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
151
+ * message the model generates is valid JSON.
152
+ *
153
+ * **Important:** when using JSON mode, you **must** also instruct the model to
154
+ * produce JSON yourself via a system or user message. Without this, the model may
155
+ * generate an unending stream of whitespace until the generation reaches the token
156
+ * limit, resulting in a long-running and seemingly "stuck" request. Also note that
157
+ * the message content may be partially cut off if `finish_reason="length"`, which
158
+ * indicates the generation exceeded `max_tokens` or the conversation exceeded the
159
+ * max context length.
160
+ */
161
+ response_format ?: ThreadsAPI . AssistantResponseFormatOption | null ;
162
+
163
+ /**
164
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
165
+ * make the output more random, while lower values like 0.2 will make it more
166
+ * focused and deterministic.
167
+ */
168
+ temperature ?: number | null ;
169
+
145
170
/**
146
171
* A set of resources that are used by the assistant's tools. The resources are
147
172
* specific to the type of tool. For example, the `code_interpreter` tool requires
148
173
* a list of file IDs, while the `file_search` tool requires a list of vector store
149
174
* IDs.
150
175
*/
151
176
tool_resources ?: Assistant . ToolResources | null ;
177
+
178
+ /**
179
+ * An alternative to sampling with temperature, called nucleus sampling, where the
180
+ * model considers the results of the tokens with top_p probability mass. So 0.1
181
+ * means only the tokens comprising the top 10% probability mass are considered.
182
+ *
183
+ * We generally recommend altering this or temperature but not both.
184
+ */
185
+ top_p ?: number | null ;
152
186
}
153
187
154
188
export namespace Assistant {
@@ -1012,7 +1046,7 @@ export interface AssistantCreateParams {
1012
1046
/**
1013
1047
* Specifies the format that the model must output. Compatible with
1014
1048
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
1015
- * all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.
1049
+ * all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
1016
1050
*
1017
1051
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
1018
1052
* message the model generates is valid JSON.
@@ -1158,7 +1192,7 @@ export interface AssistantUpdateParams {
1158
1192
/**
1159
1193
* Specifies the format that the model must output. Compatible with
1160
1194
* [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo) and
1161
- * all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.
1195
+ * all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
1162
1196
*
1163
1197
* Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
1164
1198
* message the model generates is valid JSON.
0 commit comments