Skip to content

Commit 2d2b3ab

Browse files
authored
Merge pull request #504 from underctrl-io/twlite-patch-1
docs: update ai plugin setup example
2 parents c9390dc + aa5b9c9 commit 2d2b3ab

File tree

1 file changed

+14
-17
lines changed

1 file changed

+14
-17
lines changed

apps/website/docs/guide/05-official-plugins/01-commandkit-ai.mdx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,19 @@ export default defineConfig({
6767
});
6868
```
6969

70-
Then create an AI configuration file to set up your AI model:
70+
Then create an AI configuration file to set up your AI model. This can be done in two ways, one via CLI and another manually.
71+
72+
### With CLI
73+
74+
Use the following command to automatically generate `ai.ts` (or js) file in the project:
75+
76+
```sh
77+
commandkit create ai
78+
```
79+
80+
This command creates `ai.ts` (or js) file inside the `src` directory with openai o3-mini model. You can change it to any other supported models if needed.
81+
82+
### Manual
7183

7284
```ts title="src/ai.ts"
7385
import { createGoogleGenerativeAI } from '@ai-sdk/google';
@@ -91,22 +103,7 @@ configureAI({
91103
});
92104
```
93105

94-
Finally, import the configuration in your main application file:
95-
96-
```ts title="src/app.ts"
97-
import { Client, GatewayIntentBits } from 'discord.js';
98-
import './ai'; // Import AI configuration
99-
100-
const client = new Client({
101-
intents: [
102-
GatewayIntentBits.Guilds,
103-
GatewayIntentBits.GuildMessages,
104-
GatewayIntentBits.MessageContent, // Required for AI to read message content
105-
],
106-
});
107-
108-
export default client;
109-
```
106+
The AI plugin will load the `ai.ts` (or js) file automatically.
110107

111108
## Creating AI commands
112109

0 commit comments

Comments
 (0)