neo4j as a custom tool #2398
ernesttan1976
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
import { Neo4jGraph } from "@langchain/community/graphs/neo4j_graph";
import { OpenAI } from "@langchain/openai";
import { GraphCypherQAChain } from "langchain/chains/graph_qa/cypher";
/**
*/
const url = "neo4j://localhost:7687";
const username = "neo4j";
const password = "password";
const graph = await Neo4jGraph.initialize({ url, username, password });
const model = new OpenAI({ temperature: 0 });
const chain = GraphCypherQAChain.fromLLM({
llm: model,
graph,
});
const res = await chain.run($query);
console.log(res);
return res
I added this tool with the above JS code. But it is not calling the function at all. Please advise? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions