ogx-client 0.8.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/.github/workflows/release-doctor.yml +0 -2
  2. package/.release-please-manifest.json +1 -1
  3. package/.stats.yml +4 -4
  4. package/CHANGELOG.md +27 -0
  5. package/CONTRIBUTING.md +0 -14
  6. package/README.md +5 -4
  7. package/api.md +26 -48
  8. package/bin/check-release-environment +0 -4
  9. package/dist/CHANGELOG.md +27 -0
  10. package/dist/README.md +5 -4
  11. package/dist/index.d.mts +2 -18
  12. package/dist/index.d.ts +2 -18
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +0 -15
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +1 -16
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/package.json +1 -1
  19. package/dist/resources/chat/chat.d.ts +2 -2
  20. package/dist/resources/chat/chat.d.ts.map +1 -1
  21. package/dist/resources/chat/chat.js +2 -2
  22. package/dist/resources/chat/chat.js.map +1 -1
  23. package/dist/resources/chat/chat.mjs +2 -2
  24. package/dist/resources/chat/completions/completions.d.ts +2021 -0
  25. package/dist/resources/chat/completions/completions.d.ts.map +1 -0
  26. package/dist/resources/chat/completions/completions.js +70 -0
  27. package/dist/resources/chat/completions/completions.js.map +1 -0
  28. package/dist/resources/chat/completions/completions.mjs +43 -0
  29. package/dist/resources/chat/completions/completions.mjs.map +1 -0
  30. package/dist/resources/chat/completions/index.d.ts +3 -0
  31. package/dist/resources/chat/completions/index.d.ts.map +1 -0
  32. package/dist/resources/chat/completions/index.js +16 -0
  33. package/dist/resources/chat/completions/index.js.map +1 -0
  34. package/dist/resources/chat/completions/index.mjs +10 -0
  35. package/dist/resources/chat/completions/index.mjs.map +1 -0
  36. package/dist/resources/chat/completions/messages.d.ts +204 -0
  37. package/dist/resources/chat/completions/messages.d.ts.map +1 -0
  38. package/dist/resources/chat/completions/messages.js +35 -0
  39. package/dist/resources/chat/completions/messages.js.map +1 -0
  40. package/dist/resources/chat/completions/messages.mjs +30 -0
  41. package/dist/resources/chat/completions/messages.mjs.map +1 -0
  42. package/dist/resources/chat/completions.d.ts +1 -2020
  43. package/dist/resources/chat/completions.d.ts.map +1 -1
  44. package/dist/resources/chat/completions.js +15 -29
  45. package/dist/resources/chat/completions.js.map +1 -1
  46. package/dist/resources/chat/completions.mjs +1 -27
  47. package/dist/resources/chat/completions.mjs.map +1 -1
  48. package/dist/resources/chat/index.d.ts +1 -1
  49. package/dist/resources/chat/index.d.ts.map +1 -1
  50. package/dist/resources/chat/index.js +2 -2
  51. package/dist/resources/chat/index.js.map +1 -1
  52. package/dist/resources/chat/index.mjs +1 -1
  53. package/dist/resources/completions.d.ts +2 -2
  54. package/dist/resources/completions.d.ts.map +1 -1
  55. package/dist/resources/conversations/conversations.d.ts +12 -11
  56. package/dist/resources/conversations/conversations.d.ts.map +1 -1
  57. package/dist/resources/conversations/conversations.js.map +1 -1
  58. package/dist/resources/conversations/conversations.mjs.map +1 -1
  59. package/dist/resources/conversations/index.d.ts +1 -1
  60. package/dist/resources/conversations/index.d.ts.map +1 -1
  61. package/dist/resources/conversations/items.d.ts +49 -29
  62. package/dist/resources/conversations/items.d.ts.map +1 -1
  63. package/dist/resources/conversations/items.js +5 -5
  64. package/dist/resources/conversations/items.js.map +1 -1
  65. package/dist/resources/conversations/items.mjs +5 -5
  66. package/dist/resources/conversations/items.mjs.map +1 -1
  67. package/dist/resources/files.d.ts +10 -10
  68. package/dist/resources/files.d.ts.map +1 -1
  69. package/dist/resources/files.js.map +1 -1
  70. package/dist/resources/files.mjs.map +1 -1
  71. package/dist/resources/index.d.ts +1 -4
  72. package/dist/resources/index.d.ts.map +1 -1
  73. package/dist/resources/index.js +1 -7
  74. package/dist/resources/index.js.map +1 -1
  75. package/dist/resources/index.mjs +1 -4
  76. package/dist/resources/index.mjs.map +1 -1
  77. package/dist/resources/models/index.d.ts +2 -2
  78. package/dist/resources/models/index.d.ts.map +1 -1
  79. package/dist/resources/models/index.js.map +1 -1
  80. package/dist/resources/models/index.mjs +1 -1
  81. package/dist/resources/models/index.mjs.map +1 -1
  82. package/dist/resources/models/models.d.ts +220 -32
  83. package/dist/resources/models/models.d.ts.map +1 -1
  84. package/dist/resources/models/models.js +32 -10
  85. package/dist/resources/models/models.js.map +1 -1
  86. package/dist/resources/models/models.mjs +32 -10
  87. package/dist/resources/models/models.mjs.map +1 -1
  88. package/dist/resources/models/openai.d.ts +128 -2
  89. package/dist/resources/models/openai.d.ts.map +1 -1
  90. package/dist/resources/models/openai.js +17 -5
  91. package/dist/resources/models/openai.js.map +1 -1
  92. package/dist/resources/models/openai.mjs +17 -5
  93. package/dist/resources/models/openai.mjs.map +1 -1
  94. package/dist/resources/responses/responses.d.ts +0 -16
  95. package/dist/resources/responses/responses.d.ts.map +1 -1
  96. package/dist/resources/responses/responses.js.map +1 -1
  97. package/dist/resources/responses/responses.mjs.map +1 -1
  98. package/dist/resources/shared.d.ts +0 -19
  99. package/dist/resources/shared.d.ts.map +1 -1
  100. package/dist/src/index.ts +12 -43
  101. package/dist/src/resources/chat/chat.ts +2 -2
  102. package/dist/src/resources/chat/completions/completions.ts +2444 -0
  103. package/dist/src/resources/chat/completions/index.ts +24 -0
  104. package/dist/src/resources/chat/completions/messages.ts +273 -0
  105. package/dist/src/resources/chat/completions.ts +1 -2422
  106. package/dist/src/resources/chat/index.ts +1 -1
  107. package/dist/src/resources/completions.ts +2 -2
  108. package/dist/src/resources/conversations/conversations.ts +15 -9
  109. package/dist/src/resources/conversations/index.ts +1 -1
  110. package/dist/src/resources/conversations/items.ts +84 -28
  111. package/dist/src/resources/files.ts +29 -10
  112. package/dist/src/resources/index.ts +9 -10
  113. package/dist/src/resources/models/index.ts +10 -2
  114. package/dist/src/resources/models/models.ts +321 -32
  115. package/dist/src/resources/models/openai.ts +180 -3
  116. package/dist/src/resources/responses/responses.ts +0 -21
  117. package/dist/src/resources/shared.ts +0 -20
  118. package/dist/src/version.ts +1 -1
  119. package/dist/version.d.ts +1 -1
  120. package/dist/version.js +1 -1
  121. package/dist/version.mjs +1 -1
  122. package/package.json +1 -1
  123. package/src/index.ts +12 -43
  124. package/src/resources/chat/chat.ts +2 -2
  125. package/src/resources/chat/completions/completions.ts +2444 -0
  126. package/src/resources/chat/completions/index.ts +24 -0
  127. package/src/resources/chat/completions/messages.ts +273 -0
  128. package/src/resources/chat/completions.ts +1 -2422
  129. package/src/resources/chat/index.ts +1 -1
  130. package/src/resources/completions.ts +2 -2
  131. package/src/resources/conversations/conversations.ts +15 -9
  132. package/src/resources/conversations/index.ts +1 -1
  133. package/src/resources/conversations/items.ts +84 -28
  134. package/src/resources/files.ts +29 -10
  135. package/src/resources/index.ts +9 -10
  136. package/src/resources/models/index.ts +10 -2
  137. package/src/resources/models/models.ts +321 -32
  138. package/src/resources/models/openai.ts +180 -3
  139. package/src/resources/responses/responses.ts +0 -21
  140. package/src/resources/shared.ts +0 -20
  141. package/src/version.ts +1 -1
  142. package/tests/api-resources/chat/{completions.test.ts → completions/completions.test.ts} +0 -1
  143. package/tests/api-resources/chat/completions/messages.test.ts +47 -0
  144. package/tests/api-resources/completions.test.ts +1 -1
  145. package/tests/api-resources/conversations/items.test.ts +12 -0
  146. package/tests/api-resources/models/models.test.ts +34 -0
  147. package/tests/api-resources/models/openai.test.ts +18 -0
  148. package/tests/api-resources/responses/responses.test.ts +0 -2
  149. package/.github/workflows/publish-npm.yml +0 -32
  150. package/dist/resources/moderations.d.ts +0 -83
  151. package/dist/resources/moderations.d.ts.map +0 -1
  152. package/dist/resources/moderations.js +0 -24
  153. package/dist/resources/moderations.js.map +0 -1
  154. package/dist/resources/moderations.mjs +0 -20
  155. package/dist/resources/moderations.mjs.map +0 -1
  156. package/dist/resources/safety.d.ts +0 -297
  157. package/dist/resources/safety.d.ts.map +0 -1
  158. package/dist/resources/safety.js +0 -24
  159. package/dist/resources/safety.js.map +0 -1
  160. package/dist/resources/safety.mjs +0 -20
  161. package/dist/resources/safety.mjs.map +0 -1
  162. package/dist/resources/shields.d.ts +0 -82
  163. package/dist/resources/shields.d.ts.map +0 -1
  164. package/dist/resources/shields.js +0 -46
  165. package/dist/resources/shields.js.map +0 -1
  166. package/dist/resources/shields.mjs +0 -42
  167. package/dist/resources/shields.mjs.map +0 -1
  168. package/dist/src/resources/moderations.ts +0 -97
  169. package/dist/src/resources/safety.ts +0 -367
  170. package/dist/src/resources/shields.ts +0 -119
  171. package/src/resources/moderations.ts +0 -97
  172. package/src/resources/safety.ts +0 -367
  173. package/src/resources/shields.ts +0 -119
  174. package/tests/api-resources/moderations.test.ts +0 -29
  175. package/tests/api-resources/safety.test.ts +0 -41
  176. package/tests/api-resources/shields.test.ts +0 -88
