@@ -15,6 +15,12 @@ export class Completions extends APIResource {
1515 * [text generation](https://platform.openai.com/docs/guides/text-generation),
1616 * [vision](https://platform.openai.com/docs/guides/vision), and
1717 * [audio](https://platform.openai.com/docs/guides/audio) guides.
18+ *
19+ * Parameter support can differ depending on the model used to generate the
20+ * response, particularly for newer reasoning models. Parameters that are only
21+ * supported for reasoning models are noted below. For the current state of
22+ * unsupported parameters in reasoning models,
23+ * [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning).
1824 */
1925 create (
2026 body : ChatCompletionCreateParamsNonStreaming ,
@@ -135,6 +141,9 @@ export namespace ChatCompletion {
135141 }
136142}
137143
144+ /**
145+ * Messages sent by the model in response to user messages.
146+ */
138147export interface ChatCompletionAssistantMessageParam {
139148 /**
140149 * The role of the messages author, in this case `assistant`.
@@ -530,6 +539,29 @@ export interface ChatCompletionContentPartText {
530539 type : 'text' ;
531540}
532541
542+ /**
543+ * Developer-provided instructions that the model should follow, regardless of
544+ * messages sent by the user. With o1 models and newer, `developer` messages
545+ * replace the previous `system` messages.
546+ */
547+ export interface ChatCompletionDeveloperMessageParam {
548+ /**
549+ * The contents of the developer message.
550+ */
551+ content : string | Array < ChatCompletionContentPartText > ;
552+
553+ /**
554+ * The role of the messages author, in this case `developer`.
555+ */
556+ role : 'developer' ;
557+
558+ /**
559+ * An optional name for the participant. Provides the model information to
560+ * differentiate between participants of the same role.
561+ */
562+ name ?: string ;
563+ }
564+
533565/**
534566 * Specifying a particular function via `{"name": "my_function"}` forces the model
535567 * to call that function.
@@ -620,7 +652,13 @@ export namespace ChatCompletionMessage {
620652 }
621653}
622654
655+ /**
656+ * Developer-provided instructions that the model should follow, regardless of
657+ * messages sent by the user. With o1 models and newer, `developer` messages
658+ * replace the previous `system` messages.
659+ */
623660export type ChatCompletionMessageParam =
661+ | ChatCompletionDeveloperMessageParam
624662 | ChatCompletionSystemMessageParam
625663 | ChatCompletionUserMessageParam
626664 | ChatCompletionAssistantMessageParam
@@ -707,6 +745,16 @@ export interface ChatCompletionPredictionContent {
707745 type : 'content' ;
708746}
709747
748+ /**
749+ * **o1 models only**
750+ *
751+ * Constrains effort on reasoning for
752+ * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
753+ * supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
754+ * result in faster responses and fewer tokens used on reasoning in a response.
755+ */
756+ export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high' ;
757+
710758/**
711759 * The role of the author of a message
712760 */
@@ -725,6 +773,11 @@ export interface ChatCompletionStreamOptions {
725773 include_usage ?: boolean ;
726774}
727775
776+ /**
777+ * Developer-provided instructions that the model should follow, regardless of
778+ * messages sent by the user. With o1 models and newer, use `developer` messages
779+ * for this purpose instead.
780+ */
728781export interface ChatCompletionSystemMessageParam {
729782 /**
730783 * The contents of the system message.
@@ -835,6 +888,10 @@ export interface ChatCompletionToolMessageParam {
835888 tool_call_id : string ;
836889}
837890
891+ /**
892+ * Messages sent by an end user, containing prompts or additional context
893+ * information.
894+ */
838895export interface ChatCompletionUserMessageParam {
839896 /**
840897 * The contents of the user message.
@@ -891,20 +948,22 @@ export interface ChatCompletionCreateParamsBase {
891948 * Number between -2.0 and 2.0. Positive values penalize new tokens based on their
892949 * existing frequency in the text so far, decreasing the model's likelihood to
893950 * repeat the same line verbatim.
894- *
895- * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
896951 */
897952 frequency_penalty ?: number | null ;
898953
899954 /**
900955 * Deprecated in favor of `tool_choice`.
901956 *
902- * Controls which (if any) function is called by the model. `none` means the model
903- * will not call a function and instead generates a message. `auto` means the model
904- * can pick between generating a message or calling a function. Specifying a
905- * particular function via `{"name": "my_function"}` forces the model to call that
957+ * Controls which (if any) function is called by the model.
958+ *
959+ * `none` means the model will not call a function and instead generates a message.
960+ *
961+ * `auto` means the model can pick between generating a message or calling a
906962 * function.
907963 *
964+ * Specifying a particular function via `{"name": "my_function"}` forces the model
965+ * to call that function.
966+ *
908967 * `none` is the default when no functions are present. `auto` is the default if
909968 * functions are present.
910969 */
@@ -998,17 +1057,21 @@ export interface ChatCompletionCreateParamsBase {
9981057 * Number between -2.0 and 2.0. Positive values penalize new tokens based on
9991058 * whether they appear in the text so far, increasing the model's likelihood to
10001059 * talk about new topics.
1001- *
1002- * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation)
10031060 */
10041061 presence_penalty ?: number | null ;
10051062
10061063 /**
1007- * An object specifying the format that the model must output. Compatible with
1008- * [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
1009- * [GPT-4o mini](https://platform.openai.com/docs/models#gpt-4o-mini),
1010- * [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4) and
1011- * all GPT-3.5 Turbo models newer than `gpt-3.5-turbo-1106`.
1064+ * **o1 models only**
1065+ *
1066+ * Constrains effort on reasoning for
1067+ * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1068+ * supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
1069+ * result in faster responses and fewer tokens used on reasoning in a response.
1070+ */
1071+ reasoning_effort ?: ChatCompletionReasoningEffort ;
1072+
1073+ /**
1074+ * An object specifying the format that the model must output.
10121075 *
10131076 * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
10141077 * Outputs which ensures the model will match your supplied JSON schema. Learn more
@@ -1088,9 +1151,8 @@ export interface ChatCompletionCreateParamsBase {
10881151 /**
10891152 * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will
10901153 * make the output more random, while lower values like 0.2 will make it more
1091- * focused and deterministic.
1092- *
1093- * We generally recommend altering this or `top_p` but not both.
1154+ * focused and deterministic. We generally recommend altering this or `top_p` but
1155+ * not both.
10941156 */
10951157 temperature ?: number | null ;
10961158
@@ -1223,6 +1285,7 @@ export declare namespace Completions {
12231285 type ChatCompletionContentPartInputAudio as ChatCompletionContentPartInputAudio ,
12241286 type ChatCompletionContentPartRefusal as ChatCompletionContentPartRefusal ,
12251287 type ChatCompletionContentPartText as ChatCompletionContentPartText ,
1288+ type ChatCompletionDeveloperMessageParam as ChatCompletionDeveloperMessageParam ,
12261289 type ChatCompletionFunctionCallOption as ChatCompletionFunctionCallOption ,
12271290 type ChatCompletionFunctionMessageParam as ChatCompletionFunctionMessageParam ,
12281291 type ChatCompletionMessage as ChatCompletionMessage ,
@@ -1231,6 +1294,7 @@ export declare namespace Completions {
12311294 type ChatCompletionModality as ChatCompletionModality ,
12321295 type ChatCompletionNamedToolChoice as ChatCompletionNamedToolChoice ,
12331296 type ChatCompletionPredictionContent as ChatCompletionPredictionContent ,
1297+ type ChatCompletionReasoningEffort as ChatCompletionReasoningEffort ,
12341298 type ChatCompletionRole as ChatCompletionRole ,
12351299 type ChatCompletionStreamOptions as ChatCompletionStreamOptions ,
12361300 type ChatCompletionSystemMessageParam as ChatCompletionSystemMessageParam ,
0 commit comments