nuxt-chatgpt 0.1.1 → 0.1.3

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/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.1"
7
+ "version": "0.1.3"
8
8
  }
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("h3").EventHandler<string | undefined>;
2
2
  export default _default;
@@ -1,10 +1,10 @@
1
- import { createError } from "h3";
1
+ import { createError, defineEventHandler } from "h3";
2
2
  import { Configuration, OpenAIApi } from "openai";
3
- const config = useRuntimeConfig();
3
+ 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: config.public.chatgpt.apiKey
7
+ apiKey: useRuntimeConfig().public.chatgpt.apiKey
8
8
  });
9
9
  const openai = new OpenAIApi(configuration);
10
10
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-chatgpt",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "ChatGPT integration for Nuxt 3",
5
5
  "license": "MIT",
6
6
  "type": "module",