ChatGPT
The litecommands-chatgpt is a extension for supporting ChatGPT suggestions.
kotlin
implementation("dev.rollczi:litecommands-chatgpt:3.9.1")
groovy
implementation "dev.rollczi:litecommands-chatgpt:3.9.1"
xml
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>litecommands-chatgpt</artifactId>
<version>3.9.1</version>
</dependency>
Register the extension
Register the extension in the LiteCommands
builder:
java
.extension(new LiteChatGptExtension<>(), configuration -> configuration
.apiKey("OPENAI_API_KEY") // get your api key from https://platform.openai.com/account/api-keys
.model(ChatGptModel.GPT_4) // get model from https://platform.openai.com/docs/models/gpt-3-5
.temperature(1.0) // see more https://platform.openai.com/docs/guides/gpt/how-should-i-set-the-temperature-parameter
.tokensLimit(2, 64) // min and max tokens
.cooldown(Duration.ofMillis(500)) // cooldown between suggestions per player
)
Example Command
java
@Command(name = "ban")
public class BanCommand {
@Execute
void ban(
@Arg Player player,
@Join @ChatGpt(topic = "Reason for ban") String reason
) {
player.kickPlayer(reason);
}
}