Skip to content

Commit 5813868

Browse files
authored
Merge pull request #34 from A-Baji/dev
doc update
2 parents 27b5c81 + 2392a9f commit 5813868

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

5+
## [2.0.1] - 06-15-2023
6+
7+
### Changed
8+
9+
- updated documentation
10+
- updated modelizer to version [2.0.0](https://github.com/A-Baji/discordAI-modelizer/releases/tag/2.0.1)
11+
512
## [2.0.0] - 06-15-2023
613

714
### Added
@@ -75,6 +82,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
7582

7683
- modified readme
7784

85+
[2.0.1]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.1
7886
[2.0.0]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.0
7987
[1.3.2]: https://github.com/A-Baji/discordAI/compare/1.3.1...1.3.2
8088
[1.3.1]: https://github.com/A-Baji/discordAI/compare/1.3.0...1.3.1

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# DiscordAI
2-
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.
2+
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.
33

44
DiscordAI is a parent module of [DiscordAI Modelizer](https://github.com/A-Baji/discordAI-modelizer).
55

@@ -26,25 +26,27 @@ The model creation process can be broken down into three steps: downloading the
2626

2727
Pick a channel and user whose chat logs you want to use for creating your custom model and run:
2828

29-
`discordai model create -c <channel_id> -u "<username#id>" --dirty`
29+
`discordai model create -c <channel_id> -u "<username>" --dirty`
3030

31-
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.
31+
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.
3232

33-
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:
33+
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:
3434

35-
`discordai model create -c <channel_id> -u "<username#id>" --ttime <timeframe> --tmax <thought_max> --tmin <thought_min> --dirty`
35+
`discordai model create -c <channel_id> -u "<username>" --ttime <timeframe> --tmax <thought_max> --tmin <thought_min> --dirty`
3636

3737
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:
3838

39-
`discordai model create -c <channel_id> -u "<username#id>" --ttime <timeframe> --tmax <thought_max> --tmin <thought_min> -m <max_size> -r <reduction_mode> --dirty`
39+
`discordai model create -c <channel_id> -u "<username>" --ttime <timeframe> --tmax <thought_max> --tmin <thought_min> -m <max_size> -r <reduction_mode> --dirty`
40+
41+
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.
4042

4143
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.
4244

4345
Now that you have fine tuned your dataset, you can finally begin the customization process by specifying a base model. OpenAI has four base [models](https://beta.openai.com/docs/models/gpt-3): davinci, curie, babbage, and ada, in order of most advanced to least advanced. Generally you will want to use davinci, but it is also the most expensive model as well as the longest to customize. Select your base model with the `-b` option.
4446

4547
Your final command should look something like this:
4648

47-
`discordai model create -c <channel_id> -u "<username#id>" --ttime <timeframe> --tmax <thought_max> --tmin <thought_min> -m <max_size> -r <reduction_mode> -b <base_model>`
49+
`discordai model create -c <channel_id> -u "<username>" --ttime <timeframe> --tmax <thought_max> --tmin <thought_min> -m <max_size> -r <reduction_mode> -b <base_model>`
4850

4951
If you find the training step to cost too many credits with your current options, you can cancel it with `discordai job cancel -j <job_id>`, 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`.
5052
### Test the new model
@@ -62,7 +64,7 @@ The options after `-n` and `-i` are to set the *defaults* for the slash command.
6264

6365
Slash commands can be updated at any time by calling `discordai bot commands new` with the same <command_name> but different default values. You can also delete slash commands with `discordai bot commands delete -n <command_name>`.
6466

65-
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.
67+
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 `@<your_bot> sync global` in discord.
6668

6769
### Questions
6870
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).
@@ -78,7 +80,7 @@ Manage your discord bot's slash commands
7880
* Create a new slash command for your bot that will use a customized model for completions
7981
* `discordai bot commands delete`
8082
* Delete a slash command from your bot
81-
#### `@bot_name sync|unsyc guild|global`
83+
#### `@<your_bot> sync|unsyc guild|global`
8284
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.
8385
### Model
8486
Commands related to your openAI models
@@ -108,4 +110,6 @@ Get or set your openaAI API key
108110
## Disclaimer
109111
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.
110112

111-
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.
113+
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.
114+
115+
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.

discordai/command_line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def discordai():
166166
"-u", "--user",
167167
type=str,
168168
dest='user',
169-
help="The username#ID of the discord user you want to use",
169+
help="The username of the discord user you want to use",
170170
)
171171
model_create_optional_named = model_create.add_argument_group("optional named arguments")
172172
model_create_optional_named.add_argument(

discordai/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.0.0"
1+
__version__ = "2.0.1"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ discord.py
22
openai
33
tiktoken
44
appdirs
5-
discordai_modelizer @ git+https://github.com/A-Baji/[email protected].0
5+
discordai_modelizer @ git+https://github.com/A-Baji/[email protected].1

0 commit comments

Comments
 (0)