AI hmm, you have reached here, Good Job! 👏🏻
So we have used vercel ai sdk Groq
for ai integration in our application which uses different models for different purposes.
You can also use OpenAI GPT-3, or any other AI model for your application if you want tp.
Now let's setup AI
in your application.
- Go to the Groq (opens in a new tab) console and create a new api key for absolutely free of cost and update it in the
.env
file.
.env
GROQ_API_KEY=
- Now, head over to
ai
folder in thesrc
directory and you can see there is some code defined for the ai chat.
- You can update the code according to your needs and also you can use different
models
for different purposes. See the Groq (opens in a new tab) models for more information.
- Now, for
Rate Limiting
,
we have set the tokens to 5 per user, you can change it according to your needs. So, if user has used all the tokens then user will not be able to use the ai chat.
See AI is not that hard, you have successfully set up the AI for the project. You can now use the Groq sdk to interact with the AI models.
Let's move to the payment integration now. 🚀