@@ -0,0 +1,24 @@
1
+ // Copyright (c) The OGX Contributors.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ //
7
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
+
9
+ export {
10
+ Completions,
11
+ type CompletionCreateResponse,
12
+ type CompletionRetrieveResponse,
13
+ type CompletionListResponse,
14
+ type CompletionCreateParams,
15
+ type CompletionCreateParamsNonStreaming,
16
+ type CompletionCreateParamsStreaming,
17
+ type CompletionListParams,
18
+ } from './completions';
19
+ export {
20
+ MessageListResponsesOpenAICursorPage,
21
+ Messages,
22
+ type MessageListResponse,
23
+ type MessageListParams,
24
+ } from './messages';
@@ -0,0 +1,273 @@
1
+ // Copyright (c) The OGX Contributors.
2
+ // All rights reserved.
3
+ //
4
+ // This source code is licensed under the terms described in the LICENSE file in
5
+ // the root directory of this source tree.
6
+ //
7
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
8
+
9
+ import { APIResource } from '../../../resource';
10
+ import { isRequestOptions } from '../../../core';
11
+ import * as Core from '../../../core';
12
+ import { OpenAICursorPage, type OpenAICursorPageParams } from '../../../pagination';
13
+
14
+ /**
15
+ * OGX Inference API for generating completions, chat completions, and embeddings.
16
+ *
17
+ * This API provides the raw interface to the underlying models. Three kinds of models are supported:
18
+ * - LLM models: these models generate "raw" and "chat" (conversational) completions.
19
+ * - Embedding models: these models generate embeddings to be used for semantic search.
20
+ * - Rerank models: these models reorder the documents based on their relevance to a query.
21
+ */
22
+ export class Messages extends APIResource {
23
+ /**
24
+ * Get the messages in a stored chat completion.
25
+ */
26
+ list(
27
+ completionId: string,
28
+ query?: MessageListParams,
29
+ options?: Core.RequestOptions,
30
+ ): Core.PagePromise<MessageListResponsesOpenAICursorPage, MessageListResponse>;
31
+ list(
32
+ completionId: string,
33
+ options?: Core.RequestOptions,
34
+ ): Core.PagePromise<MessageListResponsesOpenAICursorPage, MessageListResponse>;
35
+ list(
36
+ completionId: string,
37
+ query: MessageListParams | Core.RequestOptions = {},
38
+ options?: Core.RequestOptions,
39
+ ): Core.PagePromise<MessageListResponsesOpenAICursorPage, MessageListResponse> {
40
+ if (isRequestOptions(query)) {
41
+ return this.list(completionId, {}, query);
42
+ }
43
+ return this._client.getAPIList(
44
+ `/v1/chat/completions/${completionId}/messages`,
45
+ MessageListResponsesOpenAICursorPage,
46
+ { query, ...options },
47
+ );
48
+ }
49
+ }
50
+
51
+ export class MessageListResponsesOpenAICursorPage extends OpenAICursorPage<MessageListResponse> {}
52
+
53
+ /**
54
+ * A message from a stored chat completion.
55
+ */
56
+ export interface MessageListResponse {
57
+ /**
58
+ * The identifier of the chat message.
59
+ */
60
+ id: string;
61
+
62
+ /**
63
+ * The role of the message author.
64
+ */
65
+ role: 'developer' | 'system' | 'user' | 'assistant' | 'tool';
66
+
67
+ /**
68
+ * Annotations for the message, when applicable.
69
+ */
70
+ annotations?: Array<{ [key: string]: unknown }> | null;
71
+
72
+ /**
73
+ * Audio response data when using audio output modality.
74
+ */
75
+ audio?: { [key: string]: unknown } | null;
76
+
77
+ /**
78
+ * The text content of the message.
79
+ */
80
+ content?: string | null;
81
+
82
+ /**
83
+ * Multipart content parts when the original message used content parts. Only text
84
+ * and image_url parts.
85
+ */
86
+ content_parts?: Array<
87
+ | MessageListResponse.OpenAIChatCompletionContentPartTextParam
88
+ | MessageListResponse.OpenAIChatCompletionContentPartImageParam
89
+ > | null;
90
+
91
+ /**
92
+ * Deprecated: the name and arguments of a function that should be called.
93
+ */
94
+ function_call?: MessageListResponse.FunctionCall;
95
+
96
+ /**
97
+ * The name of the message participant.
98
+ */
99
+ name?: string | null;
100
+
101
+ /**
102
+ * The refusal message generated by the model, when applicable.
103
+ */
104
+ refusal?: string | null;
105
+
106
+ /**
107
+ * For tool messages, the identifier of the tool call this message responds to.
108
+ */
109
+ tool_call_id?: string | null;
110
+
111
+ /**
112
+ * The tool calls generated by the message, when applicable.
113
+ */
114
+ tool_calls?: Array<
115
+ | MessageListResponse.ChatCompletionMessageToolCall
116
+ | MessageListResponse.ChatCompletionMessageCustomToolCall
117
+ >;
118
+ }
119
+
120
+ export namespace MessageListResponse {
121
+ /**
122
+ * Text content part for OpenAI-compatible chat completion messages.
123
+ */
124
+ export interface OpenAIChatCompletionContentPartTextParam {
125
+ /**
126
+ * The text content of the message.
127
+ */
128
+ text: string;
129
+
130
+ /**
131
+ * Must be 'text' to identify this as text content.
132
+ */
133
+ type?: 'text';
134
+ }
135
+
136
+ /**
137
+ * Image content part for OpenAI-compatible chat completion messages.
138
+ */
139
+ export interface OpenAIChatCompletionContentPartImageParam {
140
+ /**
141
+ * Image URL specification and processing details.
142
+ */
143
+ image_url: OpenAIChatCompletionContentPartImageParam.ImageURL;
144
+
145
+ /**
146
+ * Must be 'image_url' to identify this as image content.
147
+ */
148
+ type?: 'image_url';
149
+ }
150
+
151
+ export namespace OpenAIChatCompletionContentPartImageParam {
152
+ /**
153
+ * Image URL specification and processing details.
154
+ */
155
+ export interface ImageURL {
156
+ /**
157
+ * URL of the image to include in the message.
158
+ */
159
+ url: string;
160
+
161
+ /**
162
+ * Level of detail for image processing. Can be 'low', 'high', or 'auto'.
163
+ */
164
+ detail?: 'low' | 'high' | 'auto' | null;
165
+ }
166
+ }
167
+
168
+ /**
169
+ * Deprecated: the name and arguments of a function that should be called.
170
+ */
171
+ export interface FunctionCall {
172
+ /**
173
+ * Arguments to pass to the function as a JSON string.
174
+ */
175
+ arguments: string;
176
+
177
+ /**
178
+ * Name of the function to call.
179
+ */
180
+ name: string;
181
+ }
182
+
183
+ /**
184
+ * Tool call specification for OpenAI-compatible chat completion responses.
185
+ */
186
+ export interface ChatCompletionMessageToolCall {
187
+ /**
188
+ * Unique identifier for the tool call.
189
+ */
190
+ id: string;
191
+
192
+ /**
193
+ * Function call details.
194
+ */
195
+ function: ChatCompletionMessageToolCall.Function;
196
+
197
+ /**
198
+ * Must be 'function' to identify this as a function call.
199
+ */
200
+ type: 'function';
201
+ }
202
+
203
+ export namespace ChatCompletionMessageToolCall {
204
+ /**
205
+ * Function call details.
206
+ */
207
+ export interface Function {
208
+ /**
209
+ * Arguments to pass to the function as a JSON string.
210
+ */
211
+ arguments: string;
212
+
213
+ /**
214
+ * Name of the function to call.
215
+ */
216
+ name: string;
217
+ }
218
+ }
219
+
220
+ /**
221
+ * A call to a custom tool created by the model.
222
+ */
223
+ export interface ChatCompletionMessageCustomToolCall {
224
+ /**
225
+ * The ID of the tool call.
226
+ */
227
+ id: string;
228
+
229
+ /**
230
+ * The custom tool that the model called.
231
+ */
232
+ custom: ChatCompletionMessageCustomToolCall.Custom;
233
+
234
+ /**
235
+ * The type of the tool. Always 'custom'.
236
+ */
237
+ type: 'custom';
238
+ }
239
+
240
+ export namespace ChatCompletionMessageCustomToolCall {
241
+ /**
242
+ * The custom tool that the model called.
243
+ */
244
+ export interface Custom {
245
+ /**
246
+ * The input for the custom tool call generated by the model.
247
+ */
248
+ input: string;
249
+
250
+ /**
251
+ * The name of the custom tool to call.
252
+ */
253
+ name: string;
254
+ }
255
+ }
256
+ }
257
+
258
+ export interface MessageListParams extends OpenAICursorPageParams {
259
+ /**
260
+ * Sort order for messages by timestamp. Use "asc" or "desc". Defaults to "asc".
261
+ */
262
+ order?: 'asc' | 'desc' | null;
263
+ }
264
+
265
+ Messages.MessageListResponsesOpenAICursorPage = MessageListResponsesOpenAICursorPage;
266
+
267
+ export declare namespace Messages {
268
+ export {
269
+ type MessageListResponse as MessageListResponse,
270
+ MessageListResponsesOpenAICursorPage as MessageListResponsesOpenAICursorPage,
271
+ type MessageListParams as MessageListParams,
272
+ };
273
+ }