Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
rschwabco committed May 16, 2023
0 parents commit 7acc02d
Show file tree
Hide file tree
Showing 31 changed files with 15,745 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
OPENAI_API_KEY=
PINECONE_API_KEY=
PINECONE_ENVIRONMENT=
PINECONE_INDEX_NAME=
DATABASE_URL=
ABLY_API_KEY=
API_ROOT=
FINGERPRINTJS_API_KEY=
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.env

./src/development-pinecone.json
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotenv.enableAutocloaking": false
}
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Pinecone Chatbot Demo

To run this demo, you need to have:

1. A Pinecone account. If you don't have one, you can sign up for free at [pinecone.io](https://www.pinecone.io).
2. An OpenAI account. If you don't have one, you can sign up for free at [openai.com](https://www.openai.com).
3. An Ably account. If you don't have one, you can sign up for free at [ably.io](https://www.ably.io).
4. A FingerprintJS account. If you don't have one, you can sign up for free at [fingerprintjs.com](https://www.fingerprintjs.com).
5. A CockroachDB account. If you don't have one, you can sign up for free at [cockroachlabs.com](https://www.cockroachlabs.com).

## Setup

1. Clone this repository

```bash
git clone https://github.com/pinecone-io/chatbot-demo.git
```

2. Install dependencies

```bash
cd chatbot-demo
npm install
```

3. Create your Pinecone, OpenAI, Ably, FingerprintJS and Cockroach accounts and get your API keys

4. Create your Pinecone index

5. Create a `.env` file in the root directory of the project and add your API keys:

```
OPENAI_API_KEY=...
PINECONE_API_KEY=...
PINECONE_ENVIRONMENT=...
PINECONE_INDEX_NAME=...
DATABASE_URL=...
ABLY_API_KEY=...
FINGERPRINTJS_API_KEY=...
API_ROOT="http://localhost:3000"
```

## Start the development server

```bash
npm run dev
```
10 changes: 10 additions & 0 deletions db/dbinit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TYPE speaker AS ENUM ('user', 'ai');

CREATE TABLE conversations (
user_id STRING,
entry STRING,
speaker speaker,
created_at TIMESTAMP PRIMARY KEY NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- DROP TABLE memories;
1 change: 1 addition & 0 deletions globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '*.css';
12 changes: 12 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
env: {
FINGERPRINT: process.env.FINGERPRINTJS_API_KEY,
},
publicRuntimeConfig: {
apiUrl: process.env.API_URL || "http://localhost:3000",
},
};

module.exports = nextConfig;
Loading

0 comments on commit 7acc02d

Please sign in to comment.