UNPKG

@cotofe/service-of-litellm

Version:

OpenAPI client for @cotofe/service-of-litellm

790 lines (789 loc) 45 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.LitellmFilesApi = void 0; const runtime = require("../runtime"); /** * */ class LitellmFilesApi extends runtime.BaseAPI { /** * Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" -F purpose=\"batch\" -F file=\"@mydata.jsonl\" ``` * Create File */ createFileFilesPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.purpose == null) { throw new runtime.RequiredError('purpose', 'Required parameter "purpose" was null or undefined when calling createFileFilesPost().'); } if (requestParameters.file == null) { throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling createFileFilesPost().'); } 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 consumes = [{ contentType: 'multipart/form-data' }]; // @ts-ignore: canConsumeForm may be unused const canConsumeForm = runtime.canConsumeForm(consumes); let formParams; let useForm = false; // use FormData to transmit files using content-type "multipart/form-data" useForm = canConsumeForm; if (useForm) { formParams = new FormData(); } else { formParams = new URLSearchParams(); } if (requestParameters.purpose != null) { formParams.append('purpose', requestParameters.purpose); } if (requestParameters.customLlmProvider != null) { formParams.append('custom_llm_provider', requestParameters.customLlmProvider); } if (requestParameters.file != null) { formParams.append('file', requestParameters.file); } const response = yield this.request({ path: `/files`, method: 'POST', headers: headerParameters, query: queryParameters, body: formParams, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" -F purpose=\"batch\" -F file=\"@mydata.jsonl\" ``` * Create File */ createFileFilesPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.createFileFilesPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" -F purpose=\"batch\" -F file=\"@mydata.jsonl\" ``` * Create File */ createFileProviderV1FilesPostRaw(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 createFileProviderV1FilesPost().'); } if (requestParameters.purpose == null) { throw new runtime.RequiredError('purpose', 'Required parameter "purpose" was null or undefined when calling createFileProviderV1FilesPost().'); } if (requestParameters.file == null) { throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling createFileProviderV1FilesPost().'); } 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 consumes = [{ contentType: 'multipart/form-data' }]; // @ts-ignore: canConsumeForm may be unused const canConsumeForm = runtime.canConsumeForm(consumes); let formParams; let useForm = false; // use FormData to transmit files using content-type "multipart/form-data" useForm = canConsumeForm; if (useForm) { formParams = new FormData(); } else { formParams = new URLSearchParams(); } if (requestParameters.purpose != null) { formParams.append('purpose', requestParameters.purpose); } if (requestParameters.customLlmProvider != null) { formParams.append('custom_llm_provider', requestParameters.customLlmProvider); } if (requestParameters.file != null) { formParams.append('file', requestParameters.file); } const response = yield this.request({ path: `/{provider}/v1/files`.replace(`{${'provider'}}`, encodeURIComponent(String(requestParameters.provider))), method: 'POST', headers: headerParameters, query: queryParameters, body: formParams, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" -F purpose=\"batch\" -F file=\"@mydata.jsonl\" ``` * Create File */ createFileProviderV1FilesPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.createFileProviderV1FilesPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" -F purpose=\"batch\" -F file=\"@mydata.jsonl\" ``` * Create File */ createFileV1FilesPostRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.purpose == null) { throw new runtime.RequiredError('purpose', 'Required parameter "purpose" was null or undefined when calling createFileV1FilesPost().'); } if (requestParameters.file == null) { throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling createFileV1FilesPost().'); } 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 consumes = [{ contentType: 'multipart/form-data' }]; // @ts-ignore: canConsumeForm may be unused const canConsumeForm = runtime.canConsumeForm(consumes); let formParams; let useForm = false; // use FormData to transmit files using content-type "multipart/form-data" useForm = canConsumeForm; if (useForm) { formParams = new FormData(); } else { formParams = new URLSearchParams(); } if (requestParameters.purpose != null) { formParams.append('purpose', requestParameters.purpose); } if (requestParameters.customLlmProvider != null) { formParams.append('custom_llm_provider', requestParameters.customLlmProvider); } if (requestParameters.file != null) { formParams.append('file', requestParameters.file); } const response = yield this.request({ path: `/v1/files`, method: 'POST', headers: headerParameters, query: queryParameters, body: formParams, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Upload a file that can be used across - Assistants API, Batch API This is the equivalent of POST https://api.openai.com/v1/files Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/create Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" -F purpose=\"batch\" -F file=\"@mydata.jsonl\" ``` * Create File */ createFileV1FilesPost(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.createFileV1FilesPostRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -X DELETE -H \"Authorization: Bearer $OPENAI_API_KEY\" ``` * Delete File */ deleteFileFilesFileIdDeleteRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling deleteFileFilesFileIdDelete().'); } 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: `/files/{file_id}`.replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -X DELETE -H \"Authorization: Bearer $OPENAI_API_KEY\" ``` * Delete File */ deleteFileFilesFileIdDelete(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.deleteFileFilesFileIdDeleteRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -X DELETE -H \"Authorization: Bearer $OPENAI_API_KEY\" ``` * Delete File */ deleteFileProviderV1FilesFileIdDeleteRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling deleteFileProviderV1FilesFileIdDelete().'); } if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling deleteFileProviderV1FilesFileIdDelete().'); } 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/files/{file_id}` .replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))) .replace(`{${'provider'}}`, encodeURIComponent(String(requestParameters.provider))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -X DELETE -H \"Authorization: Bearer $OPENAI_API_KEY\" ``` * Delete File */ deleteFileProviderV1FilesFileIdDelete(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.deleteFileProviderV1FilesFileIdDeleteRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -X DELETE -H \"Authorization: Bearer $OPENAI_API_KEY\" ``` * Delete File */ deleteFileV1FilesFileIdDeleteRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling deleteFileV1FilesFileIdDelete().'); } 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/files/{file_id}`.replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); if (this.isJsonMime(response.headers.get('content-type'))) { return new runtime.JSONApiResponse(response); } else { return new runtime.TextApiResponse(response); } }); } /** * Deletes a specified file. that can be used across - Assistants API, Batch API This is the equivalent of DELETE https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/delete Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -X DELETE -H \"Authorization: Bearer $OPENAI_API_KEY\" ``` * Delete File */ deleteFileV1FilesFileIdDelete(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.deleteFileV1FilesFileIdDeleteRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}/content Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve-contents Example Curl ``` curl http://localhost:4000/v1/files/file-abc123/content -H \"Authorization: Bearer sk-1234\" ``` * Get File Content */ getFileContentFilesFileIdContentGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileContentFilesFileIdContentGet().'); } 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: `/files/{file_id}/content`.replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))), 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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}/content Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve-contents Example Curl ``` curl http://localhost:4000/v1/files/file-abc123/content -H \"Authorization: Bearer sk-1234\" ``` * Get File Content */ getFileContentFilesFileIdContentGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getFileContentFilesFileIdContentGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}/content Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve-contents Example Curl ``` curl http://localhost:4000/v1/files/file-abc123/content -H \"Authorization: Bearer sk-1234\" ``` * Get File Content */ getFileContentProviderV1FilesFileIdContentGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileContentProviderV1FilesFileIdContentGet().'); } if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling getFileContentProviderV1FilesFileIdContentGet().'); } 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/files/{file_id}/content` .replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))) .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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}/content Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve-contents Example Curl ``` curl http://localhost:4000/v1/files/file-abc123/content -H \"Authorization: Bearer sk-1234\" ``` * Get File Content */ getFileContentProviderV1FilesFileIdContentGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getFileContentProviderV1FilesFileIdContentGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}/content Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve-contents Example Curl ``` curl http://localhost:4000/v1/files/file-abc123/content -H \"Authorization: Bearer sk-1234\" ``` * Get File Content */ getFileContentV1FilesFileIdContentGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileContentV1FilesFileIdContentGet().'); } 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/files/{file_id}/content`.replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))), 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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id}/content Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve-contents Example Curl ``` curl http://localhost:4000/v1/files/file-abc123/content -H \"Authorization: Bearer sk-1234\" ``` * Get File Content */ getFileContentV1FilesFileIdContentGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getFileContentV1FilesFileIdContentGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -H \"Authorization: Bearer sk-1234\" ``` * Get File */ getFileFilesFileIdGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileFilesFileIdGet().'); } 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: `/files/{file_id}`.replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))), 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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -H \"Authorization: Bearer sk-1234\" ``` * Get File */ getFileFilesFileIdGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getFileFilesFileIdGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -H \"Authorization: Bearer sk-1234\" ``` * Get File */ getFileProviderV1FilesFileIdGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileProviderV1FilesFileIdGet().'); } if (requestParameters.provider == null) { throw new runtime.RequiredError('provider', 'Required parameter "provider" was null or undefined when calling getFileProviderV1FilesFileIdGet().'); } 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/files/{file_id}` .replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))) .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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -H \"Authorization: Bearer sk-1234\" ``` * Get File */ getFileProviderV1FilesFileIdGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getFileProviderV1FilesFileIdGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -H \"Authorization: Bearer sk-1234\" ``` * Get File */ getFileV1FilesFileIdGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { if (requestParameters.fileId == null) { throw new runtime.RequiredError('fileId', 'Required parameter "fileId" was null or undefined when calling getFileV1FilesFileIdGet().'); } 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/files/{file_id}`.replace(`{${'file_id'}}`, encodeURIComponent(String(requestParameters.fileId))), 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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/{file_id} Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/retrieve Example Curl ``` curl http://localhost:4000/v1/files/file-abc123 -H \"Authorization: Bearer sk-1234\" ``` * Get File */ getFileV1FilesFileIdGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.getFileV1FilesFileIdGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" ``` * List Files */ listFilesFilesGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } if (requestParameters.purpose != null) { queryParameters.purpose = requestParameters.purpose; } 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: `/files`, 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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" ``` * List Files */ listFilesFilesGet() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.listFilesFilesGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" ``` * List Files */ listFilesProviderV1FilesGetRaw(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 listFilesProviderV1FilesGet().'); } const queryParameters = {}; if (requestParameters.purpose != null) { queryParameters.purpose = requestParameters.purpose; } 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/files`.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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" ``` * List Files */ listFilesProviderV1FilesGet(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.listFilesProviderV1FilesGetRaw(requestParameters, initOverrides); return yield response.value(); }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" ``` * List Files */ listFilesV1FilesGetRaw(requestParameters, initOverrides) { return __awaiter(this, void 0, void 0, function* () { const queryParameters = {}; if (requestParameters.provider != null) { queryParameters.provider = requestParameters.provider; } if (requestParameters.purpose != null) { queryParameters.purpose = requestParameters.purpose; } 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/files`, 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); } }); } /** * Returns information about a specific file. that can be used across - Assistants API, Batch API This is the equivalent of GET https://api.openai.com/v1/files/ Supports Identical Params as: https://platform.openai.com/docs/api-reference/files/list Example Curl ``` curl http://localhost:4000/v1/files -H \"Authorization: Bearer sk-1234\" ``` * List Files */ listFilesV1FilesGet() { return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) { const response = yield this.listFilesV1FilesGetRaw(requestParameters, initOverrides); return yield response.value(); }); } } exports.LitellmFilesApi = LitellmFilesApi;