Comparing version
@@ -28,3 +28,3 @@ #!/usr/bin/env node | ||
const dotenv = __importStar(require("dotenv")); | ||
dotenv.config(); | ||
dotenv.config({ path: startingvalues_1.ENV_FILE_LOCATION }); | ||
const ts_command_line_args_1 = require("ts-command-line-args"); | ||
@@ -31,0 +31,0 @@ const rundebate_1 = require("./rundebate"); |
@@ -0,1 +1,2 @@ | ||
export declare const ENV_FILE_LOCATION: string; | ||
export declare function checkForStartingValuesAndSave(): Promise<void>; |
@@ -29,3 +29,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.checkForStartingValuesAndSave = void 0; | ||
exports.checkForStartingValuesAndSave = exports.ENV_FILE_LOCATION = void 0; | ||
const readline_1 = require("readline"); | ||
@@ -37,3 +37,3 @@ const path_1 = __importDefault(require("path")); | ||
dotenv.config(); | ||
const ENV_FILE_LOCATION = path_1.default.join(__dirname, '..', '.env'); | ||
exports.ENV_FILE_LOCATION = path_1.default.join(__dirname, '..', '.env'); | ||
const DATA_DIR_LOCATION = path_1.default.join(__dirname, '..', 'data'); | ||
@@ -50,9 +50,9 @@ const question = (questionText) => { | ||
if (!process.env.OPENAI_API_KEY) { | ||
console.log(`Please provide an OpenAI key. This will be saved to ${ENV_FILE_LOCATION} on your system (and never sent anywhere else) for future use. It will be deleted when you uninstall this package.`); | ||
console.log(`Please provide an OpenAI key. This will be saved to ${exports.ENV_FILE_LOCATION} on your system (and never sent anywhere else) for future use. It will be deleted when you uninstall this package.`); | ||
const openAIKey = await question('OpenAI Key: '); | ||
if (fs_1.default.existsSync(ENV_FILE_LOCATION)) { | ||
fs_1.default.appendFileSync(ENV_FILE_LOCATION, `\nOPENAI_API_KEY=${openAIKey}`); | ||
if (fs_1.default.existsSync(exports.ENV_FILE_LOCATION)) { | ||
fs_1.default.appendFileSync(exports.ENV_FILE_LOCATION, `\nOPENAI_API_KEY=${openAIKey}`); | ||
} | ||
else { | ||
fs_1.default.writeFileSync(ENV_FILE_LOCATION, `OPENAI_API_KEY=${openAIKey}`); | ||
fs_1.default.writeFileSync(exports.ENV_FILE_LOCATION, `OPENAI_API_KEY=${openAIKey}`); | ||
} | ||
@@ -68,7 +68,7 @@ process.env.OPENAI_API_KEY = openAIKey; | ||
process.env.GPT_LOG = 'gpt.ndjson'; | ||
if (fs_1.default.existsSync(ENV_FILE_LOCATION)) { | ||
fs_1.default.appendFileSync(ENV_FILE_LOCATION, `\nDATA_DIRECTORY=${DATA_DIR_LOCATION}\nGPT_LOG=gpt.ndjson`); | ||
if (fs_1.default.existsSync(exports.ENV_FILE_LOCATION)) { | ||
fs_1.default.appendFileSync(exports.ENV_FILE_LOCATION, `\nDATA_DIRECTORY=${DATA_DIR_LOCATION}\nGPT_LOG=gpt.ndjson`); | ||
} | ||
else { | ||
fs_1.default.writeFileSync(ENV_FILE_LOCATION, `DATA_DIRECTORY=${DATA_DIR_LOCATION}\nGPT_LOG=gpt.ndjson`); | ||
fs_1.default.writeFileSync(exports.ENV_FILE_LOCATION, `DATA_DIRECTORY=${DATA_DIR_LOCATION}\nGPT_LOG=gpt.ndjson`); | ||
} | ||
@@ -75,0 +75,0 @@ fs_1.default.writeFileSync(path_1.default.join(DATA_DIR_LOCATION, 'gpt.ndjson'), ''); |
{ | ||
"name": "socrate", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"author": "Hrishi Olickel <hrishi[@]grey-wing.com> (https://olickel.com)", | ||
@@ -5,0 +5,0 @@ "description": "A discussion room for using GPT personalities with internal monologues to debate problems. Provide a problem to start, or customize the settings of the debate room. Custom agents incoming!", |
#!/usr/bin/env node | ||
import * as dotenv from "dotenv"; | ||
dotenv.config(); | ||
dotenv.config({path: ENV_FILE_LOCATION}); | ||
@@ -9,3 +9,3 @@ import { parse } from "ts-command-line-args"; | ||
import { debate } from './rundebate'; | ||
import { checkForStartingValuesAndSave } from './startingvalues'; | ||
import { ENV_FILE_LOCATION, checkForStartingValuesAndSave } from './startingvalues'; | ||
@@ -12,0 +12,0 @@ checkForStartingValuesAndSave().then(() => { |
@@ -8,3 +8,3 @@ import { createInterface } from 'readline'; | ||
const ENV_FILE_LOCATION = path.join(__dirname, '..', '.env'); | ||
export const ENV_FILE_LOCATION = path.join(__dirname, '..', '.env'); | ||
const DATA_DIR_LOCATION = path.join(__dirname, '..', 'data'); | ||
@@ -11,0 +11,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
183704
0.14%2283
0.04%