Comparing version
# Changelog | ||
## 4.19.0 (2023-11-15) | ||
Full Changelog: [v4.18.0...v4.19.0](https://github.com/openai/openai-node/compare/v4.18.0...v4.19.0) | ||
### Features | ||
* **api:** updates ([#501](https://github.com/openai/openai-node/issues/501)) ([944d58e](https://github.com/openai/openai-node/commit/944d58e5fc46f1a0671aaa2b809d28e67edf6023)) | ||
## 4.18.0 (2023-11-14) | ||
@@ -4,0 +12,0 @@ |
@@ -129,12 +129,2 @@ | ||
} | ||
export declare class APIResource { | ||
protected client: APIClient; | ||
constructor(client: APIClient); | ||
protected get: APIClient['get']; | ||
protected post: APIClient['post']; | ||
protected patch: APIClient['patch']; | ||
protected put: APIClient['put']; | ||
protected delete: APIClient['delete']; | ||
protected getAPIList: APIClient['getAPIList']; | ||
} | ||
export type PageInfo = { | ||
@@ -141,0 +131,0 @@ url: URL; |
14
core.js
@@ -15,3 +15,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toBase64 = exports.getRequiredHeader = exports.isHeadersProtocol = exports.isRunningInBrowser = exports.debug = exports.hasOwn = exports.isEmptyObj = exports.maybeCoerceBoolean = exports.maybeCoerceFloat = exports.maybeCoerceInteger = exports.coerceBoolean = exports.coerceFloat = exports.coerceInteger = exports.readEnv = exports.ensurePresent = exports.castToError = exports.sleep = exports.safeJSON = exports.isRequestOptions = exports.createResponseHeaders = exports.PagePromise = exports.AbstractPage = exports.APIResource = exports.APIClient = exports.APIPromise = exports.createForm = exports.multipartFormRequestOptions = exports.maybeMultipartFormRequestOptions = void 0; | ||
exports.toBase64 = exports.getRequiredHeader = exports.isHeadersProtocol = exports.isRunningInBrowser = exports.debug = exports.hasOwn = exports.isEmptyObj = exports.maybeCoerceBoolean = exports.maybeCoerceFloat = exports.maybeCoerceInteger = exports.coerceBoolean = exports.coerceFloat = exports.coerceInteger = exports.readEnv = exports.ensurePresent = exports.castToError = exports.sleep = exports.safeJSON = exports.isRequestOptions = exports.createResponseHeaders = exports.PagePromise = exports.AbstractPage = exports.APIClient = exports.APIPromise = exports.createForm = exports.multipartFormRequestOptions = exports.maybeMultipartFormRequestOptions = void 0; | ||
const version_1 = require("./version.js"); | ||
@@ -404,14 +404,2 @@ const streaming_1 = require("./streaming.js"); | ||
exports.APIClient = APIClient; | ||
class APIResource { | ||
constructor(client) { | ||
this.client = client; | ||
this.get = client.get.bind(client); | ||
this.post = client.post.bind(client); | ||
this.patch = client.patch.bind(client); | ||
this.put = client.put.bind(client); | ||
this.delete = client.delete.bind(client); | ||
this.getAPIList = client.getAPIList.bind(client); | ||
} | ||
} | ||
exports.APIResource = APIResource; | ||
class AbstractPage { | ||
@@ -418,0 +406,0 @@ constructor(client, response, body, options) { |
{ | ||
"name": "openai", | ||
"version": "4.18.0", | ||
"version": "4.19.0", | ||
"description": "Client library for the OpenAI API", | ||
@@ -5,0 +5,0 @@ "author": "OpenAI <support@openai.com>", |
@@ -24,3 +24,3 @@ # OpenAI Node API Library | ||
```ts | ||
import OpenAI from 'https://deno.land/x/openai@v4.18.0/mod.ts'; | ||
import OpenAI from 'https://deno.land/x/openai@v4.19.0/mod.ts'; | ||
``` | ||
@@ -27,0 +27,0 @@ |
import type { OpenAI } from "./index.js"; | ||
export declare class APIResource { | ||
protected client: OpenAI; | ||
protected _client: OpenAI; | ||
constructor(client: OpenAI); | ||
protected get: OpenAI['get']; | ||
protected post: OpenAI['post']; | ||
protected patch: OpenAI['patch']; | ||
protected put: OpenAI['put']; | ||
protected delete: OpenAI['delete']; | ||
protected getAPIList: OpenAI['getAPIList']; | ||
} | ||
//# sourceMappingURL=resource.d.ts.map |
@@ -7,9 +7,3 @@ "use strict"; | ||
constructor(client) { | ||
this.client = client; | ||
this.get = client.get.bind(client); | ||
this.post = client.post.bind(client); | ||
this.patch = client.patch.bind(client); | ||
this.put = client.put.bind(client); | ||
this.delete = client.delete.bind(client); | ||
this.getAPIList = client.getAPIList.bind(client); | ||
this._client = client; | ||
} | ||
@@ -16,0 +10,0 @@ } |
@@ -35,5 +35,5 @@ "use strict"; | ||
super(...arguments); | ||
this.transcriptions = new TranscriptionsAPI.Transcriptions(this.client); | ||
this.translations = new TranslationsAPI.Translations(this.client); | ||
this.speech = new SpeechAPI.Speech(this.client); | ||
this.transcriptions = new TranscriptionsAPI.Transcriptions(this._client); | ||
this.translations = new TranslationsAPI.Translations(this._client); | ||
this.speech = new SpeechAPI.Speech(this._client); | ||
} | ||
@@ -40,0 +40,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/audio/speech', { body, ...options, __binaryResponse: true }); | ||
return this._client.post('/audio/speech', { body, ...options, __binaryResponse: true }); | ||
} | ||
@@ -14,0 +14,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/audio/transcriptions', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
return this._client.post('/audio/transcriptions', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
} | ||
@@ -15,0 +15,0 @@ } |
@@ -12,3 +12,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/audio/translations', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
return this._client.post('/audio/translations', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
} | ||
@@ -15,0 +15,0 @@ } |
@@ -36,3 +36,3 @@ "use strict"; | ||
super(...arguments); | ||
this.files = new FilesAPI.Files(this.client); | ||
this.files = new FilesAPI.Files(this._client); | ||
} | ||
@@ -43,3 +43,3 @@ /** | ||
create(body, options) { | ||
return this.post('/assistants', { | ||
return this._client.post('/assistants', { | ||
body, | ||
@@ -54,3 +54,3 @@ ...options, | ||
retrieve(assistantId, options) { | ||
return this.get(`/assistants/${assistantId}`, { | ||
return this._client.get(`/assistants/${assistantId}`, { | ||
...options, | ||
@@ -64,3 +64,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
update(assistantId, body, options) { | ||
return this.post(`/assistants/${assistantId}`, { | ||
return this._client.post(`/assistants/${assistantId}`, { | ||
body, | ||
@@ -75,3 +75,3 @@ ...options, | ||
} | ||
return this.getAPIList('/assistants', AssistantsPage, { | ||
return this._client.getAPIList('/assistants', AssistantsPage, { | ||
query, | ||
@@ -86,3 +86,3 @@ ...options, | ||
del(assistantId, options) { | ||
return this.delete(`/assistants/${assistantId}`, { | ||
return this._client.delete(`/assistants/${assistantId}`, { | ||
...options, | ||
@@ -89,0 +89,0 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, |
@@ -39,3 +39,3 @@ "use strict"; | ||
create(assistantId, body, options) { | ||
return this.post(`/assistants/${assistantId}/files`, { | ||
return this._client.post(`/assistants/${assistantId}/files`, { | ||
body, | ||
@@ -50,3 +50,3 @@ ...options, | ||
retrieve(assistantId, fileId, options) { | ||
return this.get(`/assistants/${assistantId}/files/${fileId}`, { | ||
return this._client.get(`/assistants/${assistantId}/files/${fileId}`, { | ||
...options, | ||
@@ -60,3 +60,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
} | ||
return this.getAPIList(`/assistants/${assistantId}/files`, AssistantFilesPage, { | ||
return this._client.getAPIList(`/assistants/${assistantId}/files`, AssistantFilesPage, { | ||
query, | ||
@@ -71,3 +71,3 @@ ...options, | ||
del(assistantId, fileId, options) { | ||
return this.delete(`/assistants/${assistantId}/files/${fileId}`, { | ||
return this._client.delete(`/assistants/${assistantId}/files/${fileId}`, { | ||
...options, | ||
@@ -74,0 +74,0 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, |
@@ -35,5 +35,5 @@ "use strict"; | ||
super(...arguments); | ||
this.chat = new ChatAPI.Chat(this.client); | ||
this.assistants = new AssistantsAPI.Assistants(this.client); | ||
this.threads = new ThreadsAPI.Threads(this.client); | ||
this.chat = new ChatAPI.Chat(this._client); | ||
this.assistants = new AssistantsAPI.Assistants(this._client); | ||
this.threads = new ThreadsAPI.Threads(this._client); | ||
} | ||
@@ -40,0 +40,0 @@ } |
@@ -33,3 +33,3 @@ "use strict"; | ||
super(...arguments); | ||
this.completions = new CompletionsAPI.Completions(this.client); | ||
this.completions = new CompletionsAPI.Completions(this._client); | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -20,11 +20,11 @@ "use strict"; | ||
if (body.stream) { | ||
return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runFunctions(this.client.chat.completions, body, options); | ||
return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runFunctions(this._client.chat.completions, body, options); | ||
} | ||
return ChatCompletionRunner_1.ChatCompletionRunner.runFunctions(this.client.chat.completions, body, options); | ||
return ChatCompletionRunner_1.ChatCompletionRunner.runFunctions(this._client.chat.completions, body, options); | ||
} | ||
runTools(body, options) { | ||
if (body.stream) { | ||
return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runTools(this.client.chat.completions, body, options); | ||
return ChatCompletionStreamingRunner_1.ChatCompletionStreamingRunner.runTools(this._client.chat.completions, body, options); | ||
} | ||
return ChatCompletionRunner_1.ChatCompletionRunner.runTools(this.client.chat.completions, body, options); | ||
return ChatCompletionRunner_1.ChatCompletionRunner.runTools(this._client.chat.completions, body, options); | ||
} | ||
@@ -35,3 +35,3 @@ /** | ||
stream(body, options) { | ||
return ChatCompletionStream_1.ChatCompletionStream.createChatCompletion(this.client.chat.completions, body, options); | ||
return ChatCompletionStream_1.ChatCompletionStream.createChatCompletion(this._client.chat.completions, body, options); | ||
} | ||
@@ -38,0 +38,0 @@ } |
@@ -37,3 +37,3 @@ "use strict"; | ||
retrieve(threadId, messageId, fileId, options) { | ||
return this.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, { | ||
return this._client.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, { | ||
...options, | ||
@@ -47,3 +47,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/messages/${messageId}/files`, MessageFilesPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/messages/${messageId}/files`, MessageFilesPage, { | ||
query, | ||
@@ -50,0 +50,0 @@ ...options, |
@@ -36,3 +36,3 @@ "use strict"; | ||
super(...arguments); | ||
this.files = new FilesAPI.Files(this.client); | ||
this.files = new FilesAPI.Files(this._client); | ||
} | ||
@@ -43,3 +43,3 @@ /** | ||
create(threadId, body, options) { | ||
return this.post(`/threads/${threadId}/messages`, { | ||
return this._client.post(`/threads/${threadId}/messages`, { | ||
body, | ||
@@ -54,3 +54,3 @@ ...options, | ||
retrieve(threadId, messageId, options) { | ||
return this.get(`/threads/${threadId}/messages/${messageId}`, { | ||
return this._client.get(`/threads/${threadId}/messages/${messageId}`, { | ||
...options, | ||
@@ -64,3 +64,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
update(threadId, messageId, body, options) { | ||
return this.post(`/threads/${threadId}/messages/${messageId}`, { | ||
return this._client.post(`/threads/${threadId}/messages/${messageId}`, { | ||
body, | ||
@@ -75,3 +75,3 @@ ...options, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/messages`, ThreadMessagesPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/messages`, ThreadMessagesPage, { | ||
query, | ||
@@ -78,0 +78,0 @@ ...options, |
@@ -36,3 +36,3 @@ "use strict"; | ||
super(...arguments); | ||
this.steps = new StepsAPI.Steps(this.client); | ||
this.steps = new StepsAPI.Steps(this._client); | ||
} | ||
@@ -43,3 +43,3 @@ /** | ||
create(threadId, body, options) { | ||
return this.post(`/threads/${threadId}/runs`, { | ||
return this._client.post(`/threads/${threadId}/runs`, { | ||
body, | ||
@@ -54,3 +54,3 @@ ...options, | ||
retrieve(threadId, runId, options) { | ||
return this.get(`/threads/${threadId}/runs/${runId}`, { | ||
return this._client.get(`/threads/${threadId}/runs/${runId}`, { | ||
...options, | ||
@@ -64,3 +64,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
update(threadId, runId, body, options) { | ||
return this.post(`/threads/${threadId}/runs/${runId}`, { | ||
return this._client.post(`/threads/${threadId}/runs/${runId}`, { | ||
body, | ||
@@ -75,3 +75,3 @@ ...options, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/runs`, RunsPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/runs`, RunsPage, { | ||
query, | ||
@@ -86,3 +86,3 @@ ...options, | ||
cancel(threadId, runId, options) { | ||
return this.post(`/threads/${threadId}/runs/${runId}/cancel`, { | ||
return this._client.post(`/threads/${threadId}/runs/${runId}/cancel`, { | ||
...options, | ||
@@ -99,3 +99,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
submitToolOutputs(threadId, runId, body, options) { | ||
return this.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, { | ||
return this._client.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, { | ||
body, | ||
@@ -102,0 +102,0 @@ ...options, |
@@ -37,3 +37,3 @@ "use strict"; | ||
retrieve(threadId, runId, stepId, options) { | ||
return this.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { | ||
return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { | ||
...options, | ||
@@ -47,3 +47,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, { | ||
query, | ||
@@ -50,0 +50,0 @@ ...options, |
@@ -35,4 +35,4 @@ "use strict"; | ||
super(...arguments); | ||
this.runs = new RunsAPI.Runs(this.client); | ||
this.messages = new MessagesAPI.Messages(this.client); | ||
this.runs = new RunsAPI.Runs(this._client); | ||
this.messages = new MessagesAPI.Messages(this._client); | ||
} | ||
@@ -43,3 +43,3 @@ create(body = {}, options) { | ||
} | ||
return this.post('/threads', { | ||
return this._client.post('/threads', { | ||
body, | ||
@@ -54,3 +54,3 @@ ...options, | ||
retrieve(threadId, options) { | ||
return this.get(`/threads/${threadId}`, { | ||
return this._client.get(`/threads/${threadId}`, { | ||
...options, | ||
@@ -64,3 +64,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
update(threadId, body, options) { | ||
return this.post(`/threads/${threadId}`, { | ||
return this._client.post(`/threads/${threadId}`, { | ||
body, | ||
@@ -75,3 +75,3 @@ ...options, | ||
del(threadId, options) { | ||
return this.delete(`/threads/${threadId}`, { | ||
return this._client.delete(`/threads/${threadId}`, { | ||
...options, | ||
@@ -85,3 +85,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
createAndRun(body, options) { | ||
return this.post('/threads/runs', { | ||
return this._client.post('/threads/runs', { | ||
body, | ||
@@ -88,0 +88,0 @@ ...options, |
@@ -33,3 +33,3 @@ "use strict"; | ||
super(...arguments); | ||
this.completions = new CompletionsAPI.Completions(this.client); | ||
this.completions = new CompletionsAPI.Completions(this._client); | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/chat/completions', { body, ...options, stream: body.stream ?? false }); | ||
return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false }); | ||
} | ||
@@ -11,0 +11,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/completions', { body, ...options, stream: body.stream ?? false }); | ||
return this._client.post('/completions', { body, ...options, stream: body.stream ?? false }); | ||
} | ||
@@ -11,0 +11,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/edits', { body, ...options }); | ||
return this._client.post('/edits', { body, ...options }); | ||
} | ||
@@ -18,0 +18,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/embeddings', { body, ...options }); | ||
return this._client.post('/embeddings', { body, ...options }); | ||
} | ||
@@ -14,0 +14,0 @@ } |
@@ -49,3 +49,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/files', (0, core_3.multipartFormRequestOptions)({ body, ...options })); | ||
return this._client.post('/files', (0, core_3.multipartFormRequestOptions)({ body, ...options })); | ||
} | ||
@@ -56,3 +56,3 @@ /** | ||
retrieve(fileId, options) { | ||
return this.get(`/files/${fileId}`, options); | ||
return this._client.get(`/files/${fileId}`, options); | ||
} | ||
@@ -63,3 +63,3 @@ list(query = {}, options) { | ||
} | ||
return this.getAPIList('/files', FileObjectsPage, { query, ...options }); | ||
return this._client.getAPIList('/files', FileObjectsPage, { query, ...options }); | ||
} | ||
@@ -70,3 +70,3 @@ /** | ||
del(fileId, options) { | ||
return this.delete(`/files/${fileId}`, options); | ||
return this._client.delete(`/files/${fileId}`, options); | ||
} | ||
@@ -77,3 +77,3 @@ /** | ||
content(fileId, options) { | ||
return this.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true }); | ||
return this._client.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true }); | ||
} | ||
@@ -86,3 +86,3 @@ /** | ||
retrieveContent(fileId, options) { | ||
return this.get(`/files/${fileId}/content`, { | ||
return this._client.get(`/files/${fileId}/content`, { | ||
...options, | ||
@@ -89,0 +89,0 @@ headers: { Accept: 'application/json', ...options?.headers }, |
@@ -41,3 +41,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/fine-tunes', { body, ...options }); | ||
return this._client.post('/fine-tunes', { body, ...options }); | ||
} | ||
@@ -50,3 +50,3 @@ /** | ||
retrieve(fineTuneId, options) { | ||
return this.get(`/fine-tunes/${fineTuneId}`, options); | ||
return this._client.get(`/fine-tunes/${fineTuneId}`, options); | ||
} | ||
@@ -57,3 +57,3 @@ /** | ||
list(options) { | ||
return this.getAPIList('/fine-tunes', FineTunesPage, options); | ||
return this._client.getAPIList('/fine-tunes', FineTunesPage, options); | ||
} | ||
@@ -64,6 +64,6 @@ /** | ||
cancel(fineTuneId, options) { | ||
return this.post(`/fine-tunes/${fineTuneId}/cancel`, options); | ||
return this._client.post(`/fine-tunes/${fineTuneId}/cancel`, options); | ||
} | ||
listEvents(fineTuneId, query, options) { | ||
return this.get(`/fine-tunes/${fineTuneId}/events`, { | ||
return this._client.get(`/fine-tunes/${fineTuneId}/events`, { | ||
query, | ||
@@ -70,0 +70,0 @@ timeout: 86400000, |
@@ -33,3 +33,3 @@ "use strict"; | ||
super(...arguments); | ||
this.jobs = new JobsAPI.Jobs(this.client); | ||
this.jobs = new JobsAPI.Jobs(this._client); | ||
} | ||
@@ -36,0 +36,0 @@ } |
@@ -42,3 +42,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/fine_tuning/jobs', { body, ...options }); | ||
return this._client.post('/fine_tuning/jobs', { body, ...options }); | ||
} | ||
@@ -51,3 +51,3 @@ /** | ||
retrieve(fineTuningJobId, options) { | ||
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options); | ||
return this._client.get(`/fine_tuning/jobs/${fineTuningJobId}`, options); | ||
} | ||
@@ -58,3 +58,3 @@ list(query = {}, options) { | ||
} | ||
return this.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options }); | ||
return this._client.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options }); | ||
} | ||
@@ -65,3 +65,3 @@ /** | ||
cancel(fineTuningJobId, options) { | ||
return this.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options); | ||
return this._client.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options); | ||
} | ||
@@ -72,3 +72,3 @@ listEvents(fineTuningJobId, query = {}, options) { | ||
} | ||
return this.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, { | ||
return this._client.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, { | ||
query, | ||
@@ -75,0 +75,0 @@ ...options, |
@@ -12,3 +12,3 @@ "use strict"; | ||
createVariation(body, options) { | ||
return this.post('/images/variations', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
return this._client.post('/images/variations', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
} | ||
@@ -19,3 +19,3 @@ /** | ||
edit(body, options) { | ||
return this.post('/images/edits', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
return this._client.post('/images/edits', (0, core_1.multipartFormRequestOptions)({ body, ...options })); | ||
} | ||
@@ -26,3 +26,3 @@ /** | ||
generate(body, options) { | ||
return this.post('/images/generations', { body, ...options }); | ||
return this._client.post('/images/generations', { body, ...options }); | ||
} | ||
@@ -29,0 +29,0 @@ } |
@@ -37,3 +37,3 @@ "use strict"; | ||
retrieve(model, options) { | ||
return this.get(`/models/${model}`, options); | ||
return this._client.get(`/models/${model}`, options); | ||
} | ||
@@ -45,3 +45,3 @@ /** | ||
list(options) { | ||
return this.getAPIList('/models', ModelsPage, options); | ||
return this._client.getAPIList('/models', ModelsPage, options); | ||
} | ||
@@ -53,3 +53,3 @@ /** | ||
del(model, options) { | ||
return this.delete(`/models/${model}`, options); | ||
return this._client.delete(`/models/${model}`, options); | ||
} | ||
@@ -56,0 +56,0 @@ } |
@@ -11,3 +11,3 @@ "use strict"; | ||
create(body, options) { | ||
return this.post('/moderations', { body, ...options }); | ||
return this._client.post('/moderations', { body, ...options }); | ||
} | ||
@@ -14,0 +14,0 @@ } |
@@ -567,23 +567,2 @@ import { VERSION } from './version'; | ||
export class APIResource { | ||
protected client: APIClient; | ||
constructor(client: APIClient) { | ||
this.client = client; | ||
this.get = client.get.bind(client); | ||
this.post = client.post.bind(client); | ||
this.patch = client.patch.bind(client); | ||
this.put = client.put.bind(client); | ||
this.delete = client.delete.bind(client); | ||
this.getAPIList = client.getAPIList.bind(client); | ||
} | ||
protected get: APIClient['get']; | ||
protected post: APIClient['post']; | ||
protected patch: APIClient['patch']; | ||
protected put: APIClient['put']; | ||
protected delete: APIClient['delete']; | ||
protected getAPIList: APIClient['getAPIList']; | ||
} | ||
export type PageInfo = { url: URL } | { params: Record<string, unknown> | null }; | ||
@@ -590,0 +569,0 @@ |
@@ -6,20 +6,7 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class APIResource { | ||
protected client: OpenAI; | ||
protected _client: OpenAI; | ||
constructor(client: OpenAI) { | ||
this.client = client; | ||
this.get = client.get.bind(client); | ||
this.post = client.post.bind(client); | ||
this.patch = client.patch.bind(client); | ||
this.put = client.put.bind(client); | ||
this.delete = client.delete.bind(client); | ||
this.getAPIList = client.getAPIList.bind(client); | ||
this._client = client; | ||
} | ||
protected get: OpenAI['get']; | ||
protected post: OpenAI['post']; | ||
protected patch: OpenAI['patch']; | ||
protected put: OpenAI['put']; | ||
protected delete: OpenAI['delete']; | ||
protected getAPIList: OpenAI['getAPIList']; | ||
} |
@@ -9,5 +9,5 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Audio extends APIResource { | ||
transcriptions: TranscriptionsAPI.Transcriptions = new TranscriptionsAPI.Transcriptions(this.client); | ||
translations: TranslationsAPI.Translations = new TranslationsAPI.Translations(this.client); | ||
speech: SpeechAPI.Speech = new SpeechAPI.Speech(this.client); | ||
transcriptions: TranscriptionsAPI.Transcriptions = new TranscriptionsAPI.Transcriptions(this._client); | ||
translations: TranslationsAPI.Translations = new TranslationsAPI.Translations(this._client); | ||
speech: SpeechAPI.Speech = new SpeechAPI.Speech(this._client); | ||
} | ||
@@ -14,0 +14,0 @@ |
@@ -13,3 +13,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: SpeechCreateParams, options?: Core.RequestOptions): Core.APIPromise<Response> { | ||
return this.post('/audio/speech', { body, ...options, __binaryResponse: true }); | ||
return this._client.post('/audio/speech', { body, ...options, __binaryResponse: true }); | ||
} | ||
@@ -16,0 +16,0 @@ } |
@@ -13,3 +13,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: TranscriptionCreateParams, options?: Core.RequestOptions): Core.APIPromise<Transcription> { | ||
return this.post('/audio/transcriptions', multipartFormRequestOptions({ body, ...options })); | ||
return this._client.post('/audio/transcriptions', multipartFormRequestOptions({ body, ...options })); | ||
} | ||
@@ -16,0 +16,0 @@ } |
@@ -13,3 +13,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: TranslationCreateParams, options?: Core.RequestOptions): Core.APIPromise<Translation> { | ||
return this.post('/audio/translations', multipartFormRequestOptions({ body, ...options })); | ||
return this._client.post('/audio/translations', multipartFormRequestOptions({ body, ...options })); | ||
} | ||
@@ -16,0 +16,0 @@ } |
@@ -12,3 +12,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Assistants extends APIResource { | ||
files: FilesAPI.Files = new FilesAPI.Files(this.client); | ||
files: FilesAPI.Files = new FilesAPI.Files(this._client); | ||
@@ -19,3 +19,3 @@ /** | ||
create(body: AssistantCreateParams, options?: Core.RequestOptions): Core.APIPromise<Assistant> { | ||
return this.post('/assistants', { | ||
return this._client.post('/assistants', { | ||
body, | ||
@@ -31,3 +31,3 @@ ...options, | ||
retrieve(assistantId: string, options?: Core.RequestOptions): Core.APIPromise<Assistant> { | ||
return this.get(`/assistants/${assistantId}`, { | ||
return this._client.get(`/assistants/${assistantId}`, { | ||
...options, | ||
@@ -46,3 +46,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
): Core.APIPromise<Assistant> { | ||
return this.post(`/assistants/${assistantId}`, { | ||
return this._client.post(`/assistants/${assistantId}`, { | ||
body, | ||
@@ -69,3 +69,3 @@ ...options, | ||
} | ||
return this.getAPIList('/assistants', AssistantsPage, { | ||
return this._client.getAPIList('/assistants', AssistantsPage, { | ||
query, | ||
@@ -81,3 +81,3 @@ ...options, | ||
del(assistantId: string, options?: Core.RequestOptions): Core.APIPromise<AssistantDeleted> { | ||
return this.delete(`/assistants/${assistantId}`, { | ||
return this._client.delete(`/assistants/${assistantId}`, { | ||
...options, | ||
@@ -84,0 +84,0 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, |
@@ -20,3 +20,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): Core.APIPromise<AssistantFile> { | ||
return this.post(`/assistants/${assistantId}/files`, { | ||
return this._client.post(`/assistants/${assistantId}/files`, { | ||
body, | ||
@@ -36,3 +36,3 @@ ...options, | ||
): Core.APIPromise<AssistantFile> { | ||
return this.get(`/assistants/${assistantId}/files/${fileId}`, { | ||
return this._client.get(`/assistants/${assistantId}/files/${fileId}`, { | ||
...options, | ||
@@ -63,3 +63,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
} | ||
return this.getAPIList(`/assistants/${assistantId}/files`, AssistantFilesPage, { | ||
return this._client.getAPIList(`/assistants/${assistantId}/files`, AssistantFilesPage, { | ||
query, | ||
@@ -79,3 +79,3 @@ ...options, | ||
): Core.APIPromise<FileDeleteResponse> { | ||
return this.delete(`/assistants/${assistantId}/files/${fileId}`, { | ||
return this._client.delete(`/assistants/${assistantId}/files/${fileId}`, { | ||
...options, | ||
@@ -82,0 +82,0 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, |
@@ -9,5 +9,5 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Beta extends APIResource { | ||
chat: ChatAPI.Chat = new ChatAPI.Chat(this.client); | ||
assistants: AssistantsAPI.Assistants = new AssistantsAPI.Assistants(this.client); | ||
threads: ThreadsAPI.Threads = new ThreadsAPI.Threads(this.client); | ||
chat: ChatAPI.Chat = new ChatAPI.Chat(this._client); | ||
assistants: AssistantsAPI.Assistants = new AssistantsAPI.Assistants(this._client); | ||
threads: ThreadsAPI.Threads = new ThreadsAPI.Threads(this._client); | ||
} | ||
@@ -14,0 +14,0 @@ |
@@ -7,3 +7,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Chat extends APIResource { | ||
completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this.client); | ||
completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this._client); | ||
} | ||
@@ -10,0 +10,0 @@ |
@@ -56,3 +56,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
return ChatCompletionStreamingRunner.runFunctions( | ||
this.client.chat.completions, | ||
this._client.chat.completions, | ||
body as ChatCompletionStreamingFunctionRunnerParams<FunctionsArgs>, | ||
@@ -63,3 +63,3 @@ options, | ||
return ChatCompletionRunner.runFunctions( | ||
this.client.chat.completions, | ||
this._client.chat.completions, | ||
body as ChatCompletionFunctionRunnerParams<FunctionsArgs>, | ||
@@ -95,3 +95,3 @@ options, | ||
return ChatCompletionStreamingRunner.runTools( | ||
this.client.chat.completions, | ||
this._client.chat.completions, | ||
body as ChatCompletionStreamingToolRunnerParams<FunctionsArgs>, | ||
@@ -102,3 +102,3 @@ options, | ||
return ChatCompletionRunner.runTools( | ||
this.client.chat.completions, | ||
this._client.chat.completions, | ||
body as ChatCompletionToolRunnerParams<FunctionsArgs>, | ||
@@ -113,4 +113,4 @@ options, | ||
stream(body: ChatCompletionStreamParams, options?: Core.RequestOptions): ChatCompletionStream { | ||
return ChatCompletionStream.createChatCompletion(this.client.chat.completions, body, options); | ||
return ChatCompletionStream.createChatCompletion(this._client.chat.completions, body, options); | ||
} | ||
} |
@@ -19,3 +19,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): Core.APIPromise<MessageFile> { | ||
return this.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, { | ||
return this._client.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, { | ||
...options, | ||
@@ -49,3 +49,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/messages/${messageId}/files`, MessageFilesPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/messages/${messageId}/files`, MessageFilesPage, { | ||
query, | ||
@@ -52,0 +52,0 @@ ...options, |
@@ -11,3 +11,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Messages extends APIResource { | ||
files: FilesAPI.Files = new FilesAPI.Files(this.client); | ||
files: FilesAPI.Files = new FilesAPI.Files(this._client); | ||
@@ -22,3 +22,3 @@ /** | ||
): Core.APIPromise<ThreadMessage> { | ||
return this.post(`/threads/${threadId}/messages`, { | ||
return this._client.post(`/threads/${threadId}/messages`, { | ||
body, | ||
@@ -38,3 +38,3 @@ ...options, | ||
): Core.APIPromise<ThreadMessage> { | ||
return this.get(`/threads/${threadId}/messages/${messageId}`, { | ||
return this._client.get(`/threads/${threadId}/messages/${messageId}`, { | ||
...options, | ||
@@ -54,3 +54,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
): Core.APIPromise<ThreadMessage> { | ||
return this.post(`/threads/${threadId}/messages/${messageId}`, { | ||
return this._client.post(`/threads/${threadId}/messages/${messageId}`, { | ||
body, | ||
@@ -79,3 +79,3 @@ ...options, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/messages`, ThreadMessagesPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/messages`, ThreadMessagesPage, { | ||
query, | ||
@@ -82,0 +82,0 @@ ...options, |
@@ -12,3 +12,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Runs extends APIResource { | ||
steps: StepsAPI.Steps = new StepsAPI.Steps(this.client); | ||
steps: StepsAPI.Steps = new StepsAPI.Steps(this._client); | ||
@@ -19,3 +19,3 @@ /** | ||
create(threadId: string, body: RunCreateParams, options?: Core.RequestOptions): Core.APIPromise<Run> { | ||
return this.post(`/threads/${threadId}/runs`, { | ||
return this._client.post(`/threads/${threadId}/runs`, { | ||
body, | ||
@@ -31,3 +31,3 @@ ...options, | ||
retrieve(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise<Run> { | ||
return this.get(`/threads/${threadId}/runs/${runId}`, { | ||
return this._client.get(`/threads/${threadId}/runs/${runId}`, { | ||
...options, | ||
@@ -47,3 +47,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
): Core.APIPromise<Run> { | ||
return this.post(`/threads/${threadId}/runs/${runId}`, { | ||
return this._client.post(`/threads/${threadId}/runs/${runId}`, { | ||
body, | ||
@@ -72,3 +72,3 @@ ...options, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/runs`, RunsPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/runs`, RunsPage, { | ||
query, | ||
@@ -84,3 +84,3 @@ ...options, | ||
cancel(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise<Run> { | ||
return this.post(`/threads/${threadId}/runs/${runId}/cancel`, { | ||
return this._client.post(`/threads/${threadId}/runs/${runId}/cancel`, { | ||
...options, | ||
@@ -103,3 +103,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
): Core.APIPromise<Run> { | ||
return this.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, { | ||
return this._client.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, { | ||
body, | ||
@@ -106,0 +106,0 @@ ...options, |
@@ -19,3 +19,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): Core.APIPromise<RunStep> { | ||
return this.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { | ||
return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { | ||
...options, | ||
@@ -49,3 +49,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
} | ||
return this.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, { | ||
return this._client.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, { | ||
query, | ||
@@ -52,0 +52,0 @@ ...options, |
@@ -12,4 +12,4 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Threads extends APIResource { | ||
runs: RunsAPI.Runs = new RunsAPI.Runs(this.client); | ||
messages: MessagesAPI.Messages = new MessagesAPI.Messages(this.client); | ||
runs: RunsAPI.Runs = new RunsAPI.Runs(this._client); | ||
messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client); | ||
@@ -28,3 +28,3 @@ /** | ||
} | ||
return this.post('/threads', { | ||
return this._client.post('/threads', { | ||
body, | ||
@@ -40,3 +40,3 @@ ...options, | ||
retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise<Thread> { | ||
return this.get(`/threads/${threadId}`, { | ||
return this._client.get(`/threads/${threadId}`, { | ||
...options, | ||
@@ -51,3 +51,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
update(threadId: string, body: ThreadUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Thread> { | ||
return this.post(`/threads/${threadId}`, { | ||
return this._client.post(`/threads/${threadId}`, { | ||
body, | ||
@@ -63,3 +63,3 @@ ...options, | ||
del(threadId: string, options?: Core.RequestOptions): Core.APIPromise<ThreadDeleted> { | ||
return this.delete(`/threads/${threadId}`, { | ||
return this._client.delete(`/threads/${threadId}`, { | ||
...options, | ||
@@ -74,3 +74,3 @@ headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers }, | ||
createAndRun(body: ThreadCreateAndRunParams, options?: Core.RequestOptions): Core.APIPromise<RunsAPI.Run> { | ||
return this.post('/threads/runs', { | ||
return this._client.post('/threads/runs', { | ||
body, | ||
@@ -77,0 +77,0 @@ ...options, |
@@ -7,3 +7,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class Chat extends APIResource { | ||
completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this.client); | ||
completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this._client); | ||
} | ||
@@ -10,0 +10,0 @@ |
@@ -31,3 +31,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): APIPromise<ChatCompletion> | APIPromise<Stream<ChatCompletionChunk>> { | ||
return this.post('/chat/completions', { body, ...options, stream: body.stream ?? false }) as | ||
return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false }) as | ||
| APIPromise<ChatCompletion> | ||
@@ -34,0 +34,0 @@ | APIPromise<Stream<ChatCompletionChunk>>; |
@@ -26,3 +26,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): APIPromise<Completion> | APIPromise<Stream<Completion>> { | ||
return this.post('/completions', { body, ...options, stream: body.stream ?? false }) as | ||
return this._client.post('/completions', { body, ...options, stream: body.stream ?? false }) as | ||
| APIPromise<Completion> | ||
@@ -29,0 +29,0 @@ | APIPromise<Stream<Completion>>; |
@@ -17,3 +17,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: EditCreateParams, options?: Core.RequestOptions): Core.APIPromise<Edit> { | ||
return this.post('/edits', { body, ...options }); | ||
return this._client.post('/edits', { body, ...options }); | ||
} | ||
@@ -20,0 +20,0 @@ } |
@@ -15,3 +15,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): Core.APIPromise<CreateEmbeddingResponse> { | ||
return this.post('/embeddings', { body, ...options }); | ||
return this._client.post('/embeddings', { body, ...options }); | ||
} | ||
@@ -18,0 +18,0 @@ } |
@@ -27,3 +27,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: FileCreateParams, options?: Core.RequestOptions): Core.APIPromise<FileObject> { | ||
return this.post('/files', multipartFormRequestOptions({ body, ...options })); | ||
return this._client.post('/files', multipartFormRequestOptions({ body, ...options })); | ||
} | ||
@@ -35,3 +35,3 @@ | ||
retrieve(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileObject> { | ||
return this.get(`/files/${fileId}`, options); | ||
return this._client.get(`/files/${fileId}`, options); | ||
} | ||
@@ -51,3 +51,3 @@ | ||
} | ||
return this.getAPIList('/files', FileObjectsPage, { query, ...options }); | ||
return this._client.getAPIList('/files', FileObjectsPage, { query, ...options }); | ||
} | ||
@@ -59,3 +59,3 @@ | ||
del(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileDeleted> { | ||
return this.delete(`/files/${fileId}`, options); | ||
return this._client.delete(`/files/${fileId}`, options); | ||
} | ||
@@ -67,3 +67,3 @@ | ||
content(fileId: string, options?: Core.RequestOptions): Core.APIPromise<Response> { | ||
return this.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true }); | ||
return this._client.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true }); | ||
} | ||
@@ -77,3 +77,3 @@ | ||
retrieveContent(fileId: string, options?: Core.RequestOptions): Core.APIPromise<string> { | ||
return this.get(`/files/${fileId}/content`, { | ||
return this._client.get(`/files/${fileId}/content`, { | ||
...options, | ||
@@ -80,0 +80,0 @@ headers: { Accept: 'application/json', ...options?.headers }, |
@@ -21,3 +21,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: FineTuneCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTune> { | ||
return this.post('/fine-tunes', { body, ...options }); | ||
return this._client.post('/fine-tunes', { body, ...options }); | ||
} | ||
@@ -31,3 +31,3 @@ | ||
retrieve(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune> { | ||
return this.get(`/fine-tunes/${fineTuneId}`, options); | ||
return this._client.get(`/fine-tunes/${fineTuneId}`, options); | ||
} | ||
@@ -39,3 +39,3 @@ | ||
list(options?: Core.RequestOptions): Core.PagePromise<FineTunesPage, FineTune> { | ||
return this.getAPIList('/fine-tunes', FineTunesPage, options); | ||
return this._client.getAPIList('/fine-tunes', FineTunesPage, options); | ||
} | ||
@@ -47,3 +47,3 @@ | ||
cancel(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune> { | ||
return this.post(`/fine-tunes/${fineTuneId}/cancel`, options); | ||
return this._client.post(`/fine-tunes/${fineTuneId}/cancel`, options); | ||
} | ||
@@ -74,3 +74,3 @@ | ||
): APIPromise<FineTuneEventsListResponse> | APIPromise<Stream<FineTuneEvent>> { | ||
return this.get(`/fine-tunes/${fineTuneId}/events`, { | ||
return this._client.get(`/fine-tunes/${fineTuneId}/events`, { | ||
query, | ||
@@ -77,0 +77,0 @@ timeout: 86400000, |
@@ -7,3 +7,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
export class FineTuning extends APIResource { | ||
jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this.client); | ||
jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client); | ||
} | ||
@@ -10,0 +10,0 @@ |
@@ -19,3 +19,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> { | ||
return this.post('/fine_tuning/jobs', { body, ...options }); | ||
return this._client.post('/fine_tuning/jobs', { body, ...options }); | ||
} | ||
@@ -29,3 +29,3 @@ | ||
retrieve(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> { | ||
return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options); | ||
return this._client.get(`/fine_tuning/jobs/${fineTuningJobId}`, options); | ||
} | ||
@@ -48,3 +48,3 @@ | ||
} | ||
return this.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options }); | ||
return this._client.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options }); | ||
} | ||
@@ -56,3 +56,3 @@ | ||
cancel(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> { | ||
return this.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options); | ||
return this._client.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options); | ||
} | ||
@@ -80,3 +80,3 @@ | ||
} | ||
return this.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, { | ||
return this._client.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, { | ||
query, | ||
@@ -83,0 +83,0 @@ ...options, |
@@ -16,3 +16,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): Core.APIPromise<ImagesResponse> { | ||
return this.post('/images/variations', multipartFormRequestOptions({ body, ...options })); | ||
return this._client.post('/images/variations', multipartFormRequestOptions({ body, ...options })); | ||
} | ||
@@ -24,3 +24,3 @@ | ||
edit(body: ImageEditParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse> { | ||
return this.post('/images/edits', multipartFormRequestOptions({ body, ...options })); | ||
return this._client.post('/images/edits', multipartFormRequestOptions({ body, ...options })); | ||
} | ||
@@ -32,3 +32,3 @@ | ||
generate(body: ImageGenerateParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse> { | ||
return this.post('/images/generations', { body, ...options }); | ||
return this._client.post('/images/generations', { body, ...options }); | ||
} | ||
@@ -35,0 +35,0 @@ } |
@@ -14,3 +14,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
retrieve(model: string, options?: Core.RequestOptions): Core.APIPromise<Model> { | ||
return this.get(`/models/${model}`, options); | ||
return this._client.get(`/models/${model}`, options); | ||
} | ||
@@ -23,3 +23,3 @@ | ||
list(options?: Core.RequestOptions): Core.PagePromise<ModelsPage, Model> { | ||
return this.getAPIList('/models', ModelsPage, options); | ||
return this._client.getAPIList('/models', ModelsPage, options); | ||
} | ||
@@ -32,3 +32,3 @@ | ||
del(model: string, options?: Core.RequestOptions): Core.APIPromise<ModelDeleted> { | ||
return this.delete(`/models/${model}`, options); | ||
return this._client.delete(`/models/${model}`, options); | ||
} | ||
@@ -35,0 +35,0 @@ } |
@@ -15,3 +15,3 @@ // File generated from our OpenAPI spec by Stainless. | ||
): Core.APIPromise<ModerationCreateResponse> { | ||
return this.post('/moderations', { body, ...options }); | ||
return this._client.post('/moderations', { body, ...options }); | ||
} | ||
@@ -18,0 +18,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export const VERSION = '4.18.0'; // x-release-please-version | ||
export const VERSION = '4.19.0'; // x-release-please-version |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "4.18.0"; | ||
export declare const VERSION = "4.19.0"; | ||
//# sourceMappingURL=version.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.VERSION = void 0; | ||
exports.VERSION = '4.18.0'; // x-release-please-version | ||
exports.VERSION = '4.19.0'; // x-release-please-version | ||
//# sourceMappingURL=version.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1663957
-0.16%28104
-0.29%