This repository provides a straightforward framework for creating AI agents using Node.js. It aims to simplify the integration and management of multiple AI services within Node.js applications. By offering a standard interface to interact with different AI services, this framework assists in the seamless switching, testing, and deployment of various AI functionalities.
Currently, the framework supports the following AI services:
- ollama (for local llms)
- replicate (for access to AI models)
- openai (for access to the assistants API)
Run the app once to create the relevant config files in ./configurations
To use this framework with OLLAMA, first ensure you have downloaded the necessary AI model:
ollama pull llama3
You'll need a valid API key to use Replicate. You can obtain one by signing up at Replicate.ai.
Run the app once and it will create a ./configurations/replicate.json
file. Add your API key to this file.
node demo.js
To start the agent, use the provided script:
node agents/badger.js
Install pm2
```bash
npm install pm2 -g
```
Start all the agents
```bash
pm2 start ecosystem.config.js
```
To use the Discord bot functionality, you will need a valid token. Without this, the application will not be able to log in, resulting in the following error:
🎮 ❌ Error logging in: Error [TokenInvalid]: An invalid token was provided.
at Client.login [...]
code: 'TokenInvalid'
}
Ensure that your .configurations/discord-bot.json
file contains a valid Discord token and server ID:
{
"token": "YOUR_DISCORD_TOKEN" ,
"guild": "YOUR_DISCORD_SERVER_ID"
}
If you encounter an error stating that you have an invalid token, check that the .configurations/discord-bot.json
file is configured correctly with a valid token.
This framework is currently tailored for use with OLLAMA. Adjustments or expansions to include additional AI services like Replicate may require further modifications to ensure compatibility.
Created by Jonathan Beckwith for Cenetex Inc.
# License
The code in this project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
cosyworld © 2024 by Jonathan Beckwith is licensed under CC BY 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by/4.0/
Licensing claims for external media (imgur links) are the responsibility of the original creators and are not covered by this statement.