UNPKG

portkey-ai

Version:
45 lines (43 loc) 2.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AUDIO_FILE_DURATION_HEADER = exports.COLLECTIONS_API = exports.LABELS_API = exports.PROMPT_PARTIALS_API = exports.PROMPTS_API = exports.LOGS_API = exports.EMBEDDINGS_API = exports.FEEDBACK_API = exports.PROMPT_API = exports.TEXT_COMPLETE_API = exports.CHAT_COMPLETE_API = exports.OPEN_AI_API_KEY = exports.PORTKEY_PROXY_ENV = exports.PORTKEY_API_KEY_ENV = exports.PORTKEY_GATEWAY_URL = exports.LOCAL_BASE_URL = exports.PORTKEY_BASE_URL = exports.PORTKEY_HEADER_PREFIX = exports.DEFAULT_TIMEOUT = exports.DEFAULT_MAX_RETRIES = exports.CUSTOM_HOST_CONNECTION_ERROR = exports.LOCALHOST_CONNECTION_ERROR = exports.INVALID_PORTKEY_MODE = exports.MISSING_MODE_MESSAGE = exports.MISSING_CONFIG_MESSAGE = exports.MISSING_BASE_URL = exports.MISSING_API_KEY_ERROR_MESSAGE = void 0; exports.MISSING_API_KEY_ERROR_MESSAGE = `Portkey API Key Not Found Resolution: \ 1. Get your Portkey API key from https://app.portkey.ai/api-keys \ 2. Pass it while instantiating the Portkey client with apiKey param, or set it as an environment variable with export PORTKEY_API_KEY=YOUR_API_KEY `; exports.MISSING_BASE_URL = `No Base url provided. Please provide a valid base url. For example: https://api.portkey.ai `; exports.MISSING_CONFIG_MESSAGE = "The 'config' parameter is not set. Please provide a valid Config object"; exports.MISSING_MODE_MESSAGE = "The 'mode' parameter is not set. Please provide a valid mode literal."; exports.INVALID_PORTKEY_MODE = `Argument of type '{}' cannot be assigned to parameter "mode" of \ type "ModesLiteral | Modes | None" `; exports.LOCALHOST_CONNECTION_ERROR = `Could not instantiate the Portkey client. \ You can either add a valid 'apiKey' parameter (from https://app.portkey.ai/api-keys) \ or set the 'baseURL' parameter to your AI Gateway's instance's URL.`; exports.CUSTOM_HOST_CONNECTION_ERROR = `We could not connect to the AI Gateway's instance. \ Please check the 'baseURL' parameter in the Portkey client.`; exports.DEFAULT_MAX_RETRIES = 2; exports.DEFAULT_TIMEOUT = 60; exports.PORTKEY_HEADER_PREFIX = 'x-portkey-'; exports.PORTKEY_BASE_URL = 'https://api.portkey.ai/v1'; exports.LOCAL_BASE_URL = 'http://localhost:8787/v1'; exports.PORTKEY_GATEWAY_URL = exports.PORTKEY_BASE_URL; exports.PORTKEY_API_KEY_ENV = 'PORTKEY_API_KEY'; exports.PORTKEY_PROXY_ENV = 'PORTKEY_PROXY'; exports.OPEN_AI_API_KEY = 'DUMMY-KEY'; // API routes exports.CHAT_COMPLETE_API = '/chat/completions'; exports.TEXT_COMPLETE_API = '/completions'; exports.PROMPT_API = '/prompt/complete'; exports.FEEDBACK_API = '/feedback'; exports.EMBEDDINGS_API = '/embeddings'; exports.LOGS_API = '/logs'; exports.PROMPTS_API = '/prompts'; exports.PROMPT_PARTIALS_API = '/prompts/partials'; exports.LABELS_API = '/labels'; exports.COLLECTIONS_API = '/collections'; exports.AUDIO_FILE_DURATION_HEADER = 'audio-file-duration'; //# sourceMappingURL=constants.js.map