UNPKG

@cotofe/service-of-litellm

Version:

OpenAPI client for @cotofe/service-of-litellm

65 lines (64 loc) 4.11 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.LitellmGuardrailsApi = void 0; const runtime = require("../runtime"); /** * */ class LitellmGuardrailsApi extends runtime.BaseAPI { /** * List the guardrails that are available on the proxy server 👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: ```bash curl -X GET \"http://localhost:4000/guardrails/list\" -H \"Authorization: Bearer <your_api_key>\" ``` Example Response: ```json { \"guardrails\": [ { \"guardrail_name\": \"bedrock-pre-guard\", \"guardrail_info\": { \"params\": [ { \"name\": \"toxicity_score\", \"type\": \"float\", \"description\": \"Score between 0-1 indicating content toxicity level\" }, { \"name\": \"pii_detection\", \"type\": \"boolean\" } ] } } ] } ``` * List Guardrails */ listGuardrailsGuardrailsListGetRaw(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: `/guardrails/list`, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response); }); } /** * List the guardrails that are available on the proxy server 👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start) Example Request: ```bash curl -X GET \"http://localhost:4000/guardrails/list\" -H \"Authorization: Bearer <your_api_key>\" ``` Example Response: ```json { \"guardrails\": [ { \"guardrail_name\": \"bedrock-pre-guard\", \"guardrail_info\": { \"params\": [ { \"name\": \"toxicity_score\", \"type\": \"float\", \"description\": \"Score between 0-1 indicating content toxicity level\" }, { \"name\": \"pii_detection\", \"type\": \"boolean\" } ] } } ] } ``` * List Guardrails */ listGuardrailsGuardrailsListGet(initOverrides) { return __awaiter(this, void 0, void 0, function* () { const response = yield this.listGuardrailsGuardrailsListGetRaw(initOverrides); return yield response.value(); }); } } exports.LitellmGuardrailsApi = LitellmGuardrailsApi;