From 42b3a26a97ae95b07cbfcc9631da776dca8ae296 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Thu, 15 Jun 2023 22:50:52 -0500 Subject: [PATCH 1/4] docs stuff --- README.md | 16 +++++++++------- discordai/command_line.py | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e901e36..4516e3a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # DiscordAI -DiscordAI is CLI package that you can use to run your discord bot. You can create customized openAI models based on a discord channel and user, and then add new slash commands to your bot to use these custom models to create openAI completions. +DiscordAI is CLI package that you can use to run your discord bot. You can create customized openAI models based on a discord channel and user, and then add new slash commands for your discord bot to use these custom models in openAI completions. DiscordAI is a parent module of [DiscordAI Modelizer](https://github.com/A-Baji/discordAI-modelizer). @@ -26,17 +26,19 @@ The model creation process can be broken down into three steps: downloading the Pick a channel and user whose chat logs you want to use for creating your custom model and run: -`discordai model create -c -u "" --dirty` +`discordai model create -c -u "" --dirty` -You can follow [this guide](https://turbofuture.com/internet/Discord-Channel-ID) to learn how to find a channel's ID. Make sure that you include the full username with the #id, and wrap it in quotes if it contains spaces. The `--dirty` flag prevents the outputted dataset files from being deleted. Downloaded chat logs get saved and reused, but you can set the `--redownload` flag if you want to update the logs. +You can follow [this guide](https://turbofuture.com/internet/Discord-Channel-ID) to learn how to find a channel's ID. Make sure that you include the full username with the , and wrap it in quotes if it contains spaces. The `--dirty` flag prevents the outputted dataset files from being deleted. Downloaded chat logs get saved and reused, but you can set the `--redownload` flag if you want to update the logs. -You may have noticed the lack of a model customization process occurring after running that command. This is because no base model was selected, but before you specify a base model, you should analyze the generated dataset located in the directory mentioned in the logs. Chat messages are parsed into a dataset by grouping individual messages sent within a certain timeframe into "thoughts", where each thought is a completion in the dataset. The default for this timeframe is 10 seconds. The length of each thought must also be within the minimum and max thought length. The defaults for these are 4 words and `None`, or optional. If your dataset looks a bit off, try different settings using the `--ttime`, `--tmin`, and `--ttmax` options: +You may have noticed the the model creation step was skipped. This is because no base model was selected, but before you specify a base model, you should analyze the generated dataset located in the directory mentioned in the logs. Chat messages are parsed into a dataset by grouping individual messages sent within a certain timeframe into "thoughts", where each thought is a completion in the dataset. The default for this timeframe is 10 seconds. The length of each thought must also be within the minimum and max thought length. The defaults for these are 4 words and `None`, or optional. If your dataset looks a bit off, try different settings using the `--ttime`, `--tmin`, and `--ttmax` options: -`discordai model create -c -u "" --ttime --tmax --tmin --dirty` +`discordai model create -c -u "" --ttime --tmax --tmin --dirty` After you've found good thought settings, you will want to manage your dataset's size. The larger your dataset, the more openAI credits it will cost to create a custom model. By default, the max dataset size is set to 1000. If your dataset exceeds this limit, it will be reduced using either a "first", "last", "middle", or "even" reduction method. The "first" method will select the first n messages, "last" will select the last n, "middle" will select the middle n, and "even" will select an even distribution of n messages. The default reduction method is even. You can set the max dataset size and reduction mode using the `-m` and `-r` options: -`discordai model create -c -u "" --ttime --tmax --tmin -m -r --dirty` +`discordai model create -c -u "" --ttime --tmax --tmin -m -r --dirty` + +If you are still not satisfied with the resulting dataset, you can manually alter it and then use the `--use_existing` flag. This will skip the dataset processing step and instead use the pre-existing dataset. If you are planning on creating multiple models, you may want to get your hands on multiple openAI API keys in order to maximize the free credit usage. You can assign specific api keys to custom models using the `-o` option. Otherwise, the key provided in your config will be used. @@ -44,7 +46,7 @@ Now that you have fine tuned your dataset, you can finally begin the customizati Your final command should look something like this: -`discordai model create -c -u "" --ttime --tmax --tmin -m -r -b ` +`discordai model create -c -u "" --ttime --tmax --tmin -m -r -b ` If you find the training step to cost too many credits with your current options, you can cancel it with `discordai job cancel -j `, and then either lower your max dataset size, or choose a different discord channel and/or user. You can get a list of all your jobs with `discordai job list --simple`. ### Test the new model diff --git a/discordai/command_line.py b/discordai/command_line.py index 364065a..bbb930b 100644 --- a/discordai/command_line.py +++ b/discordai/command_line.py @@ -166,7 +166,7 @@ def discordai(): "-u", "--user", type=str, dest='user', - help="The username#ID of the discord user you want to use", + help="The username of the discord user you want to use", ) model_create_optional_named = model_create.add_argument_group("optional named arguments") model_create_optional_named.add_argument( From bc768b4d1a879040ce98cb0130bd7a715fee46a0 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Thu, 15 Jun 2023 23:01:30 -0500 Subject: [PATCH 2/4] readme tweak --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4516e3a..59f882f 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ The options after `-n` and `-i` are to set the *defaults* for the slash command. Slash commands can be updated at any time by calling `discordai bot commands new` with the same but different default values. You can also delete slash commands with `discordai bot commands delete -n `. -After creating a new slash command, remember to sync your slash commands with discord's servers by running `discordai bot start --sync`, or by using `@bot_name sync global` in discord. +After creating a new slash command, remember to sync your slash commands with discord's servers by running `discordai bot start --sync`, or by using `@ sync global` in discord. ### Questions If you have any questions, feel free to make a new post in [discussions](https://github.com/A-Baji/discordAI/discussions/categories/q-a). If you encounter any issues while using discordAI, make sure to create a new [issue](https://github.com/A-Baji/discordAI/issues). @@ -80,7 +80,7 @@ Manage your discord bot's slash commands * Create a new slash command for your bot that will use a customized model for completions * `discordai bot commands delete` * Delete a slash command from your bot -#### `@bot_name sync|unsyc guild|global` +#### `@ sync|unsyc guild|global` These are special non-CLI commands that must be run *in discord*, in a channel that your bot is a member of. They are used to update or remove your bot's slash commands from discord's servers. ### Model Commands related to your openAI models From 238c75e2c3990af657b57695285cd50b225aba89 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Thu, 15 Jun 2023 23:16:32 -0500 Subject: [PATCH 3/4] name doc update --- CHANGELOG.md | 8 ++++++++ README.md | 4 +++- discordai/version.py | 2 +- requirements.txt | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1721220..2b25f69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention. +## [2.0.1] - 06-15-2023 + +### Changed + +- updated documentation +- updated modelizer to version [2.0.0](https://github.com/A-Baji/discordAI-modelizer/releases/tag/2.0.1) + ## [2.0.0] - 06-15-2023 ### Added @@ -75,6 +82,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and - modified readme +[2.0.1]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.1 [2.0.0]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.0 [1.3.2]: https://github.com/A-Baji/discordAI/compare/1.3.1...1.3.2 [1.3.1]: https://github.com/A-Baji/discordAI/compare/1.3.0...1.3.1 diff --git a/README.md b/README.md index 59f882f..0f726c4 100644 --- a/README.md +++ b/README.md @@ -110,4 +110,6 @@ Get or set your openaAI API key ## Disclaimer This application allows users to download the chat history of any channel for which they have permission to invite a bot, and then use those logs to create an openai model based on a user's chat messages. It is important to note that this application should only be used with the consent of all members of the channel. Using this application for malicious purposes, such as impersonation, or without the consent of all members is strictly prohibited. -By using this application, you agree to use it responsibly. The developers of this application are not responsible for any improper use of the application or any consequences resulting from such use. We strongly discourage using this application for any unethical purposes. \ No newline at end of file +By using this application, you agree to use it responsibly. The developers of this application are not responsible for any improper use of the application or any consequences resulting from such use. We strongly discourage using this application for any unethical purposes. + +This application is not affiliated with or endorsed by Discord, Inc. The use of the term "Discord" in our product name is solely for descriptive purposes to indicate compatibility with the Discord platform. \ No newline at end of file diff --git a/discordai/version.py b/discordai/version.py index 8c0d5d5..159d48b 100644 --- a/discordai/version.py +++ b/discordai/version.py @@ -1 +1 @@ -__version__ = "2.0.0" +__version__ = "2.0.1" diff --git a/requirements.txt b/requirements.txt index d3040d4..1d461bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ discord.py openai tiktoken appdirs -discordai_modelizer @ git+https://github.com/A-Baji/discordAI-modelizer.git@2.0.0 \ No newline at end of file +discordai_modelizer @ git+https://github.com/A-Baji/discordAI-modelizer.git@2.0.1 \ No newline at end of file From 2392a9fe5fb28dfbeb6c5182a9c827852f12bea9 Mon Sep 17 00:00:00 2001 From: A-Baji Date: Thu, 15 Jun 2023 23:17:28 -0500 Subject: [PATCH 4/4] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f726c4..36188fe 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Pick a channel and user whose chat logs you want to use for creating your custom You can follow [this guide](https://turbofuture.com/internet/Discord-Channel-ID) to learn how to find a channel's ID. Make sure that you include the full username with the , and wrap it in quotes if it contains spaces. The `--dirty` flag prevents the outputted dataset files from being deleted. Downloaded chat logs get saved and reused, but you can set the `--redownload` flag if you want to update the logs. -You may have noticed the the model creation step was skipped. This is because no base model was selected, but before you specify a base model, you should analyze the generated dataset located in the directory mentioned in the logs. Chat messages are parsed into a dataset by grouping individual messages sent within a certain timeframe into "thoughts", where each thought is a completion in the dataset. The default for this timeframe is 10 seconds. The length of each thought must also be within the minimum and max thought length. The defaults for these are 4 words and `None`, or optional. If your dataset looks a bit off, try different settings using the `--ttime`, `--tmin`, and `--ttmax` options: +You may have noticed that the model creation step was skipped. This is because no base model was selected, but before you specify a base model, you should analyze the generated dataset located in the directory mentioned in the logs. Chat messages are parsed into a dataset by grouping individual messages sent within a certain timeframe into "thoughts", where each thought is a completion in the dataset. The default for this timeframe is 10 seconds. The length of each thought must also be within the minimum and max thought length. The defaults for these are 4 words and `None`, or optional. If your dataset looks a bit off, try different settings using the `--ttime`, `--tmin`, and `--ttmax` options: `discordai model create -c -u "" --ttime --tmax --tmin --dirty`