nuxt-chatgpt 0.1.4 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,182 +1,181 @@
1
- [![Contributors][contributors-shield]][contributors-url]
2
- [![Downloads][downloads-shield]][downloads-url]
3
- [![Issues][issues-shield]][issues-url]
4
- [![MIT License][license-shield]][license-url]
5
- [![LinkedIn][linkedin-shield]][linkedin-url]
6
-
7
- <!-- PROJECT LOGO -->
8
- <br />
9
- <div>
10
- <h1>Nuxt Chatgpt</h3>
11
-
12
- <img src="images/chatgpt-logo.png" alt="Logo">
13
-
14
- > [ChatGPT](https://openai.com/) integration for [Nuxt 3](https://nuxt.com).
15
- <p align="center">
16
- <br />
17
- <a href="https://github.com/schnapsterdog/nuxt-chatgpt/issues target="_blank"">Report Bug</a>
18
- ·
19
- <a href="https://github.com/schnapsterdog/nuxt-chatgpt/issues target="_blank"">Request Feature</a>
20
- </p>
21
- </div>
22
-
23
- ## About the module
24
-
25
- This user-friendly module boasts of an easy integration process that enables seamless implementation into any [Nuxt 3](https://nuxt.com) project. With type-safe integration, you can integrate [ChatGPT](https://openai.com/) into your [Nuxt 3](https://nuxt.com) project without breaking a <b>sweat</b>. Enjoy easy access to the `send` method through the `useChatgpt()` composable. Additionally, the module guarantees <b><i>security</i></b> as requests are routed through a [Nitro Server](https://nuxt.com/docs/guide/concepts/server-engine), thus preventing the exposure of your <b>API Key</b>.
26
-
27
- ## Features
28
-
29
- - 💪 &nbsp; Easy implementation into any [Nuxt 3](https://nuxt.com) project.
30
- - 👉 &nbsp; Type-safe integration of Chatgpt into your [Nuxt 3](https://nuxt.com) project.
31
- - 🕹️ &nbsp; Provides a `useChatgpt()` composable that grants easy access to the `send` method.
32
- - 🔥 &nbsp; Ensures security by routing requests through a [Nitro Server](https://nuxt.com/docs/guide/concepts/server-engine), preventing the <b>API Key</b> from being exposed.
33
- - 🧱 &nbsp; It is lightweight and performs well.
34
-
35
- ## Getting Started
36
-
37
- 1. Add nuxt-chatgpt dependency to your project
38
- * npm
39
- ```sh
40
- npm install --save-dev nuxt-chatgpt
41
- ```
42
- * pnpm
43
- ```sh
44
- pnpm add -D nuxt-chatgpt
45
- ```
46
- * yarn
47
- ```sh
48
- yarn add --dev nuxt-chatgpt
49
- ```
50
- 2. Add nuxt-chatgpt to the modules section of nuxt.config.ts
51
-
52
- ```js
53
- export default defineNuxtConfig({
54
- modules: ["nuxt-chatgpt"],
55
-
56
- // entirely optional
57
- chatgpt: {
58
- apiKey: 'Your apiKey here goes here'
59
- },
60
- })
61
- ```
62
- That's it! You can now use Nuxt Chatgpt in your Nuxt app 🔥
63
-
64
- ## Example & Usage
65
-
66
- 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:
67
-
68
- - `message`: a string representing the text message that you want to send to the GPT-3 model for processing.
69
- - `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.
70
-
71
- ```js
72
- const { send } = useChatgpt()
73
-
74
- const data = ref('')
75
- const message = ref('')
76
-
77
- async function sendMessage() {
78
- const response = await send(message.value)
79
- data.value = response
80
- }
81
-
82
- ```
83
-
84
- ```html
85
- <template>
86
- <div>
87
- <input v-model="message">
88
- <button
89
- @click="sendMessage"
90
- v-text="'Send'"
91
- />
92
- <div>{{ data }}</div>
93
- </div>
94
- </template>
95
- ```
96
-
97
- ## Module Options
98
-
99
- | Name | Type | Default | Description |
100
- |--|--|--|--|
101
- |**apiKey**|`String`|`xxxxxx`|Your apiKey here goes here
102
- |**isEnabled**|`Boolean`|`true`| Enable or disable the module. `True` by default.
103
-
104
- <!-- CONTRIBUTING -->
105
- ## Contributing
106
-
107
- Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
108
-
109
- 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".
110
- Don't forget to give the project a star! Thanks again!
111
-
112
- 1. Fork the Project
113
- 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
114
- 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
115
- 4. Push to the Branch (`git push origin feature/AmazingFeature`)
116
- 5. Open a Pull Request
117
-
118
-
119
- <!-- LICENSE -->
120
- ## License
121
-
122
- Distributed under the MIT License. See `LICENSE.txt` for more information.
123
-
124
- <!-- CONTACT -->
125
- ## Contact
126
-
127
- Oliver Trajceski - [LinkedIn](https://mk.linkedin.com/in/oliver-trajceski-8a28b070) - oliver@akrinum.com
128
-
129
- Project Link: [https://github.com/schnapsterdog/nuxt-chatgpt](https://github.com/schnapsterdog/nuxt-chatgpt)
130
-
131
- ## Development
132
-
133
- ```bash
134
- # Install dependencies
135
- npm install
136
-
137
- # Generate type stubs
138
- npm run dev:prepare
139
-
140
- # Develop with the playground
141
- npm run dev
142
-
143
- # Build the playground
144
- npm run dev:build
145
-
146
- # Run ESLint
147
- npm run lint
148
-
149
- # Run Vitest
150
- npm run test
151
- npm run test:watch
152
-
153
- # Release new version
154
- npm run release
155
- ```
156
-
157
-
158
- <!-- ACKNOWLEDGMENTS -->
159
- ## Acknowledgments
160
-
161
- 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!
162
-
163
- * [Choose an Open Source License](https://choosealicense.com)
164
- * [Img Shields](https://shields.io)
165
- * [GitHub Pages](https://pages.github.com)
166
-
167
- <!-- MARKDOWN LINKS & IMAGES -->
168
- <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
169
- [contributors-shield]: https://img.shields.io/github/contributors/schnapsterdog/nuxt-chatgpt.svg?style=for-the-badge
170
- [contributors-url]: https://github.com/schnapsterdog/nuxt-chatgpt/graphs/contributors
171
- [downloads-shield]: https://img.shields.io/npm/dw/nuxt-chatgpt.svg?style=for-the-badge
172
- [downloads-url]: https://www.npmjs.com/package/nuxt-chatgpt
173
- [stars-shield]: https://img.shields.io/github/stars/nuxt-chatgpt.svg?style=for-the-badge
174
- [stars-url]: https://github.com/schnapsterdog/nuxt-chatgpt/stargazers
175
- [issues-shield]: https://img.shields.io/github/issues/schnapsterdog/nuxt-chatgpt.svg?style=for-the-badge
176
- [issues-url]: https://github.com/schnapsterdog/nuxt-chatgpt/issues
177
- [license-shield]: https://img.shields.io/github/license/schnapsterdog/nuxt-chatgpt.svg?style=for-the-badge
178
- [license-url]: https://github.com/schnapsterdog/nuxt-chatgpt/blob/master/LICENSE.txt
179
- [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
180
- [linkedin-url]: https://mk.linkedin.com/in/oliver-trajceski-8a28b070
181
- [Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
182
- [Vue-url]: https://vuejs.org/
1
+ <!-- PROJECT LOGO -->
2
+ <br />
3
+ <div>
4
+ <h1>Nuxt Chatgpt</h3>
5
+ <img src="images/chatgpt-logo.png" alt="Logo">
6
+
7
+ > [ChatGPT](https://openai.com/) integration for [Nuxt 3](https://nuxt.com).
8
+
9
+ [![npm version][npm-version-src]][npm-version-href]
10
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
11
+ [![License][license-src]][license-href]
12
+ </div>
13
+ <br />
14
+
15
+ ## About the module
16
+
17
+ This user-friendly module boasts of an easy integration process that enables seamless implementation into any [Nuxt 3](https://nuxt.com) project. With type-safe integration, you can integrate [ChatGPT](https://openai.com/) into your [Nuxt 3](https://nuxt.com) project without breaking a <b>sweat</b>. Enjoy easy access to the `send` method through the `useChatgpt()` composable. Additionally, the module guarantees <b><i>security</i></b> as requests are routed through a [Nitro Server](https://nuxt.com/docs/guide/concepts/server-engine), thus preventing the exposure of your <b>API Key</b>.
18
+
19
+ ## Features
20
+
21
+ - 💪 &nbsp; Easy implementation into any [Nuxt 3](https://nuxt.com) project.
22
+ - 👉 &nbsp; Type-safe integration of Chatgpt into your [Nuxt 3](https://nuxt.com) project.
23
+ - 🕹️ &nbsp; Provides a `useChatgpt()` composable that grants easy access to the `send` method.
24
+ - 🔥 &nbsp; Ensures security by routing requests through a [Nitro Server](https://nuxt.com/docs/guide/concepts/server-engine), preventing the <b>API Key</b> from being exposed.
25
+ - 🧱 &nbsp; It is lightweight and performs well.
26
+
27
+ ## Getting Started
28
+
29
+ 1. Add nuxt-chatgpt dependency to your project
30
+ * npm
31
+ ```sh
32
+ npm install --save-dev nuxt-chatgpt
33
+ ```
34
+ * pnpm
35
+ ```sh
36
+ pnpm add -D nuxt-chatgpt
37
+ ```
38
+ * yarn
39
+ ```sh
40
+ yarn add --dev nuxt-chatgpt
41
+ ```
42
+ 2. Add nuxt-chatgpt to the modules section of nuxt.config.ts
43
+
44
+ ```js
45
+ export default defineNuxtConfig({
46
+ modules: ["nuxt-chatgpt"],
47
+
48
+ // entirely optional
49
+ chatgpt: {
50
+ apiKey: 'Your apiKey here goes here'
51
+ },
52
+ })
53
+ ```
54
+ That's it! You can now use Nuxt Chatgpt in your Nuxt app 🔥
55
+
56
+ ## Example & Usage
57
+
58
+ 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:
59
+
60
+ - `message`: a string representing the text message that you want to send to the GPT-3 model for processing.
61
+ - `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.
62
+
63
+ ```js
64
+ const { send } = useChatgpt()
65
+
66
+ const data = ref('')
67
+ const message = ref('')
68
+
69
+ async function sendMessage() {
70
+ const response = await send(message.value)
71
+ data.value = response
72
+ }
73
+
74
+ ```
75
+
76
+ ```html
77
+ <template>
78
+ <div>
79
+ <input v-model="message">
80
+ <button
81
+ @click="sendMessage"
82
+ v-text="'Send'"
83
+ />
84
+ <div>{{ data }}</div>
85
+ </div>
86
+ </template>
87
+ ```
88
+
89
+ ## Module Options
90
+
91
+ | Name | Type | Default | Description |
92
+ |--|--|--|--|
93
+ |**apiKey**|`String`|`xxxxxx`|Your apiKey here goes here
94
+ |**isEnabled**|`Boolean`|`true`| Enable or disable the module. `True` by default.
95
+
96
+ <!-- CONTRIBUTING -->
97
+ ## Contributing
98
+
99
+ Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
100
+
101
+ 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".
102
+ Don't forget to give the project a star! Thanks again!
103
+
104
+ 1. Fork the Project
105
+ 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
106
+ 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
107
+ 4. Push to the Branch (`git push origin feature/AmazingFeature`)
108
+ 5. Open a Pull Request
109
+
110
+
111
+ <!-- LICENSE -->
112
+ ## License
113
+
114
+ Distributed under the MIT License. See `LICENSE.txt` for more information.
115
+
116
+ <!-- CONTACT -->
117
+ ## Contact
118
+
119
+ Oliver Trajceski - [LinkedIn](https://mk.linkedin.com/in/oliver-trajceski-8a28b070) - oliver@akrinum.com
120
+
121
+ Project Link: [https://github.com/schnapsterdog/nuxt-chatgpt](https://github.com/schnapsterdog/nuxt-chatgpt)
122
+
123
+ ## Development
124
+
125
+ ```bash
126
+ # Install dependencies
127
+ npm install
128
+
129
+ # Generate type stubs
130
+ npm run dev:prepare
131
+
132
+ # Develop with the playground
133
+ npm run dev
134
+
135
+ # Build the playground
136
+ npm run dev:build
137
+
138
+ # Run ESLint
139
+ npm run lint
140
+
141
+ # Run Vitest
142
+ npm run test
143
+ npm run test:watch
144
+
145
+ # Release new version
146
+ npm run release
147
+ ```
148
+
149
+
150
+ <!-- ACKNOWLEDGMENTS -->
151
+ ## Acknowledgments
152
+
153
+ 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!
154
+
155
+ * [Choose an Open Source License](https://choosealicense.com)
156
+ * [Img Shields](https://shields.io)
157
+ * [GitHub Pages](https://pages.github.com)
158
+
159
+ <!-- MARKDOWN LINKS & IMAGES -->
160
+ <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
161
+ [contributors-shield]: https://img.shields.io/github/contributors/schnapsterdog/nuxt-chatgpt.svg?style=for-the-badge
162
+ [contributors-url]: https://github.com/schnapsterdog/nuxt-chatgpt/graphs/contributors
163
+ [downloads-shield]: https://img.shields.io/npm/dw/nuxt-chatgpt.svg?style=for-the-badge
164
+ [downloads-url]: https://www.npmjs.com/package/nuxt-chatgpt
165
+ [stars-shield]: https://img.shields.io/github/stars/nuxt-chatgpt.svg?style=for-the-badge
166
+ [stars-url]: https://github.com/schnapsterdog/nuxt-chatgpt/stargazers
167
+ [issues-shield]: https://img.shields.io/github/issues/schnapsterdog/nuxt-chatgpt.svg?style=for-the-badge
168
+ [issues-url]: https://github.com/schnapsterdog/nuxt-chatgpt/issues
169
+ [license-shield]: https://img.shields.io/github/license/schnapsterdog/nuxt-chatgpt.svg?style=for-the-badge
170
+ [license-url]: https://github.com/schnapsterdog/nuxt-chatgpt/blob/master/LICENSE.txt
171
+ [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=555
172
+ [linkedin-url]: https://mk.linkedin.com/in/oliver-trajceski-8a28b070
173
+ [Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge&logo=vuedotjs&logoColor=4FC08D
174
+ [Vue-url]: https://vuejs.org/
175
+
176
+ [npm-version-src]: https://img.shields.io/npm/v/nuxt-chatgpt/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
177
+ [npm-version-href]: https://npmjs.com/package/nuxt-chatgpt
178
+ [npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-chatgpt.svg?style=flat&colorA=18181B&colorB=28CF8D
179
+ [npm-downloads-href]: https://npmjs.com/package/nuxt-chatgpt
180
+ [license-src]: https://img.shields.io/npm/l/nuxt-chatgpt.svg?style=flat&colorA=18181B&colorB=28CF8D
181
+ [license-href]: https://npmjs.com/package/nuxt-chatgpt
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.4"
7
+ "version": "0.1.7"
8
8
  }
package/dist/module.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { fileURLToPath } from 'url';
2
2
  import { defineNuxtModule, createResolver, addImportsDir, addServerHandler } from '@nuxt/kit';
3
+ import { defu } from 'defu';
3
4
 
4
5
  const configKey = "chatgpt";
5
6
  const moduleName = "nuxt-chatgpt";
@@ -26,14 +27,14 @@ const module = defineNuxtModule({
26
27
  if (!options.isEnabled) {
27
28
  return console.warn(`[${moduleName}] module is disabled and will not be loaded.`);
28
29
  }
29
- nuxt.options.runtimeConfig.public[configKey] = {
30
+ nuxt.options.runtimeConfig[configKey] = defu(nuxt.options.runtimeConfig[configKey], {
30
31
  apiKey: options.apiKey
31
- };
32
+ });
32
33
  addImportsDir(resolve("./runtime/composables"));
33
34
  addServerHandler({
34
- route: "/api/chatgpt",
35
+ route: "/api/openai",
35
36
  method: "post",
36
- handler: resolve(runtimeDir, "server/api/chatgpt")
37
+ handler: resolve(runtimeDir, "server/api/openai")
37
38
  });
38
39
  nuxt.options.build.transpile.push(runtimeDir);
39
40
  }
@@ -1,12 +1,10 @@
1
1
  import { createError } from "h3";
2
- import { getBody, getHeaders } from "../utils/index.mjs";
3
2
  export const useChatgpt = () => {
4
3
  const send = async (message) => {
5
4
  try {
6
- return await $fetch("/api/chatgpt", {
5
+ return await $fetch("/api/openai", {
7
6
  method: "POST",
8
- headers: getHeaders(),
9
- body: getBody(message)
7
+ body: message
10
8
  });
11
9
  } catch (error) {
12
10
  throw createError({
@@ -4,7 +4,7 @@ import { useRuntimeConfig } from "#imports";
4
4
  export default defineEventHandler(async (event) => {
5
5
  const { prompt } = await readBody(event);
6
6
  const configuration = new Configuration({
7
- apiKey: useRuntimeConfig().public.chatgpt.apiKey
7
+ apiKey: useRuntimeConfig().chatgpt.apiKey
8
8
  });
9
9
  const openai = new OpenAIApi(configuration);
10
10
  try {
@@ -21,7 +21,7 @@ export default defineEventHandler(async (event) => {
21
21
  } catch (error) {
22
22
  throw createError({
23
23
  statusCode: 500,
24
- message: "Failed to forward request to ChatGPT API"
24
+ message: "Failed to forward request to OpenAI API"
25
25
  });
26
26
  }
27
27
  });
package/package.json CHANGED
@@ -1,69 +1,70 @@
1
- {
2
- "name": "nuxt-chatgpt",
3
- "version": "0.1.4",
4
- "description": "ChatGPT integration for Nuxt 3",
5
- "license": "MIT",
6
- "type": "module",
7
- "homepage": "https://vuemadness.com.com/nuxt-chatgpt",
8
- "bugs": {
9
- "url": "https://github.com/schnapsterdog/nuxt-chatgpt/issues"
10
- },
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/schnapsterdog/nuxt-chatgpt"
14
- },
15
- "contributors": [
16
- {
17
- "name": "Oliver Trajceski (@schnapsterdog)"
18
- }
19
- ],
20
- "author": {
21
- "name": "Oliver Trajceski",
22
- "email": "oliver@akrinum.com"
23
- },
24
- "keywords": [
25
- "vue3",
26
- "nuxt3",
27
- "nuxt",
28
- "nuxt.js",
29
- "nuxt-chatgpt"
30
- ],
31
- "exports": {
32
- ".": {
33
- "types": "./dist/types.d.ts",
34
- "import": "./dist/module.mjs",
35
- "require": "./dist/module.cjs"
36
- }
37
- },
38
- "main": "./dist/module.cjs",
39
- "types": "./dist/types.d.ts",
40
- "files": [
41
- "dist"
42
- ],
43
- "scripts": {
44
- "prepack": "nuxt-module-build",
45
- "dev": "nuxi dev playground",
46
- "dev:build": "nuxi build playground",
47
- "dev:generate": "nuxi generate playground",
48
- "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
49
- "dev:preview": "nuxi preview playground",
50
- "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
51
- "lint": "eslint .",
52
- "test": "vitest run",
53
- "test:watch": "vitest watch"
54
- },
55
- "dependencies": {
56
- "@nuxt/kit": "^3.2.3",
57
- "openai": "^3.2.1"
58
- },
59
- "devDependencies": {
60
- "@nuxt/eslint-config": "^0.1.1",
61
- "@nuxt/module-builder": "^0.2.1",
62
- "@nuxt/schema": "^3.2.3",
63
- "@nuxt/test-utils": "^3.2.3",
64
- "changelogen": "^0.5.1",
65
- "eslint": "^8.36.0",
66
- "nuxt": "^3.2.3",
67
- "vitest": "^0.29.2"
68
- }
69
- }
1
+ {
2
+ "name": "nuxt-chatgpt",
3
+ "version": "0.1.7",
4
+ "description": "ChatGPT integration for Nuxt 3",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "homepage": "https://vuemadness.com.com/nuxt-chatgpt",
8
+ "bugs": {
9
+ "url": "https://github.com/schnapsterdog/nuxt-chatgpt/issues"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/schnapsterdog/nuxt-chatgpt"
14
+ },
15
+ "contributors": [
16
+ {
17
+ "name": "Oliver Trajceski (@schnapsterdog)"
18
+ }
19
+ ],
20
+ "author": {
21
+ "name": "Oliver Trajceski",
22
+ "email": "oliver@akrinum.com"
23
+ },
24
+ "keywords": [
25
+ "vue3",
26
+ "nuxt3",
27
+ "nuxt",
28
+ "nuxt.js",
29
+ "nuxt-chatgpt"
30
+ ],
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/types.d.ts",
34
+ "import": "./dist/module.mjs",
35
+ "require": "./dist/module.cjs"
36
+ }
37
+ },
38
+ "main": "./dist/module.cjs",
39
+ "types": "./dist/types.d.ts",
40
+ "files": [
41
+ "dist"
42
+ ],
43
+ "scripts": {
44
+ "prepack": "nuxt-module-build",
45
+ "dev": "nuxi dev playground",
46
+ "dev:build": "nuxi build playground",
47
+ "dev:generate": "nuxi generate playground",
48
+ "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
49
+ "dev:preview": "nuxi preview playground",
50
+ "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
51
+ "lint": "eslint .",
52
+ "test": "vitest run",
53
+ "test:watch": "vitest watch"
54
+ },
55
+ "dependencies": {
56
+ "@nuxt/kit": "^3.1.1",
57
+ "openai": "^3.2.1",
58
+ "defu": "^6.1.2"
59
+ },
60
+ "devDependencies": {
61
+ "@nuxt/eslint-config": "^0.1.1",
62
+ "@nuxt/module-builder": "^0.2.1",
63
+ "@nuxt/schema": "^3.1.1",
64
+ "@nuxt/test-utils": "^3.1.1",
65
+ "changelogen": "^0.4.1",
66
+ "eslint": "^8.32.0",
67
+ "nuxt": "^3.1.1",
68
+ "vitest": "^0.28.2"
69
+ }
70
+ }
@@ -1,3 +0,0 @@
1
- import type { IHeaders, IMessage } from "../types";
2
- export declare const getBody: (message: IMessage) => string;
3
- export declare const getHeaders: () => IHeaders;
@@ -1,8 +0,0 @@
1
- export const getBody = (message) => {
2
- return JSON.stringify({ prompt: message });
3
- };
4
- export const getHeaders = () => {
5
- return {
6
- "Content-Type": "application/json"
7
- };
8
- };