Godfather Coda: The Death of Michael Corleone");INSERT EDGE acted_in() VALUES "Al Pacino"->"The Godfather II":();INSERT EDGE acted_in() VALUES "Al Pacino"->"The Godfather Coda: The Death of Michael Corleone":();    UsageError: Cell magic `%%ngql` not found.from langchain.chat_models import ChatOpenAIfrom langchain.chains import NebulaGraphQAChainfrom langchain.graphs import NebulaGraphgraph = NebulaGraph(    space="langchain",    username="root",    password="nebula",    address="127.0.0.1",    port=9669,    session_pool_size=30,)Refresh graph schema information‚ÄãIf the schema of database changes, you can refresh the schema information needed to generate nGQL statements.# graph.refresh_schema()print(graph.get_schema)    Node properties: [{'tag': 'movie', 'properties': [('name', 'string')]}, {'tag': 'person', 'properties': [('name', 'string'), ('birthdate', 'string')]}]    Edge properties: [{'edge': 'acted_in', 'properties': []}]    Relationships: ['(:person)-[:acted_in]->(:movie)']    Querying the graph‚ÄãWe can now use the graph cypher QA chain to ask question of the graphchain = NebulaGraphQAChain.from_llm(    ChatOpenAI(temperature=0), graph=graph, verbose=True)chain.run("Who played in The Godfather II?")            > Entering new NebulaGraphQAChain chain...    Generated nGQL:    MATCH (p:`person`)-[:acted_in]->(m:`movie`) WHERE m.`movie`.`name` == 'The Godfather II'    RETURN p.`person`.`name`    Full Context:    {'p.person.name': ['Al Pacino']}        > Finished chain.    'Al Pacino played in The Godfather II.'PreviousMemgraph QA chainNextNetworkX Graph QARefresh graph schema informationQuerying the graphCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
This notebook shows how to use LLMs to provide a natural language interface to NebulaGraph database.
This notebook shows how to use LLMs to provide a natural language interface to NebulaGraph database. ->: Godfather Coda: The Death of Michael Corleone");INSERT EDGE acted_in() VALUES "Al Pacino"->"The Godfather II":();INSERT EDGE acted_in() VALUES "Al Pacino"->"The Godfather Coda: The Death of Michael Corleone":();    UsageError: Cell magic `%%ngql` not found.from langchain.chat_models import ChatOpenAIfrom langchain.chains import NebulaGraphQAChainfrom langchain.graphs import NebulaGraphgraph = NebulaGraph(    space="langchain",    username="root",    password="nebula",    address="127.0.0.1",    port=9669,    session_pool_size=30,)Refresh graph schema information‚ÄãIf the schema of database changes, you can refresh the schema information needed to generate nGQL statements.# graph.refresh_schema()print(graph.get_schema)    Node properties: [{'tag': 'movie', 'properties': [('name', 'string')]}, {'tag': 'person', 'properties': [('name', 'string'), ('birthdate', 'string')]}]    Edge properties: [{'edge': 'acted_in', 'properties': []}]    Relationships: ['(:person)-[:acted_in]->(:movie)']    Querying the graph‚ÄãWe can now use the graph cypher QA chain to ask question of the graphchain = NebulaGraphQAChain.from_llm(    ChatOpenAI(temperature=0), graph=graph, verbose=True)chain.run("Who played in The Godfather II?")            > Entering new NebulaGraphQAChain chain...    Generated nGQL:    MATCH (p:`person`)-[:acted_in]->(m:`movie`) WHERE m.`movie`.`name` == 'The Godfather II'    RETURN p.`person`.`name`    Full Context:    {'p.person.name': ['Al Pacino']}        > Finished chain.    'Al Pacino played in The Godfather II.'PreviousMemgraph QA chainNextNetworkX Graph QARefresh graph schema informationQuerying the graphCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.