Skip to content

josh-sanger/editions-gpt

 
 

Repository files navigation

Editions GPT

A context-loaded chat assistant for answering questions about Editions Winter ’23 using OpenAI's gpt-3.5-turbo API.

Screenshot 2023-03-28 at 3 48 26 PM

Getting started

  1. Clone or fork the repo
  2. Run npm i
  3. Create an .env file in root and add your Open AI API key to it (this file is not tracked) and add your Pinecone index URL and API key
OPENAI_API_KEY=superSecretAPIKey
PINECONE_INDEX_URL=indexURL
PINECONE_API_KEY=superSecretAPIKey
  1. Run npm run dev
  2. Open in your browser http://localhost:3000/
  3. Start playing with the context you wish to add in /app/context/index.ts

Under the hood

This is build using Remix (a react based framework), Typescript, and uses TailwindCSS for styling. Some key notes:

  • Pages can be found under /app/routes
  • Custom styling can be found in /app/stylesheets and can be added in the /app/root.tsx file in the links() function
  • Context for the chat interaction should be stored in /app/context/index.ts and should follow the data format for messages (role, content)
  • This is using the Toolformer modal to decide when it needs to fetch data about products
  • This is using Pinecone.io as the embeddings vector DB
  • To generate the embeddings vector JSON visit http://localhost:3000/endpoints/generate. You can then use the file to upsert into the DB

Deployment

This repo was set up to deploy to Vercel as the main deplopyment source but you can customize it if you wish to suit your needs.

Feedback

Would love to hear some feedback. Please feel free to open issues or hit me up on Twitter.

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.3%
  • JavaScript 7.4%
  • CSS 3.3%