Xingyao Wang 0380070e98
Abstraction that allows us to develop different agents, frontend, backend, and evaluation in parallel (#68)
* move agent to langchains_agent

* remove old .env

* remove the old agent folder

* add preliminary version of Agent abstraction

* add preliminary version of the main.py

* merge controlloop and main into a Agent class

* add init

* fix json import

* fix missing arg

* get langchains_agent working after abstraction

* rename `research` to `agenthub`

* rename: rename research to agenthub

---------

Co-authored-by: huybery <huybery@gmail.com>
2024-03-20 15:09:29 -04:00

34 lines
943 B
JavaScript

const process = require('process');
const commands = require('./commands');
function printHelp() {
const helpText = `
Usage: node cli.js <command> <string>
Commands:
reverse - Reverses the input string.
uppercase - Converts the input string to uppercase.
lowercase - Converts the input string to lowercase.
spongebob - Converts the input string to spongebob case.
length - Returns the length of the input string.
scramble - Randomly scrambles the characters in the input string.
`;
console.log(helpText);
}
if (process.argv.length === 3 && process.argv[2] === '--help') {
printHelp();
process.exit(0);
} else if (process.argv.length < 4) {
console.log('Usage: node cli.js <command> <string>');
process.exit(1);
}
const command = process.argv[2];
const inputString = process.argv[3];
if (command in commands) {
console.log(commands[command](inputString));
} else {
console.log('Invalid command!');
}