npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

strapi-plugin-open-ai-embeddings

v1.0.10

Published

Create embeddings with LangChain, Open Ai and Pinecone.

Downloads

13

Readme

Strapi Open AI Embeddings Plugin

The Strapi Cloud Content Embedding Plugin is designed to bridge the gap between your Strapi-managed content and your OpenAI chatbot.

By translating your data into meaningful text embedding, this plugin facilitates the delivery of intelligent, context-aware responses by your AI chatbot.

As a result, your AI chatbot gains the ability to comprehend and contextualize user inquiries based on your unique content.

With this plugin, your chatbot will no longer give canned responses. Instead, it becomes a virtual expert on your content, able to answer user questions with the contextual precision and nuance you've always aimed for.

At least, that is the goal.

The plugin is built as a starting point for you to either build on top of via "feature pull request" or clone and build your own variation.

It is entirely open source and is built by me with love and as a learning opportunity.

Feedback and improvements are welcomed.

Make sure to star on Git Hub if you like the effort that I put into it.

Thank you.

With love,

Paul

Set Up Instructions

Before you start, you should have a Strapi project running locally where you would like to install the plugin.

If not, you can check out Getting Started Guide from Strapi's documentation. Otherwise, let's proceed to the next step.

Prerequisites

  • Open AI Account (might be paid)
  • Pinecone Vector Database Account (free)
  • A coffee

Installation

Inside the root of your Strapi project, run the following command:

using npm

  npm install strapi-plugin-open-ai-embeddings

using yarn

  yarn add strapi-plugin-open-ai-embeddings

I will be using yarn in this example.

Within your strapi project, navigate to the config folder and create a plugins.js file unless one already exists and paste the following.

config/plugins.js

module.exports = ({ env }) => ({
  "open-ai-embeddings": {
    enabled: true,
    config: {
      openAiApiKey: env("OPEN_AI_API_KEY"),
      openAiModelName: env("OPEN_AI_MODEL_NAME"),
      pineconeApiKey: env("PINECONE_API_KEY"),
      pineconeApiEnv: env("PINECONE_API_ENV"),
      pineconeIndex: env("PINECONE_INDEX"),
    },
  },
});

Now run the following command:

  yarn build && yarn develop

You should see the following error since we did not add our env variables. Which is a good sign.

  Failed to initialize Pinecone: PineconeError: Failed getting project

Adding Our Env Variables

First, inside the root of your project, navigate to the .env file and add the following variables, which you will replace with your own credentials.

  OPEN_AI_API_KEY=replace
  OPEN_AI_MODEL_NAME=gpt-3.5-turbo
  PINECONE_API_KEY=replace
  PINECONE_API_ENV=replace
  PINECONE_INDEX=replace

Getting Your Open AI Credentials

Go to OpenAI Account Settings and create your API key.

Open AI API Key

Pinecone Vector Database

Go to Pinecone.io and create your free account.

Pinecone Website

Once your account is setup, let's create our first index.

Create Index

  • [ ] Give it a name.
  • [ ] Add dimensions ( has to be 1536 for Open AI)
  • [ ] Use the free Starter Plan
  • [ ] Click Create Index

Once created, you should see the following screen.

API Keys

Now that you have all your credentials, add them inside the .env file inside the root of your Strapi project.

  OPEN_AI_API_KEY=replace
  OPEN_AI_MODEL_NAME=gpt-3.5-turbo
  PINECONE_API_KEY=replace
  PINECONE_API_ENV=replace
  PINECONE_INDEX=replace

Restart your application by running yarn develop.

Create Your First Embedding And Ask Question

Create Embedding

Plugin Demo Video

Will come soon