-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
149 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
NEO4J_URI=bolt://3xxx | ||
NEO4J_USERNAME=neo4j | ||
NEO4J_PASSWORD=xxxx |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
from langchain_experimental.graph_transformers import LLMGraphTransformer | ||
from langchain_openai import ChatOpenAI | ||
from langchain_community.graphs import Neo4jGraph | ||
from genScript import genText | ||
from dotenv import load_dotenv | ||
load_dotenv() | ||
llm=ChatOpenAI(model="gpt-4o") | ||
llm_transformer=LLMGraphTransformer(llm=llm) | ||
graph=Neo4jGraph() | ||
documents=genText("https://www.youtube.com/watch?v=HxTNuGnYZWM") | ||
graph_documents=llm_transformer.convert_to_graph_documents(documents) | ||
# print(f"Nodes:{graph_documents[0].nodes}") | ||
# print(f"Nodes:{graph_documents[0].relationships}") | ||
graph.add_graph_documents(graph_documents) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from langchain_community.document_loaders import YoutubeLoader | ||
|
||
def genText(url): | ||
loader=YoutubeLoader.from_youtube_url(url) | ||
docs=loader.load() | ||
return docs | ||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.