UNPKG

@cotofe/service-of-litellm

Version:

OpenAPI client for @cotofe/service-of-litellm

109 lines (108 loc) 5.53 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.ModerationsApi = void 0; const runtime = require("../runtime"); /** * */ class ModerationsApi extends runtime.BaseAPI { /** * The moderations endpoint is a tool you can use to check whether content complies with an LLM Providers policies. Quick Start ``` curl --location \'http://0.0.0.0:4000/moderations\' --header \'Content-Type: application/json\' --header \'Authorization: Bearer sk-1234\' --data \'{\"input\": \"Sample text goes here\", \"model\": \"text-moderation-stable\"}\' ``` * Moderations */ moderationsModerationsPostRaw(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: `/moderations`, 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); } }); } /** * The moderations endpoint is a tool you can use to check whether content complies with an LLM Providers policies. Quick Start ``` curl --location \'http://0.0.0.0:4000/moderations\' --header \'Content-Type: application/json\' --header \'Authorization: Bearer sk-1234\' --data \'{\"input\": \"Sample text goes here\", \"model\": \"text-moderation-stable\"}\' ``` * Moderations */ moderationsModerationsPost(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.moderationsModerationsPostRaw(initOverrides); return yield response.value(); }); } /** * The moderations endpoint is a tool you can use to check whether content complies with an LLM Providers policies. Quick Start ``` curl --location \'http://0.0.0.0:4000/moderations\' --header \'Content-Type: application/json\' --header \'Authorization: Bearer sk-1234\' --data \'{\"input\": \"Sample text goes here\", \"model\": \"text-moderation-stable\"}\' ``` * Moderations */ moderationsV1ModerationsPostRaw(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: `/v1/moderations`, 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); } }); } /** * The moderations endpoint is a tool you can use to check whether content complies with an LLM Providers policies. Quick Start ``` curl --location \'http://0.0.0.0:4000/moderations\' --header \'Content-Type: application/json\' --header \'Authorization: Bearer sk-1234\' --data \'{\"input\": \"Sample text goes here\", \"model\": \"text-moderation-stable\"}\' ``` * Moderations */ moderationsV1ModerationsPost(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.moderationsV1ModerationsPostRaw(initOverrides); return yield response.value(); }); } } exports.ModerationsApi = ModerationsApi;