Giter VIP home page Giter VIP logo

nuxt-chatgpt's Introduction

Servus 👋 My name is Oliver

CEO · Founder · Software Architect · Senior Front-end Developer · Open Sourcer · Mentor · Jamstack

  • 🌍  I'm based in Ohrid, Macedonia
  • ✉️  You can contact me at [email protected]
  • 🤝  I'm open to collaborating on interesting projects as a developer
  • ⚡  I am proud father, dogs owner, beer lover and punk rocker

Hello, I'm Oliver, the CEO and Founder, as well as a Senior Full-stack developer at Akrinum OÜ‬. I specialize in creating powerful, responsive, and modern Single Page Applications (SPA), Static Site Generators (SSG), and Server-Side Rendered (SSR) applications, from development to production.

My expertise lies in Front-end technologies such as Vue.js, Nuxt.js, and other custom Vue-based frameworks, as well as Back-end technologies such as Laravel, CodeIgniter, and various headless CMS platforms like Prismic CMS, FlexiCMS, PyroCMS, and Strapi.

In 2020, I created IMG Force, a global platform that enables users to upload images quickly and provides real-time optimization. I am also a co-author of Discover Ohrid, the first interactive travel guide that accompanies travelers in their journey to discover Ohrid - The City of Light, available on [Google Play](Discover Ohrid) and [Apple Store](Discover Ohrid).

At the end of 2022, I developed vue-marquee-slider, a component for Vue that allows users to create customizable marquees with just a few lines of code. This simple and user-friendly tool is easy to use and can be customized to fit the needs of any project. At the beginning of 2023 I worked and created vue-preloader, The Ultimate Solution for Fast Loading Screens.

Recently I created nuxt-chatgpt, a Nuxt 3 module for ChatGPT integration.

Additionally, I am actively developing various nuxt.js modules as I am passionate about making the web a better place. I am always looking for new and innovative ways to achieve this goal, so please do not hesitate to contact me if you want to learn more about my current projects.

nuxt-chatgpt's People

Contributors

abdelh2o avatar danielroe avatar schnapsterdog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nuxt-chatgpt's Issues

Exposed API Routes

While routing all of the requests through the nitro server does a great job of keeping our API keys private, it also has a potentially unintended effect for some users.

If your intended Chat GPT user interface component is behind authentication (because who wants to expose unlimited use of your api key to the public?) the routes that are exposed with this module are always public.

I could be missing some intended configuration for this use-case, but as far as I can tell the routes /api/chat and /api/chat-completion are always exposed to the internet. Again, this could be intended functionality, I just wanted to make sure that this was not a bug. For my particular uses, I will have to remove this module for this reason.

Thank you for the great work and contribution nonetheless!

Why the apiKey not stored in runtimeConfig object?

The docs state:

// entirely optional
  chatgpt: {
    apiKey: 'Your apiKey here goes here'
  },

Wouldn't you want to reference the key within the runtimeConfig property like so?

	runtimeConfig: {
		OPENAI_API_KEY: "" //<---- would be copied form an `.env` file
	},

Chatcompletion array of messages

Hi,
your project is awesome and it works great with almost no effort :)

Nevertheless I would suggest to change the interface of the chatCompletion function:

const chatCompletion = async (message: IMessage, model?: IModel, options?: IOptions)

to

const chatCompletion = async (messages: IMessages, model?: IModel, options?: IOptions)

or something similar :)

According to openAI API specification, chatCompletions can be configured with a set of messages:

const response = await openai.chat.completions.create({
model: "gpt-3.5-turbo",
messages: [{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Who won the world series in 2020?"},
{"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
{"role": "user", "content": "Where was it played?"}],
});

This change would allow to implement easily use cases such as the "Socratic Tutor" https://platform.openai.com/examples/default-socratic-tutor.

All the best,
Mauro

Feedback

This looks amazing! A couple of points to mention, in case you find it helpful:

  1. You do not need to stringify the body of $fetch requests, or set content-type. This will be done automatically.

  2. Because you set the public key of runtimeConfig, the user's API key is exposed to the client.

    ⚠️ This should probably be fixed as a matter of urgency.

    https://github.com/SchnapsterDog/nuxt-chatgpt/blob/master/src/module.ts#L50C5-L52. (You just need to update that same line to remove public.)

Prompt not properly parsed in the endpoint

Expected Behavior

  • A response related to the prompt the user provides.

Actual Behavior

  • A totally random response.

Steps to Reproduce the Problem

Basically use the library by making a simple request according to their example.

Specifications

  • Version: 0.1.8
  • Platform: MacOS
  • Subsystem: Unix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.