CONTRIBUTION.md
Thank you for considering contributing to ChatALL! We welcome contributions from everyone, regardless of your background or experience level. Your contributions help make this project better for everyone.
ChatALL is a project that allows users to chat with multiple AI bots concurrently, helping them discover the best results. Our goal is to provide a seamless and efficient experience for users to interact with various AI bots.
If you find any issues while using ChatALL, please follow these steps to report them:
We welcome pull requests from everyone. To submit a pull request, follow these steps:
Key directories:
src/bots/ - AI bot implementationssrc/i18n/ - Localization filessrc/components/ - Vue componentssrc/store/ - State managementpublic/bots/ - Bot logosTo maintain a consistent codebase, please follow these code style guidelines:
We believe that community involvement is crucial for the success of ChatALL. Here are some ways you can contribute:
If you are new to contributing to open source projects, here are some resources to help you get started:
If you would like to add a new AI bot to ChatALL, please follow these steps:
Create a new bot file: In the src/bots/ directory, create a new file for your bot. You can use the TemplateBot.js file as a starting point.
Implement the _sendPrompt() method: In your new bot file, implement the _sendPrompt() method to handle sending prompts to the AI bot.
Add a reference to your bot: In the src/bots/index.js file, add a reference to your new bot.
Add translations: Update all locale files in src/i18n/:
// filepath: src/i18n/locales/en.json
{
"yourBot": {
"name": "Your Bot Name"
}
}
This is an example of using LangChainBot. Since LangChainBot uses LangChainJS, it is easy to integrate AI bots that are already supported by LangChainJS. For detailed steps, refer to the "Step-by-Step Guide to Adding a New AI Bot" section below. If you prefer not to use LangChain, you can directly extend the Bot class.
// filepath: src/bots/KnowNothingBot.js
import LangChainBot from '@/bots/LangChainBot';
class KnowNothingBot extends LangChainBot {
static _className = "KnowNothingBot";
static _name = "Know Nothing Bot";
static _description = "A bot that knows nothing";
static _version = "1.0";
constructor() {
super();
}
async _sendPrompt(prompt) {
try {
// Implement your bot's logic here
return response;
} catch (error) {
throw error;
}
}
// Required methods when extending LangChainBot
_setupModel() {
// Setup your LangChain model here
}
getPastRounds() {
// Return the number of past conversation rounds to keep
return 1;
}
}
export default KnowNothingBot;
Create a New Bot File: Navigate to the src/bots/ directory and create a new file for your bot. For example, if your bot is named "KnowNothing", create KnowNothingBot.js.
Basic Bot Implementation
import Bot from '@/bots/Bot';
class KnowNothingBot extends Bot {
static _className = "KnowNothingBot";
static _name = "Know Nothing Bot";
static _description = "A bot that knows nothing";
}
Or for LangChain-based Bot
import LangChainBot from '@/bots/LangChainBot';
class KnowNothingBot extends LangChainBot {
static _className = "KnowNothingBot";
static _name = "Know Nothing Bot";
static _description = "A bot that knows nothing";
_setupModel() {
// Setup your LangChain model here
}
getPastRounds() {
return 1;
}
}
Implement the _sendPrompt() Method: Implement the _sendPrompt() method to handle sending prompts to the AI bot.
async _sendPrompt(prompt) {
try {
// Your code to send the prompt to the AI bot
return response;
} catch (error) {
throw error;
}
}
Add a Reference to Your Bot: Add your bot to the src/bots/index.js file to ensure it is included in the application:
// First import your bot
import KnowNothingBot from '@/bots/KnowNothingBot';
// Add to the main bot list
const all = [
ChatGPT35Bot.getInstance(),
ChatGPT4Bot.getInstance(),
KnowNothingBot.getInstance(), // Add your bot here
...existing_bots...
];
// Add to appropriate category arrays
export const botTags = {
free: [
bots.getBotByClassName("BardBot"),
bots.getBotByClassName("KnowNothingBot"), // If it's free
...existing_free_bots...
],
openSource: [
bots.getBotByClassName("AlpacaBot"),
bots.getBotByClassName("KnowNothingBot"), // If it's open source
...existing_opensource_bots...
],
api: [
bots.getBotByClassName("KnowNothingBot"), // If it uses API
bots.getBotByClassName("OpenAIAPI35Bot"),
...existing_api_bots...
],
madeInChina: [
bots.getBotByClassName("Qihoo360AIBrainBot"),
bots.getBotByClassName("KnowNothingBot"), // If it's made in China
...existing_china_bots...
],
};
// If needed, set custom user agent
KnowNothingBot._userAgent = "THE_RIGHT_USER_AGENT";
Customize User-Agent (if needed): Some websites may restrict access to specific browsers. Set the user-agent in KnowNothingBot.js if required.
static _userAgent = "THE_RIGHT_USER_AGENT";
Test Your Bot: Run the application and test your new bot to ensure it works correctly.
npm run electron:serve
Submit a Pull Request: Once you have tested your bot and ensured it works correctly, submit a pull request following the steps mentioned in the "How to Submit Pull Requests" section.
Thank you for your contributions! We appreciate your efforts and look forward to your involvement in our community.