UNPKG

@dasheck0/openai-api

Version:

A tiny client module for the openAI API

39 lines (38 loc) 1.33 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.embeddingsUrl = exports.answersUrl = exports.filesUrl = exports.classificationsUrl = exports.engineUrl = exports.enginesUrl = exports.searchURL = exports.completionURL = void 0; var ORIGIN = "https://api.openai.com"; var API_VERSION = "v1"; var OPEN_AI_URL = "".concat(ORIGIN, "/").concat(API_VERSION); function completionURL() { return "".concat(OPEN_AI_URL, "/completions"); } exports.completionURL = completionURL; function searchURL(engine) { return "".concat(OPEN_AI_URL, "/engines/").concat(engine, "/search"); } exports.searchURL = searchURL; function enginesUrl() { return "".concat(OPEN_AI_URL, "/engines"); } exports.enginesUrl = enginesUrl; function engineUrl(engine) { return "".concat(OPEN_AI_URL, "/engines/").concat(engine); } exports.engineUrl = engineUrl; function classificationsUrl() { return "".concat(OPEN_AI_URL, "/classifications"); } exports.classificationsUrl = classificationsUrl; function filesUrl() { return "".concat(OPEN_AI_URL, "/files"); } exports.filesUrl = filesUrl; function answersUrl() { return "".concat(OPEN_AI_URL, "/answers"); } exports.answersUrl = answersUrl; function embeddingsUrl() { return "".concat(OPEN_AI_URL, "/embeddings"); } exports.embeddingsUrl = embeddingsUrl;