diff --git a/src/resources/beta/threads/messages/messages.ts b/src/resources/beta/threads/messages/messages.ts index a2f2aaf1c..1c37eb2ff 100644 --- a/src/resources/beta/threads/messages/messages.ts +++ b/src/resources/beta/threads/messages/messages.ts @@ -353,9 +353,9 @@ export interface Message { role: 'user' | 'assistant'; /** - * If applicable, the ID of the - * [run](https://platform.openai.com/docs/api-reference/runs) associated with the - * authoring of this message. + * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) + * associated with the creation of this message. Value is `null` when messages are + * created manually using the create message or create thread endpoints. */ run_id: string | null; @@ -501,10 +501,14 @@ export interface MessageCreateParams { content: string; /** - * The role of the entity that is creating the message. Currently only `user` is - * supported. + * The role of the entity that is creating the message. Allowed values include: + * + * - `user`: Indicates the message is sent by an actual user and should be used in + * most cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this + * value to insert messages from the assistant into the conversation. */ - role: 'user'; + role: 'user' | 'assistant'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that diff --git a/src/resources/beta/threads/runs/runs.ts b/src/resources/beta/threads/runs/runs.ts index a28dd9ae9..54c671131 100644 --- a/src/resources/beta/threads/runs/runs.ts +++ b/src/resources/beta/threads/runs/runs.ts @@ -331,6 +331,11 @@ export interface Run { * in a terminal state (i.e. `in_progress`, `queued`, etc.). */ usage: Run.Usage | null; + + /** + * The sampling temperature used for this run. If not set, defaults to 1. + */ + temperature?: number | null; } export namespace Run { @@ -461,6 +466,13 @@ export interface RunCreateParamsBase { */ stream?: boolean | null; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + * make the output more random, while lower values like 0.2 will make it more + * focused and deterministic. + */ + temperature?: number | null; + /** * Override the tools the assistant can use for this run. This is useful for * modifying the behavior on a per-run basis. @@ -555,6 +567,13 @@ export interface RunCreateAndStreamParams { */ model?: string | null; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + * make the output more random, while lower values like 0.2 will make it more + * focused and deterministic. + */ + temperature?: number | null; + /** * Override the tools the assistant can use for this run. This is useful for * modifying the behavior on a per-run basis. diff --git a/src/resources/beta/threads/threads.ts b/src/resources/beta/threads/threads.ts index 266f6709e..9b4785850 100644 --- a/src/resources/beta/threads/threads.ts +++ b/src/resources/beta/threads/threads.ts @@ -164,10 +164,14 @@ export namespace ThreadCreateParams { content: string; /** - * The role of the entity that is creating the message. Currently only `user` is - * supported. + * The role of the entity that is creating the message. Allowed values include: + * + * - `user`: Indicates the message is sent by an actual user and should be used in + * most cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this + * value to insert messages from the assistant into the conversation. */ - role: 'user'; + role: 'user' | 'assistant'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that @@ -238,6 +242,13 @@ export interface ThreadCreateAndRunParamsBase { */ stream?: boolean | null; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + * make the output more random, while lower values like 0.2 will make it more + * focused and deterministic. + */ + temperature?: number | null; + /** * If no thread is provided, an empty thread will be created. */ @@ -280,10 +291,14 @@ export namespace ThreadCreateAndRunParams { content: string; /** - * The role of the entity that is creating the message. Currently only `user` is - * supported. + * The role of the entity that is creating the message. Allowed values include: + * + * - `user`: Indicates the message is sent by an actual user and should be used in + * most cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this + * value to insert messages from the assistant into the conversation. */ - role: 'user'; + role: 'user' | 'assistant'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that @@ -355,6 +370,13 @@ export interface ThreadCreateAndRunStreamParams { */ model?: string | null; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will + * make the output more random, while lower values like 0.2 will make it more + * focused and deterministic. + */ + temperature?: number | null; + /** * If no thread is provided, an empty thread will be created. */ @@ -397,10 +419,14 @@ export namespace ThreadCreateAndRunStreamParams { content: string; /** - * The role of the entity that is creating the message. Currently only `user` is - * supported. + * The role of the entity that is creating the message. Allowed values include: + * + * - `user`: Indicates the message is sent by an actual user and should be used in + * most cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this + * value to insert messages from the assistant into the conversation. */ - role: 'user'; + role: 'user' | 'assistant'; /** * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that diff --git a/tests/api-resources/beta/threads/runs/runs.test.ts b/tests/api-resources/beta/threads/runs/runs.test.ts index 5e1b363fd..5f17c1b58 100644 --- a/tests/api-resources/beta/threads/runs/runs.test.ts +++ b/tests/api-resources/beta/threads/runs/runs.test.ts @@ -28,6 +28,7 @@ describe('resource runs', () => { metadata: {}, model: 'string', stream: false, + temperature: 1, tools: [{ type: 'code_interpreter' }, { type: 'code_interpreter' }, { type: 'code_interpreter' }], }); }); diff --git a/tests/api-resources/beta/threads/threads.test.ts b/tests/api-resources/beta/threads/threads.test.ts index 24cb815a7..3606019bd 100644 --- a/tests/api-resources/beta/threads/threads.test.ts +++ b/tests/api-resources/beta/threads/threads.test.ts @@ -109,6 +109,7 @@ describe('resource threads', () => { metadata: {}, model: 'string', stream: false, + temperature: 1, thread: { messages: [ { role: 'user', content: 'x', file_ids: ['string'], metadata: {} },