Skip to content

Commit

Permalink
Run build, fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacoblee93 committed Oct 13, 2023
1 parent db71227 commit db5a766
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You can find more information on how to setup `Neo4j` on their [website](https:/

import Example from "@examples/indexes/vector_stores/neo4j_vector/neo4j_vector.ts";

One complete example of using `Neo4jVectorIndex` is the following:
One complete example of using `Neo4jVectorStore` is the following:

<CodeBlock language="typescript">{Example}</CodeBlock>

Expand All @@ -45,7 +45,7 @@ import RetrievalExample from "@examples/indexes/vector_stores/neo4j_vector/neo4j

<CodeBlock language="typescript">{RetrievalExample}</CodeBlock>

### Instantiate Neo4jVectorIndex from existing graph
### Instantiate Neo4jVectorStore from existing graph

import ExistingGraphExample from "@examples/indexes/vector_stores/neo4j_vector/neo4j_vector_existinggraph.ts";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { Neo4jVectorIndex } from "langchain/vectorstores/neo4j_vector";
import { Neo4jVectorStore } from "langchain/vectorstores/neo4j_vector";

// Configuration object for Neo4j connection and other related settings
const config = {
Expand All @@ -19,7 +19,7 @@ const documents = [
{ pageContent: "Cat drinks milk", metadata: { a: 1 } },
];

const neo4jVectorIndex = await Neo4jVectorIndex.fromDocuments(
const neo4jVectorIndex = await Neo4jVectorStore.fromDocuments(
documents,
new OpenAIEmbeddings(),
config
Expand All @@ -33,4 +33,4 @@ console.log(results);
[ Document { pageContent: 'Cat drinks milk', metadata: { a: 1 } } ]
*/

await Neo4jVectorIndex.close();
await neo4jVectorIndex.close();
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { Neo4jVectorIndex } from "langchain/vectorstores/neo4j_vector";
import { Neo4jVectorStore } from "langchain/vectorstores/neo4j_vector";

/**
* `fromExistingGraph` Method:
Expand Down Expand Up @@ -27,9 +27,9 @@ const config = {
};

// You should have a populated Neo4j database to use this method
const neo4jVectorIndex = await Neo4jVectorIndex.fromExistingGraph(
const neo4jVectorIndex = await Neo4jVectorStore.fromExistingGraph(
new OpenAIEmbeddings(),
config
);

await Neo4jVectorIndex.close();
await neo4jVectorIndex.close();
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
import { Neo4jVectorIndex } from "langchain/vectorstores/neo4j_vector";
import { Neo4jVectorStore } from "langchain/vectorstores/neo4j_vector";

/*
* The retrievalQuery is a customizable Cypher query fragment used in the Neo4jVectorStore class to define how
Expand Down Expand Up @@ -42,7 +42,7 @@ const documents = [
{ pageContent: "Cat drinks milk", metadata: { a: 1 } },
];

const neo4jVectorIndex = await Neo4jVectorIndex.fromDocuments(
const neo4jVectorIndex = await Neo4jVectorStore.fromDocuments(
documents,
new OpenAIEmbeddings(),
config
Expand All @@ -56,4 +56,4 @@ console.log(results);
[ Document { pageContent: 'Cat drinks milk', metadata: { a: 2 } } ]
*/

await Neo4jVectorIndex.close();
await neo4jVectorIndex.close();
3 changes: 3 additions & 0 deletions langchain/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ vectorstores/pgvector.d.ts
vectorstores/milvus.cjs
vectorstores/milvus.js
vectorstores/milvus.d.ts
vectorstores/neo4j_vector.cjs
vectorstores/neo4j_vector.js
vectorstores/neo4j_vector.d.ts
vectorstores/prisma.cjs
vectorstores/prisma.js
vectorstores/prisma.d.ts
Expand Down
8 changes: 8 additions & 0 deletions langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,9 @@
"vectorstores/milvus.cjs",
"vectorstores/milvus.js",
"vectorstores/milvus.d.ts",
"vectorstores/neo4j_vector.cjs",
"vectorstores/neo4j_vector.js",
"vectorstores/neo4j_vector.d.ts",
"vectorstores/prisma.cjs",
"vectorstores/prisma.js",
"vectorstores/prisma.d.ts",
Expand Down Expand Up @@ -1633,6 +1636,11 @@
"import": "./vectorstores/milvus.js",
"require": "./vectorstores/milvus.cjs"
},
"./vectorstores/neo4j_vector": {
"types": "./vectorstores/neo4j_vector.d.ts",
"import": "./vectorstores/neo4j_vector.js",
"require": "./vectorstores/neo4j_vector.cjs"
},
"./vectorstores/prisma": {
"types": "./vectorstores/prisma.d.ts",
"import": "./vectorstores/prisma.js",
Expand Down
1 change: 1 addition & 0 deletions langchain/src/load/import_constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const optionalImportEntrypoints = [
"langchain/vectorstores/opensearch",
"langchain/vectorstores/pgvector",
"langchain/vectorstores/milvus",
"langchain/vectorstores/neo4j_vector",
"langchain/vectorstores/typeorm",
"langchain/vectorstores/myscale",
"langchain/vectorstores/redis",
Expand Down
3 changes: 3 additions & 0 deletions langchain/src/load/import_type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ export interface OptionalImportMap {
"langchain/vectorstores/milvus"?:
| typeof import("../vectorstores/milvus.js")
| Promise<typeof import("../vectorstores/milvus.js")>;
"langchain/vectorstores/neo4j_vector"?:
| typeof import("../vectorstores/neo4j_vector.js")
| Promise<typeof import("../vectorstores/neo4j_vector.js")>;
"langchain/vectorstores/typeorm"?:
| typeof import("../vectorstores/typeorm.js")
| Promise<typeof import("../vectorstores/typeorm.js")>;
Expand Down
1 change: 1 addition & 0 deletions langchain/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"src/vectorstores/opensearch.ts",
"src/vectorstores/pgvector.ts",
"src/vectorstores/milvus.ts",
"src/vectorstores/neo4j_vector.ts",
"src/vectorstores/prisma.ts",
"src/vectorstores/typeorm.ts",
"src/vectorstores/myscale.ts",
Expand Down

0 comments on commit db5a766

Please sign in to comment.