
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
nuxt-chatgpt
Advanced tools
This user-friendly module boasts of an easy integration process that enables seamless implementation into any Nuxt 3 project. With type-safe integration, you can integrate ChatGPT into your Nuxt 3 project without breaking a sweat. Enjoy easy access to the send
method through the useChatgpt()
composable. Additionally, the module guarantees security as requests are routed through a Nitro Server, thus preventing the exposure of your API Key.
useChatgpt()
composable that grants easy access to the send
method.npm install --save-dev nuxt-chatgpt
pnpm add -D nuxt-chatgpt
yarn add --dev nuxt-chatgpt
export default defineNuxtConfig({
modules: ["nuxt-chatgpt"],
// entirely optional
chatgpt: {
apiKey: 'Your apiKey here goes here'
},
})
That's it! You can now use Nuxt Chatgpt in your Nuxt app 🔥
To access the send
method in the nuxt-chatgpt module, you can use the useChatgpt()
composable, which provides easy access to the method. The send method requires two parameters:
message
: a string representing the text message that you want to send to the GPT-3 model for processing.options
: an optional object that specifies any additional options you want to pass to the API request, such as the GPT-3 model ID, the number of responses to generate, and the maximum length of each response.const { send } = useChatgpt()
const data = ref('')
const message = ref('')
async function sendMessage() {
const response = await send(message.value)
data.value = response
}
<template>
<div>
<input v-model="message">
<button
@click="sendMessage"
v-text="'Send'"
/>
<div>{{ data }}</div>
</div>
</template>
Name | Type | Default | Description |
---|---|---|---|
apiKey | String | xxxxxx | Your apiKey here goes here |
isEnabled | Boolean | true | Enable or disable the module. True by default. |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Distributed under the MIT License. See LICENSE.txt
for more information.
Oliver Trajceski - LinkedIn - oliver@akrinum.com
Project Link: https://github.com/schnapsterdog/nuxt-chatgpt
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!
v0.1.6
FAQs
ChatGPT integration for Nuxt 3
We found that nuxt-chatgpt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.