@@ -5,6 +5,7 @@ import { isRequestOptions } from '../../../core';
55import { APIPromise } from '../../../core' ;
66import * as Core from '../../../core' ;
77import * as ThreadsAPI from './threads' ;
8+ import * as Shared from '../../shared' ;
89import * as AssistantsAPI from '../assistants' ;
910import * as ChatAPI from '../../chat/chat' ;
1011import * as MessagesAPI from './messages' ;
@@ -93,24 +94,17 @@ export class Threads extends APIResource {
9394 }
9495}
9596
96- /**
97- * An object describing the expected output of the model. If `json_object` only
98- * `function` type `tools` are allowed to be passed to the Run. If `text` the model
99- * can return text or any value needed.
100- */
101- export interface AssistantResponseFormat {
102- /**
103- * Must be one of `text` or `json_object`.
104- */
105- type ?: 'text' | 'json_object' ;
106- }
107-
10897/**
10998 * Specifies the format that the model must output. Compatible with
11099 * [GPT-4o](https://platform.openai.com/docs/models/gpt-4o),
111100 * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
112101 * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
113102 *
103+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
104+ * Outputs which guarantees the model will match your supplied JSON schema. Learn
105+ * more in the
106+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
107+ *
114108 * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
115109 * message the model generates is valid JSON.
116110 *
@@ -122,7 +116,11 @@ export interface AssistantResponseFormat {
122116 * indicates the generation exceeded `max_tokens` or the conversation exceeded the
123117 * max context length.
124118 */
125- export type AssistantResponseFormatOption = 'none' | 'auto' | AssistantResponseFormat ;
119+ export type AssistantResponseFormatOption =
120+ | 'auto'
121+ | Shared . ResponseFormatText
122+ | Shared . ResponseFormatJSONObject
123+ | Shared . ResponseFormatJSONSchema ;
126124
127125/**
128126 * Specifies a tool the model should use. Use to force the model to call a specific
@@ -537,6 +535,11 @@ export interface ThreadCreateAndRunParamsBase {
537535 * [GPT-4 Turbo](https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4),
538536 * and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
539537 *
538+ * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
539+ * Outputs which guarantees the model will match your supplied JSON schema. Learn
540+ * more in the
541+ * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
542+ *
540543 * Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the
541544 * message the model generates is valid JSON.
542545 *
@@ -876,7 +879,6 @@ export interface ThreadCreateAndRunParamsStreaming extends ThreadCreateAndRunPar
876879}
877880
878881export namespace Threads {
879- export import AssistantResponseFormat = ThreadsAPI . AssistantResponseFormat ;
880882 export import AssistantResponseFormatOption = ThreadsAPI . AssistantResponseFormatOption ;
881883 export import AssistantToolChoice = ThreadsAPI . AssistantToolChoice ;
882884 export import AssistantToolChoiceFunction = ThreadsAPI . AssistantToolChoiceFunction ;
@@ -923,6 +925,8 @@ export namespace Threads {
923925 export import MessageDeleted = MessagesAPI . MessageDeleted ;
924926 export import MessageDelta = MessagesAPI . MessageDelta ;
925927 export import MessageDeltaEvent = MessagesAPI . MessageDeltaEvent ;
928+ export import RefusalContentBlock = MessagesAPI . RefusalContentBlock ;
929+ export import RefusalDeltaBlock = MessagesAPI . RefusalDeltaBlock ;
926930 export import Text = MessagesAPI . Text ;
927931 export import TextContentBlock = MessagesAPI . TextContentBlock ;
928932 export import TextContentBlockParam = MessagesAPI . TextContentBlockParam ;
0 commit comments