shared.d.mts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. export type AllModels = (string & {}) | ChatModel | 'o1-pro' | 'o1-pro-2025-03-19' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o3-deep-research' | 'o3-deep-research-2025-06-26' | 'o4-mini-deep-research' | 'o4-mini-deep-research-2025-06-26' | 'computer-use-preview' | 'computer-use-preview-2025-03-11' | 'gpt-5-codex' | 'gpt-5-pro' | 'gpt-5-pro-2025-10-06' | 'gpt-5.1-codex-max';
  2. export type ChatModel = 'gpt-5.2' | 'gpt-5.2-2025-12-11' | 'gpt-5.2-chat-latest' | 'gpt-5.2-pro' | 'gpt-5.2-pro-2025-12-11' | 'gpt-5.1' | 'gpt-5.1-2025-11-13' | 'gpt-5.1-codex' | 'gpt-5.1-mini' | 'gpt-5.1-chat-latest' | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-2025-08-07' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-5-chat-latest' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'o4-mini' | 'o4-mini-2025-04-16' | 'o3' | 'o3-2025-04-16' | 'o3-mini' | 'o3-mini-2025-01-31' | 'o1' | 'o1-2024-12-17' | 'o1-preview' | 'o1-preview-2024-09-12' | 'o1-mini' | 'o1-mini-2024-09-12' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-audio-preview' | 'gpt-4o-audio-preview-2024-10-01' | 'gpt-4o-audio-preview-2024-12-17' | 'gpt-4o-audio-preview-2025-06-03' | 'gpt-4o-mini-audio-preview' | 'gpt-4o-mini-audio-preview-2024-12-17' | 'gpt-4o-search-preview' | 'gpt-4o-mini-search-preview' | 'gpt-4o-search-preview-2025-03-11' | 'gpt-4o-mini-search-preview-2025-03-11' | 'chatgpt-4o-latest' | 'codex-mini-latest' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613';
  3. /**
  4. * A filter used to compare a specified attribute key to a given value using a
  5. * defined comparison operation.
  6. */
  7. export interface ComparisonFilter {
  8. /**
  9. * The key to compare against the value.
  10. */
  11. key: string;
  12. /**
  13. * Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`,
  14. * `nin`.
  15. *
  16. * - `eq`: equals
  17. * - `ne`: not equal
  18. * - `gt`: greater than
  19. * - `gte`: greater than or equal
  20. * - `lt`: less than
  21. * - `lte`: less than or equal
  22. * - `in`: in
  23. * - `nin`: not in
  24. */
  25. type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
  26. /**
  27. * The value to compare against the attribute key; supports string, number, or
  28. * boolean types.
  29. */
  30. value: string | number | boolean | Array<string | number>;
  31. }
  32. /**
  33. * Combine multiple filters using `and` or `or`.
  34. */
  35. export interface CompoundFilter {
  36. /**
  37. * Array of filters to combine. Items can be `ComparisonFilter` or
  38. * `CompoundFilter`.
  39. */
  40. filters: Array<ComparisonFilter | unknown>;
  41. /**
  42. * Type of operation: `and` or `or`.
  43. */
  44. type: 'and' | 'or';
  45. }
  46. /**
  47. * The input format for the custom tool. Default is unconstrained text.
  48. */
  49. export type CustomToolInputFormat = CustomToolInputFormat.Text | CustomToolInputFormat.Grammar;
  50. export declare namespace CustomToolInputFormat {
  51. /**
  52. * Unconstrained free-form text.
  53. */
  54. interface Text {
  55. /**
  56. * Unconstrained text format. Always `text`.
  57. */
  58. type: 'text';
  59. }
  60. /**
  61. * A grammar defined by the user.
  62. */
  63. interface Grammar {
  64. /**
  65. * The grammar definition.
  66. */
  67. definition: string;
  68. /**
  69. * The syntax of the grammar definition. One of `lark` or `regex`.
  70. */
  71. syntax: 'lark' | 'regex';
  72. /**
  73. * Grammar format. Always `grammar`.
  74. */
  75. type: 'grammar';
  76. }
  77. }
  78. export interface ErrorObject {
  79. code: string | null;
  80. message: string;
  81. param: string | null;
  82. type: string;
  83. }
  84. export interface FunctionDefinition {
  85. /**
  86. * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
  87. * underscores and dashes, with a maximum length of 64.
  88. */
  89. name: string;
  90. /**
  91. * A description of what the function does, used by the model to choose when and
  92. * how to call the function.
  93. */
  94. description?: string;
  95. /**
  96. * The parameters the functions accepts, described as a JSON Schema object. See the
  97. * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
  98. * and the
  99. * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
  100. * documentation about the format.
  101. *
  102. * Omitting `parameters` defines a function with an empty parameter list.
  103. */
  104. parameters?: FunctionParameters;
  105. /**
  106. * Whether to enable strict schema adherence when generating the function call. If
  107. * set to true, the model will follow the exact schema defined in the `parameters`
  108. * field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn
  109. * more about Structured Outputs in the
  110. * [function calling guide](https://platform.openai.com/docs/guides/function-calling).
  111. */
  112. strict?: boolean | null;
  113. }
  114. /**
  115. * The parameters the functions accepts, described as a JSON Schema object. See the
  116. * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
  117. * and the
  118. * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
  119. * documentation about the format.
  120. *
  121. * Omitting `parameters` defines a function with an empty parameter list.
  122. */
  123. export type FunctionParameters = {
  124. [key: string]: unknown;
  125. };
  126. /**
  127. * Set of 16 key-value pairs that can be attached to an object. This can be useful
  128. * for storing additional information about the object in a structured format, and
  129. * querying for objects via API or the dashboard.
  130. *
  131. * Keys are strings with a maximum length of 64 characters. Values are strings with
  132. * a maximum length of 512 characters.
  133. */
  134. export type Metadata = {
  135. [key: string]: string;
  136. };
  137. /**
  138. * **gpt-5 and o-series models only**
  139. *
  140. * Configuration options for
  141. * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
  142. */
  143. export interface Reasoning {
  144. /**
  145. * Constrains effort on reasoning for
  146. * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
  147. * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`.
  148. * Reducing reasoning effort can result in faster responses and fewer tokens used
  149. * on reasoning in a response.
  150. *
  151. * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
  152. * reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
  153. * calls are supported for all reasoning values in gpt-5.1.
  154. * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
  155. * support `none`.
  156. * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
  157. * - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
  158. */
  159. effort?: ReasoningEffort | null;
  160. /**
  161. * @deprecated **Deprecated:** use `summary` instead.
  162. *
  163. * A summary of the reasoning performed by the model. This can be useful for
  164. * debugging and understanding the model's reasoning process. One of `auto`,
  165. * `concise`, or `detailed`.
  166. */
  167. generate_summary?: 'auto' | 'concise' | 'detailed' | null;
  168. /**
  169. * A summary of the reasoning performed by the model. This can be useful for
  170. * debugging and understanding the model's reasoning process. One of `auto`,
  171. * `concise`, or `detailed`.
  172. *
  173. * `concise` is supported for `computer-use-preview` models and all reasoning
  174. * models after `gpt-5`.
  175. */
  176. summary?: 'auto' | 'concise' | 'detailed' | null;
  177. }
  178. /**
  179. * Constrains effort on reasoning for
  180. * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
  181. * supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`.
  182. * Reducing reasoning effort can result in faster responses and fewer tokens used
  183. * on reasoning in a response.
  184. *
  185. * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
  186. * reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
  187. * calls are supported for all reasoning values in gpt-5.1.
  188. * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
  189. * support `none`.
  190. * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
  191. * - `xhigh` is supported for all models after `gpt-5.1-codex-max`.
  192. */
  193. export type ReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | null;
  194. /**
  195. * JSON object response format. An older method of generating JSON responses. Using
  196. * `json_schema` is recommended for models that support it. Note that the model
  197. * will not generate JSON without a system or user message instructing it to do so.
  198. */
  199. export interface ResponseFormatJSONObject {
  200. /**
  201. * The type of response format being defined. Always `json_object`.
  202. */
  203. type: 'json_object';
  204. }
  205. /**
  206. * JSON Schema response format. Used to generate structured JSON responses. Learn
  207. * more about
  208. * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
  209. */
  210. export interface ResponseFormatJSONSchema {
  211. /**
  212. * Structured Outputs configuration options, including a JSON Schema.
  213. */
  214. json_schema: ResponseFormatJSONSchema.JSONSchema;
  215. /**
  216. * The type of response format being defined. Always `json_schema`.
  217. */
  218. type: 'json_schema';
  219. }
  220. export declare namespace ResponseFormatJSONSchema {
  221. /**
  222. * Structured Outputs configuration options, including a JSON Schema.
  223. */
  224. interface JSONSchema {
  225. /**
  226. * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
  227. * and dashes, with a maximum length of 64.
  228. */
  229. name: string;
  230. /**
  231. * A description of what the response format is for, used by the model to determine
  232. * how to respond in the format.
  233. */
  234. description?: string;
  235. /**
  236. * The schema for the response format, described as a JSON Schema object. Learn how
  237. * to build JSON schemas [here](https://json-schema.org/).
  238. */
  239. schema?: {
  240. [key: string]: unknown;
  241. };
  242. /**
  243. * Whether to enable strict schema adherence when generating the output. If set to
  244. * true, the model will always follow the exact schema defined in the `schema`
  245. * field. Only a subset of JSON Schema is supported when `strict` is `true`. To
  246. * learn more, read the
  247. * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
  248. */
  249. strict?: boolean | null;
  250. }
  251. }
  252. /**
  253. * Default response format. Used to generate text responses.
  254. */
  255. export interface ResponseFormatText {
  256. /**
  257. * The type of response format being defined. Always `text`.
  258. */
  259. type: 'text';
  260. }
  261. /**
  262. * A custom grammar for the model to follow when generating text. Learn more in the
  263. * [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars).
  264. */
  265. export interface ResponseFormatTextGrammar {
  266. /**
  267. * The custom grammar for the model to follow.
  268. */
  269. grammar: string;
  270. /**
  271. * The type of response format being defined. Always `grammar`.
  272. */
  273. type: 'grammar';
  274. }
  275. /**
  276. * Configure the model to generate valid Python code. See the
  277. * [custom grammars guide](https://platform.openai.com/docs/guides/custom-grammars)
  278. * for more details.
  279. */
  280. export interface ResponseFormatTextPython {
  281. /**
  282. * The type of response format being defined. Always `python`.
  283. */
  284. type: 'python';
  285. }
  286. export type ResponsesModel = (string & {}) | ChatModel | 'o1-pro' | 'o1-pro-2025-03-19' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o3-deep-research' | 'o3-deep-research-2025-06-26' | 'o4-mini-deep-research' | 'o4-mini-deep-research-2025-06-26' | 'computer-use-preview' | 'computer-use-preview-2025-03-11' | 'gpt-5-codex' | 'gpt-5-pro' | 'gpt-5-pro-2025-10-06' | 'gpt-5.1-codex-max';
  287. //# sourceMappingURL=shared.d.mts.map