shared.d.ts 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. export type AllModels = (string & {}) | ChatModel | 'o1-pro' | 'o1-pro-2025-03-19' | 'computer-use-preview' | 'computer-use-preview-2025-03-11';
  2. export type ChatModel = '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-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`.
  14. *
  15. * - `eq`: equals
  16. * - `ne`: not equal
  17. * - `gt`: greater than
  18. * - `gte`: greater than or equal
  19. * - `lt`: less than
  20. * - `lte`: less than or equal
  21. */
  22. type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte';
  23. /**
  24. * The value to compare against the attribute key; supports string, number, or
  25. * boolean types.
  26. */
  27. value: string | number | boolean;
  28. }
  29. /**
  30. * Combine multiple filters using `and` or `or`.
  31. */
  32. export interface CompoundFilter {
  33. /**
  34. * Array of filters to combine. Items can be `ComparisonFilter` or
  35. * `CompoundFilter`.
  36. */
  37. filters: Array<ComparisonFilter | unknown>;
  38. /**
  39. * Type of operation: `and` or `or`.
  40. */
  41. type: 'and' | 'or';
  42. }
  43. export interface ErrorObject {
  44. code: string | null;
  45. message: string;
  46. param: string | null;
  47. type: string;
  48. }
  49. export interface FunctionDefinition {
  50. /**
  51. * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain
  52. * underscores and dashes, with a maximum length of 64.
  53. */
  54. name: string;
  55. /**
  56. * A description of what the function does, used by the model to choose when and
  57. * how to call the function.
  58. */
  59. description?: string;
  60. /**
  61. * The parameters the functions accepts, described as a JSON Schema object. See the
  62. * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
  63. * and the
  64. * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
  65. * documentation about the format.
  66. *
  67. * Omitting `parameters` defines a function with an empty parameter list.
  68. */
  69. parameters?: FunctionParameters;
  70. /**
  71. * Whether to enable strict schema adherence when generating the function call. If
  72. * set to true, the model will follow the exact schema defined in the `parameters`
  73. * field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn
  74. * more about Structured Outputs in the
  75. * [function calling guide](docs/guides/function-calling).
  76. */
  77. strict?: boolean | null;
  78. }
  79. /**
  80. * The parameters the functions accepts, described as a JSON Schema object. See the
  81. * [guide](https://platform.openai.com/docs/guides/function-calling) for examples,
  82. * and the
  83. * [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for
  84. * documentation about the format.
  85. *
  86. * Omitting `parameters` defines a function with an empty parameter list.
  87. */
  88. export type FunctionParameters = Record<string, unknown>;
  89. /**
  90. * Set of 16 key-value pairs that can be attached to an object. This can be useful
  91. * for storing additional information about the object in a structured format, and
  92. * querying for objects via API or the dashboard.
  93. *
  94. * Keys are strings with a maximum length of 64 characters. Values are strings with
  95. * a maximum length of 512 characters.
  96. */
  97. export type Metadata = Record<string, string>;
  98. /**
  99. * **o-series models only**
  100. *
  101. * Configuration options for
  102. * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
  103. */
  104. export interface Reasoning {
  105. /**
  106. * **o-series models only**
  107. *
  108. * Constrains effort on reasoning for
  109. * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
  110. * supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
  111. * result in faster responses and fewer tokens used on reasoning in a response.
  112. */
  113. effort?: ReasoningEffort | null;
  114. /**
  115. * @deprecated **Deprecated:** use `summary` instead.
  116. *
  117. * A summary of the reasoning performed by the model. This can be useful for
  118. * debugging and understanding the model's reasoning process. One of `auto`,
  119. * `concise`, or `detailed`.
  120. */
  121. generate_summary?: 'auto' | 'concise' | 'detailed' | null;
  122. /**
  123. * A summary of the reasoning performed by the model. This can be useful for
  124. * debugging and understanding the model's reasoning process. One of `auto`,
  125. * `concise`, or `detailed`.
  126. */
  127. summary?: 'auto' | 'concise' | 'detailed' | null;
  128. }
  129. /**
  130. * **o-series models only**
  131. *
  132. * Constrains effort on reasoning for
  133. * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
  134. * supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
  135. * result in faster responses and fewer tokens used on reasoning in a response.
  136. */
  137. export type ReasoningEffort = 'low' | 'medium' | 'high' | null;
  138. /**
  139. * JSON object response format. An older method of generating JSON responses. Using
  140. * `json_schema` is recommended for models that support it. Note that the model
  141. * will not generate JSON without a system or user message instructing it to do so.
  142. */
  143. export interface ResponseFormatJSONObject {
  144. /**
  145. * The type of response format being defined. Always `json_object`.
  146. */
  147. type: 'json_object';
  148. }
  149. /**
  150. * JSON Schema response format. Used to generate structured JSON responses. Learn
  151. * more about
  152. * [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs).
  153. */
  154. export interface ResponseFormatJSONSchema {
  155. /**
  156. * Structured Outputs configuration options, including a JSON Schema.
  157. */
  158. json_schema: ResponseFormatJSONSchema.JSONSchema;
  159. /**
  160. * The type of response format being defined. Always `json_schema`.
  161. */
  162. type: 'json_schema';
  163. }
  164. export declare namespace ResponseFormatJSONSchema {
  165. /**
  166. * Structured Outputs configuration options, including a JSON Schema.
  167. */
  168. interface JSONSchema {
  169. /**
  170. * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores
  171. * and dashes, with a maximum length of 64.
  172. */
  173. name: string;
  174. /**
  175. * A description of what the response format is for, used by the model to determine
  176. * how to respond in the format.
  177. */
  178. description?: string;
  179. /**
  180. * The schema for the response format, described as a JSON Schema object. Learn how
  181. * to build JSON schemas [here](https://json-schema.org/).
  182. */
  183. schema?: Record<string, unknown>;
  184. /**
  185. * Whether to enable strict schema adherence when generating the output. If set to
  186. * true, the model will always follow the exact schema defined in the `schema`
  187. * field. Only a subset of JSON Schema is supported when `strict` is `true`. To
  188. * learn more, read the
  189. * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
  190. */
  191. strict?: boolean | null;
  192. }
  193. }
  194. /**
  195. * Default response format. Used to generate text responses.
  196. */
  197. export interface ResponseFormatText {
  198. /**
  199. * The type of response format being defined. Always `text`.
  200. */
  201. type: 'text';
  202. }
  203. export type ResponsesModel = (string & {}) | ChatModel | 'o1-pro' | 'o1-pro-2025-03-19' | 'computer-use-preview' | 'computer-use-preview-2025-03-11';
  204. //# sourceMappingURL=shared.d.ts.map