UNPKG

@cotofe/service-of-litellm

Version:

OpenAPI client for @cotofe/service-of-litellm

575 lines (574 loc) 33.2 kB
"use strict"; /** * Platform * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BatchApi = void 0; const runtime = require("../runtime"); /** * */ class BatchApi extends runtime.BaseAPI { /** * Cancel a batch. This is the equivalent of POST https://api.openai.com/v1/batches/{batch_id}/cancel Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/cancel Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123/cancel -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -X POST ``` * Cancel Batch */ cancelBatchBatchesBatchIdCancelPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.batchId == null) { throw new runtime.RequiredError('batchId', 'Required parameter "batchId" was null or undefined when calling cancelBatchBatchesBatchIdCancelPost().'); } const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/batches/{batch_id}/cancel`.replace(`{${'batch_id'}}`, encodeURIComponent(String(requestParameters.batchId))), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Cancel a batch. This is the equivalent of POST https://api.openai.com/v1/batches/{batch_id}/cancel Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/cancel Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123/cancel -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -X POST ``` * Cancel Batch */ cancelBatchBatchesBatchIdCancelPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cancelBatchBatchesBatchIdCancelPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Cancel a batch. This is the equivalent of POST https://api.openai.com/v1/batches/{batch_id}/cancel Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/cancel Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123/cancel -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -X POST ``` * Cancel Batch */ cancelBatchProviderV1BatchesBatchIdCancelPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.batchId == null) { throw new runtime.RequiredError('batchId', 'Required parameter "batchId" was null or undefined when calling cancelBatchProviderV1BatchesBatchIdCancelPost().'); } if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling cancelBatchProviderV1BatchesBatchIdCancelPost().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/{provider}/v1/batches/{batch_id}/cancel` .replace(`{${'batch_id'}}`, encodeURIComponent(String(requestParameters.batchId))) .replace(`{${'provider'}}`, encodeURIComponent(String(requestParameters.provider))), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Cancel a batch. This is the equivalent of POST https://api.openai.com/v1/batches/{batch_id}/cancel Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/cancel Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123/cancel -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -X POST ``` * Cancel Batch */ cancelBatchProviderV1BatchesBatchIdCancelPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cancelBatchProviderV1BatchesBatchIdCancelPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Cancel a batch. This is the equivalent of POST https://api.openai.com/v1/batches/{batch_id}/cancel Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/cancel Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123/cancel -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -X POST ``` * Cancel Batch */ cancelBatchV1BatchesBatchIdCancelPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.batchId == null) { throw new runtime.RequiredError('batchId', 'Required parameter "batchId" was null or undefined when calling cancelBatchV1BatchesBatchIdCancelPost().'); } const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/v1/batches/{batch_id}/cancel`.replace(`{${'batch_id'}}`, encodeURIComponent(String(requestParameters.batchId))), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Cancel a batch. This is the equivalent of POST https://api.openai.com/v1/batches/{batch_id}/cancel Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/cancel Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123/cancel -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -X POST ``` * Cancel Batch */ cancelBatchV1BatchesBatchIdCancelPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cancelBatchV1BatchesBatchIdCancelPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create large batches of API requests for asynchronous processing. This is the equivalent of POST https://api.openai.com/v1/batch Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch Example Curl ``` curl http://localhost:4000/v1/batches -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -d \'{ \"input_file_id\": \"file-abc123\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"24h\" }\' ``` * Create Batch */ createBatchBatchesPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/batches`, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Create large batches of API requests for asynchronous processing. This is the equivalent of POST https://api.openai.com/v1/batch Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch Example Curl ``` curl http://localhost:4000/v1/batches -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -d \'{ \"input_file_id\": \"file-abc123\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"24h\" }\' ``` * Create Batch */ createBatchBatchesPost() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.createBatchBatchesPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create large batches of API requests for asynchronous processing. This is the equivalent of POST https://api.openai.com/v1/batch Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch Example Curl ``` curl http://localhost:4000/v1/batches -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -d \'{ \"input_file_id\": \"file-abc123\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"24h\" }\' ``` * Create Batch */ createBatchProviderV1BatchesPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling createBatchProviderV1BatchesPost().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/{provider}/v1/batches`.replace(`{${'provider'}}`, encodeURIComponent(String(requestParameters.provider))), method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Create large batches of API requests for asynchronous processing. This is the equivalent of POST https://api.openai.com/v1/batch Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch Example Curl ``` curl http://localhost:4000/v1/batches -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -d \'{ \"input_file_id\": \"file-abc123\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"24h\" }\' ``` * Create Batch */ createBatchProviderV1BatchesPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.createBatchProviderV1BatchesPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Create large batches of API requests for asynchronous processing. This is the equivalent of POST https://api.openai.com/v1/batch Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch Example Curl ``` curl http://localhost:4000/v1/batches -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -d \'{ \"input_file_id\": \"file-abc123\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"24h\" }\' ``` * Create Batch */ createBatchV1BatchesPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/v1/batches`, method: 'POST', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Create large batches of API requests for asynchronous processing. This is the equivalent of POST https://api.openai.com/v1/batch Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch Example Curl ``` curl http://localhost:4000/v1/batches -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" -d \'{ \"input_file_id\": \"file-abc123\", \"endpoint\": \"/v1/chat/completions\", \"completion_window\": \"24h\" }\' ``` * Create Batch */ createBatchV1BatchesPost() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.createBatchV1BatchesPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/list Example Curl ``` curl http://localhost:4000/v1/batches?limit=2 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * List Batches */ listBatchesBatchesGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } if (requestParameters.limit != null) { queryParameters.limit = requestParameters.limit; } if (requestParameters.after != null) { queryParameters.after = requestParameters.after; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/batches`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/list Example Curl ``` curl http://localhost:4000/v1/batches?limit=2 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * List Batches */ listBatchesBatchesGet() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.listBatchesBatchesGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/list Example Curl ``` curl http://localhost:4000/v1/batches?limit=2 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * List Batches */ listBatchesProviderV1BatchesGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling listBatchesProviderV1BatchesGet().'); } const queryParameters = {}; if (requestParameters.limit != null) { queryParameters.limit = requestParameters.limit; } if (requestParameters.after != null) { queryParameters.after = requestParameters.after; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/{provider}/v1/batches`.replace(`{${'provider'}}`, encodeURIComponent(String(requestParameters.provider))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/list Example Curl ``` curl http://localhost:4000/v1/batches?limit=2 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * List Batches */ listBatchesProviderV1BatchesGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.listBatchesProviderV1BatchesGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/list Example Curl ``` curl http://localhost:4000/v1/batches?limit=2 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * List Batches */ listBatchesV1BatchesGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } if (requestParameters.limit != null) { queryParameters.limit = requestParameters.limit; } if (requestParameters.after != null) { queryParameters.after = requestParameters.after; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/v1/batches`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Lists This is the equivalent of GET https://api.openai.com/v1/batches/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/list Example Curl ``` curl http://localhost:4000/v1/batches?limit=2 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * List Batches */ listBatchesV1BatchesGet() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.listBatchesV1BatchesGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieves a batch. This is the equivalent of GET https://api.openai.com/v1/batches/{batch_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/retrieve Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * Retrieve Batch */ retrieveBatchBatchesBatchIdGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.batchId == null) { throw new runtime.RequiredError('batchId', 'Required parameter "batchId" was null or undefined when calling retrieveBatchBatchesBatchIdGet().'); } const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/batches/{batch_id}`.replace(`{${'batch_id'}}`, encodeURIComponent(String(requestParameters.batchId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Retrieves a batch. This is the equivalent of GET https://api.openai.com/v1/batches/{batch_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/retrieve Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * Retrieve Batch */ retrieveBatchBatchesBatchIdGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.retrieveBatchBatchesBatchIdGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieves a batch. This is the equivalent of GET https://api.openai.com/v1/batches/{batch_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/retrieve Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * Retrieve Batch */ retrieveBatchProviderV1BatchesBatchIdGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling retrieveBatchProviderV1BatchesBatchIdGet().'); } if (requestParameters.batchId == null) { throw new runtime.RequiredError('batchId', 'Required parameter "batchId" was null or undefined when calling retrieveBatchProviderV1BatchesBatchIdGet().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/{provider}/v1/batches/{batch_id}` .replace(`{${'provider'}}`, encodeURIComponent(String(requestParameters.provider))) .replace(`{${'batch_id'}}`, encodeURIComponent(String(requestParameters.batchId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Retrieves a batch. This is the equivalent of GET https://api.openai.com/v1/batches/{batch_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/retrieve Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * Retrieve Batch */ retrieveBatchProviderV1BatchesBatchIdGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.retrieveBatchProviderV1BatchesBatchIdGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Retrieves a batch. This is the equivalent of GET https://api.openai.com/v1/batches/{batch_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/retrieve Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * Retrieve Batch */ retrieveBatchV1BatchesBatchIdGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.batchId == null) { throw new runtime.RequiredError('batchId', 'Required parameter "batchId" was null or undefined when calling retrieveBatchV1BatchesBatchIdGet().'); } const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } const headerParameters = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = yield token('bearer', []); if (tokenString) { headerParameters.Authorization = `Bearer ${tokenString}`; } } const response = yield this.request({ path: `/v1/batches/{batch_id}`.replace(`{${'batch_id'}}`, encodeURIComponent(String(requestParameters.batchId))), method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Retrieves a batch. This is the equivalent of GET https://api.openai.com/v1/batches/{batch_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/batch/retrieve Example Curl ``` curl http://localhost:4000/v1/batches/batch_abc123 -H \"Authorization: Bearer sk-1234\" -H \"Content-Type: application/json\" ``` * Retrieve Batch */ retrieveBatchV1BatchesBatchIdGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.retrieveBatchV1BatchesBatchIdGetRaw(requestParameters, initOverrides); return yield response.value(); }); } } exports.BatchApi = BatchApi;