doomiaichat
Version:
Doomisoft OpenAI
21 lines (20 loc) • 872 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const gptbase_1 = __importDefault(require("./gptbase"));
class OpenAIBase extends gptbase_1.default {
constructor(apiKey, apiOption = {}) {
super();
this.apiKey = apiKey;
this.chatModel = apiOption.model || 'gpt-3.5-turbo';
this.maxtoken = apiOption.maxtoken || 2048;
this.top_p = apiOption.top_p || 0.95;
this.temperature = apiOption.temperature || 0.9;
this.presence_penalty = apiOption.presence_penalty || 0;
this.frequency_penalty = apiOption.frequency_penalty || 0;
this.embeddingmodel = apiOption.embedding || 'text-embedding-ada-002';
}
}
exports.default = OpenAIBase;