UNPKG

@cotofe/service-of-litellm

Version:

OpenAPI client for @cotofe/service-of-litellm

260 lines (259 loc) 12.6 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.CachingApi = void 0; const runtime = require("../runtime"); /** * */ class CachingApi extends runtime.BaseAPI { /** * Endpoint for deleting a key from the cache. All responses from litellm proxy have `x-litellm-cache-key` in the headers Parameters: - **keys**: *Optional[List[str]]* - A list of keys to delete from the cache. Example {\"keys\": [\"key1\", \"key2\"]} ```shell curl -X POST \"http://0.0.0.0:4000/cache/delete\" -H \"Authorization: Bearer sk-1234\" -d \'{\"keys\": [\"key1\", \"key2\"]}\' ``` * Cache Delete */ cacheDeleteCacheDeletePostRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { 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: `/cache/delete`, 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); } }); } /** * Endpoint for deleting a key from the cache. All responses from litellm proxy have `x-litellm-cache-key` in the headers Parameters: - **keys**: *Optional[List[str]]* - A list of keys to delete from the cache. Example {\"keys\": [\"key1\", \"key2\"]} ```shell curl -X POST \"http://0.0.0.0:4000/cache/delete\" -H \"Authorization: Bearer sk-1234\" -d \'{\"keys\": [\"key1\", \"key2\"]}\' ``` * Cache Delete */ cacheDeleteCacheDeletePost(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cacheDeleteCacheDeletePostRaw(initOverrides); return yield response.value(); }); } /** * Endpoint for deleting a key from the cache. All responses from litellm proxy have `x-litellm-cache-key` in the headers Parameters: - **keys**: *Optional[List[str]]* - A list of keys to delete from the cache. Example {\"keys\": [\"key1\", \"key2\"]} ```shell curl -X POST \"http://0.0.0.0:4000/cache/delete\" -H \"Authorization: Bearer sk-1234\" -d \'{\"keys\": [\"key1\", \"key2\"]}\' ``` * Cache Delete */ cacheDeleteCacheDeletePost_1Raw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { 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: `/cache/delete`, 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); } }); } /** * Endpoint for deleting a key from the cache. All responses from litellm proxy have `x-litellm-cache-key` in the headers Parameters: - **keys**: *Optional[List[str]]* - A list of keys to delete from the cache. Example {\"keys\": [\"key1\", \"key2\"]} ```shell curl -X POST \"http://0.0.0.0:4000/cache/delete\" -H \"Authorization: Bearer sk-1234\" -d \'{\"keys\": [\"key1\", \"key2\"]}\' ``` * Cache Delete */ cacheDeleteCacheDeletePost_1(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cacheDeleteCacheDeletePost_1Raw(initOverrides); return yield response.value(); }); } /** * A function to flush all items from the cache. (All items will be deleted from the cache with this) Raises HTTPException if the cache is not initialized or if the cache type does not support flushing. Returns a dictionary with the status of the operation. Usage: ``` curl -X POST http://0.0.0.0:4000/cache/flushall -H \"Authorization: Bearer sk-1234\" ``` * Cache Flushall */ cacheFlushallCacheFlushallPostRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { 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: `/cache/flushall`, 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); } }); } /** * A function to flush all items from the cache. (All items will be deleted from the cache with this) Raises HTTPException if the cache is not initialized or if the cache type does not support flushing. Returns a dictionary with the status of the operation. Usage: ``` curl -X POST http://0.0.0.0:4000/cache/flushall -H \"Authorization: Bearer sk-1234\" ``` * Cache Flushall */ cacheFlushallCacheFlushallPost(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cacheFlushallCacheFlushallPostRaw(initOverrides); return yield response.value(); }); } /** * A function to flush all items from the cache. (All items will be deleted from the cache with this) Raises HTTPException if the cache is not initialized or if the cache type does not support flushing. Returns a dictionary with the status of the operation. Usage: ``` curl -X POST http://0.0.0.0:4000/cache/flushall -H \"Authorization: Bearer sk-1234\" ``` * Cache Flushall */ cacheFlushallCacheFlushallPost_2Raw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { 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: `/cache/flushall`, 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); } }); } /** * A function to flush all items from the cache. (All items will be deleted from the cache with this) Raises HTTPException if the cache is not initialized or if the cache type does not support flushing. Returns a dictionary with the status of the operation. Usage: ``` curl -X POST http://0.0.0.0:4000/cache/flushall -H \"Authorization: Bearer sk-1234\" ``` * Cache Flushall */ cacheFlushallCacheFlushallPost_2(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cacheFlushallCacheFlushallPost_2Raw(initOverrides); return yield response.value(); }); } /** * Endpoint for checking if cache can be pinged * Cache Ping */ cachePingCachePingGetRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { 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: `/cache/ping`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * Endpoint for checking if cache can be pinged * Cache Ping */ cachePingCachePingGet(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cachePingCachePingGetRaw(initOverrides); return yield response.value(); }); } /** * Endpoint for getting /redis/info * Cache Redis Info */ cacheRedisInfoCacheRedisInfoGetRaw(initOverrides) { return __awaiter(this, void 0, void 0, function* () { 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: `/cache/redis/info`, 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); } }); } /** * Endpoint for getting /redis/info * Cache Redis Info */ cacheRedisInfoCacheRedisInfoGet(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.cacheRedisInfoCacheRedisInfoGetRaw(initOverrides); return yield response.value(); }); } } exports.CachingApi = CachingApi;