Comparing version 0.1.2 to 0.1.3
@@ -1,8 +0,55 @@ | ||
import Settings from './Settings'; | ||
import ChatMessage from './ChatMessage'; | ||
import { AIModel } from './AIModel'; | ||
import { ApiVersion } from './ApiVersion'; | ||
import { Role } from './Role'; | ||
import { AIException } from './AIException'; | ||
import QBAICore from './QBAICore'; | ||
export { type Settings, type ChatMessage, Role, ApiVersion, AIException, AIModel, QBAICore, }; | ||
declare class AIModel { | ||
static readonly gpt__3_5__turbo = "gpt-3.5-turbo"; | ||
static readonly gpt__3_5__turbo__0613 = "gpt-3.5-turbo-0613"; | ||
static readonly gpt__3_5__turbo__16k = "gpt-3.5-turbo-16k"; | ||
static readonly gpt__3_5__turbo__16k__0613 = "gpt-3.5-turbo-16k-0613"; | ||
static readonly gpt__4 = "gpt-4"; | ||
static readonly gpt__4__0613 = "gpt-4-0613"; | ||
static readonly gpt__4__32k = "gpt-4-32k"; | ||
static readonly gpt__4__32k__0613 = "gpt-4-32k-0613"; | ||
} | ||
declare class ApiVersion { | ||
static readonly v1 = "v1"; | ||
} | ||
interface Settings { | ||
apiKey: string; | ||
apiVersion: ApiVersion; | ||
token: string; | ||
serverPath: string; | ||
organization: string | undefined; | ||
model: AIModel; | ||
temperature: number; | ||
maxRequestTokens: number; | ||
maxResponseTokens: number | undefined; | ||
} | ||
declare class Role { | ||
static readonly me = "me"; | ||
static readonly other = "other"; | ||
} | ||
interface ChatMessage { | ||
role: Role; | ||
content: string; | ||
} | ||
declare class AIException extends Error { | ||
message: string; | ||
readonly code: number; | ||
constructor(message: string, code: number); | ||
} | ||
declare class QBAICore { | ||
static sendPromptToProxy(apiKey: string, context: ({ | ||
role: string; | ||
content: string; | ||
} | ChatMessage)[], model: string, temperature: number, apiEndpoint: string): Promise<any>; | ||
static sendPromptToOpenai(apiKey: string, context: (ChatMessage | { | ||
role: string; | ||
content: string; | ||
})[], model: string, temperature: number, organization: string, apiEndpoint: string): Promise<any>; | ||
} | ||
export { AIException, AIModel, ApiVersion, type ChatMessage, QBAICore, Role, type Settings }; |
@@ -1,16 +0,2 @@ | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.QBAICore = exports.AIModel = exports.AIException = exports.ApiVersion = exports.Role = void 0; | ||
var AIModel_1 = require("./AIModel"); | ||
Object.defineProperty(exports, "AIModel", { enumerable: true, get: function () { return AIModel_1.AIModel; } }); | ||
var ApiVersion_1 = require("./ApiVersion"); | ||
Object.defineProperty(exports, "ApiVersion", { enumerable: true, get: function () { return ApiVersion_1.ApiVersion; } }); | ||
var Role_1 = require("./Role"); | ||
Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return Role_1.Role; } }); | ||
var AIException_1 = require("./AIException"); | ||
Object.defineProperty(exports, "AIException", { enumerable: true, get: function () { return AIException_1.AIException; } }); | ||
var QBAICore_1 = __importDefault(require("./QBAICore")); | ||
exports.QBAICore = QBAICore_1.default; | ||
"use strict";var p=require("node-fetch");class t{}t.gpt__3_5__turbo="gpt-3.5-turbo",t.gpt__3_5__turbo__0613="gpt-3.5-turbo-0613",t.gpt__3_5__turbo__16k="gpt-3.5-turbo-16k",t.gpt__3_5__turbo__16k__0613="gpt-3.5-turbo-16k-0613",t.gpt__4="gpt-4",t.gpt__4__0613="gpt-4-0613",t.gpt__4__32k="gpt-4-32k",t.gpt__4__32k__0613="gpt-4-32k-0613";class g{}g.v1="v1";class i{}i.me="me",i.other="other";class d extends Error{constructor(e,o){super(e),this.message=e,this.code=o}}class h{static async sendPromptToProxy(e,o,_,a,s){const n={method:"POST",headers:{"Content-Type":"application/json","qb-token":e},body:JSON.stringify({messages:o,model:_,temperature:a})};return(await(await p(s,n)).json())?.choices?.[0]?.message?.content||""}static async sendPromptToOpenai(e,o,_,a,s,n){const c={method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify({messages:o,model:_,temperature:a})},u={method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`,"OpenAI-Organization":`${s}`},body:JSON.stringify({messages:o,temperature:a})},m=s&&s.length>0?u:c;return(await(await p(n,m)).json()).choices[0].message?.content||""}}exports.AIException=d,exports.AIModel=t,exports.ApiVersion=g,exports.QBAICore=h,exports.Role=i; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "qb-ai-core", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "AI Core library for Quickblox AI Features", | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"browser": "dist/browser.js", | ||
"types": "dist/index.d.ts", | ||
"license": "MIT", | ||
@@ -11,2 +14,5 @@ "dependencies": { | ||
"devDependencies": { | ||
"@rollup/plugin-commonjs": "^25.0.7", | ||
"@rollup/plugin-json": "^6.0.1", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
@@ -32,10 +38,9 @@ "@testing-library/user-event": "^13.5.0", | ||
"prettier": "^2.8.0", | ||
"ts-loader": "^9.4.2", | ||
"typedoc": "^0.23.22", | ||
"typescript": "^4.9.3", | ||
"webpack": "^5.82.1", | ||
"webpack-cli": "^5.1.1" | ||
"rollup": "^4.6.0", | ||
"rollup-plugin-dts": "^6.1.0", | ||
"rollup-plugin-esbuild": "^6.1.0", | ||
"typescript": "^4.9.3" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"build": "rollup -c", | ||
"lint": "eslint ./src" | ||
@@ -42,0 +47,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32339
27
23
302
3
2