interintel 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,8 +2,8 @@ const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
4
  // READING FOR INITAL REFERENCE
5
- function readSpecificFiles(filePaths) {
6
- const configFilePath = path.join(__dirname, '../inter-intel.config.js');
5
+ function readSpecificFiles(filePath) {
6
+ const configFilePath = path.join(__dirname, '../interintel.config.js');
7
7
 
8
8
  try {
9
9
  // Read the content of the config file
@@ -43,7 +43,7 @@ function writeFileFromPrompt(promptFileName, contentToWrite, baseDir) {
43
43
  throw new Error("Invalid file name. Please include a file name with an extension (e.g., 'output.txt').");
44
44
  }
45
45
 
46
- const fullPath = path.join(baseDir, `../inter-intel/session-samples/${promptFileName}`);
46
+ const fullPath = path.join(baseDir, `../interintel/session-samples/${promptFileName}`);
47
47
  const directoryPath = path.dirname(fullPath);
48
48
 
49
49
  if (!fs.existsSync(directoryPath)) {
package/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  // This is the index.js file of inter-intel
2
-
2
+ const path = require('path')
3
3
  const OpenAI = require('openai');
4
4
  const readline = require('readline');
5
- const config = require('./interintel.config.js');
5
+ const configPath = path.join(process.cwd(), 'interintel.config.js');
6
+ const config = require(configPath);
6
7
  require('dotenv').config();
7
8
  require('colors');
8
9
 
@@ -24,8 +25,8 @@ const rl = readline.createInterface({
24
25
 
25
26
  async function main() {
26
27
  // Provides initial context for session
27
- const specificFiles = ['./inter-intel.config.js'];
28
- let initialContent = readSpecificFiles(specificFiles);
28
+ // const specificFiles = ['./interintel.config.js'];
29
+ let initialContent = readSpecificFiles(configPath);
29
30
  let messages = [{ role: 'system', content: initialContent }];
30
31
 
31
32
  let currentState = null;
@@ -102,6 +103,9 @@ async function main() {
102
103
  main();
103
104
 
104
105
 
106
+ exports.main = function() {
107
+ main()
108
+ }
105
109
  exports.printMsg = function() {
106
110
  console.log("totally logging dude")
107
111
  }
@@ -2,7 +2,7 @@ require('dotenv').config();
2
2
 
3
3
  const config = {
4
4
  apiKey: `${process.env.OPENAI_API_KEY}`,
5
- aiVersion: `gpt-4`,
5
+ aiVersion: `gpt-3.5-turbo`,
6
6
  filePaths: ['./inter-intel/training/reference.txt', './readme.md'],
7
7
  };
8
8
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "interintel",
8
8
  "description": "The application `Interintel` is a command line interface (CLI) application implemented in Node.js. It essentially is an interactive communication tool between the user and an AI model, only openai models for now.",
9
- "version": "1.0.4",
9
+ "version": "1.0.6",
10
10
  "main": "index.js",
11
11
  "directories": {
12
12
  "doc": "docs"
package/setup.js CHANGED
@@ -1,12 +1,28 @@
1
1
  const fs = require('fs');
2
2
  const path = require('path');
3
3
 
4
- const configPath = path.join(__dirname, 'interintel.config.js');
4
+ const configPath = path.join(process.cwd(), 'interintel.config.js');
5
5
  const templatePath = path.join(__dirname, 'interintel.config.template.js');
6
6
 
7
- if (!fs.existsSync(configPath)) {
8
- fs.copyFileSync(templatePath, configPath);
9
- console.log('Interintel config created. Please update it with your settings.'.yellow);
10
- } else {
11
- console.log('Interintel config file already exists.'.yellow);
12
- }
7
+ console.log("Current working directory:", process.cwd());
8
+
9
+ console.log(`Checking for config file at: ${configPath}`);
10
+
11
+ console.log(fs.existsSync(configPath), "config path exists?")
12
+
13
+ console.log(`Template file path: ${templatePath}`);
14
+
15
+ console.log(fs.existsSync(templatePath), "template config path exists?")
16
+
17
+
18
+ try {
19
+ if (!fs.existsSync(configPath)) {
20
+ console.log('Config file does not exist, creating...');
21
+ fs.copyFileSync(templatePath, configPath);
22
+ console.log('Interintel config created. Please update it with your settings.'.yellow);
23
+ } else {
24
+ console.log('Interintel config file already exists.');
25
+ }
26
+ } catch (error) {
27
+ console.error('Error occurred during setup:', error);
28
+ }