Skip to content

Commit

Permalink
Updated to make chatbot work.
Browse files Browse the repository at this point in the history
  • Loading branch information
nswekosk committed Apr 21, 2023
1 parent f1ee996 commit 0ab8d2d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/pinecone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Change the namespace to the namespace on Pinecone you'd like to store your embeddings.
*/

if (!process.env.PINECONE_INDEX_NAME) {
if (!process.env['PINECONE_INDEX_NAME']) {
throw new Error('Missing Pinecone index name in .env file');
}

Expand Down
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function Home() {
}>({
messages: [
{
message: 'Hi, what would you like to learn about this legal case?',
message: 'Hi, ask a question to learn about Nick\'s professional experience',
type: 'apiMessage',
},
],
Expand Down Expand Up @@ -224,7 +224,7 @@ export default function Home() {
placeholder={
loading
? 'Waiting for response...'
: 'What is this legal case about?'
: 'What would you like to know about Nick?'
}
value={query}
onChange={(e) => setQuery(e.target.value)}
Expand Down
3 changes: 2 additions & 1 deletion scripts/ingest-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export const run = async () => {

console.log('creating vector store...');
/*create and store the embeddings in the vectorStore*/
console.log('index name: ', PINECONE_INDEX_NAME);
const embeddings = new OpenAIEmbeddings();
const index = pinecone.Index(PINECONE_INDEX_NAME); //change to your own index name

console.log('fromDocuments...');
//embed the PDF documents
await PineconeStore.fromDocuments(docs, embeddings, {
pineconeIndex: index,
Expand Down

0 comments on commit 0ab8d2d

Please sign in to comment.