Skip to main content

Neptune Open Cypher QA Chain(海王星Open Cypher QA链)

该QA链使用openCypher查询Neptune图数据库,并返回可读的响应。

from langchain.graphs import NeptuneGraph


host = "<neptune-host>"
port = 8182
use_https = True

graph = NeptuneGraph(host=host, port=port, use_https=use_https)
from langchain.chat_models import ChatOpenAI
from langchain.chains import NeptuneOpenCypherQAChain

llm = ChatOpenAI(temperature=0, model="gpt-4")

chain = NeptuneOpenCypherQAChain.from_llm(llm=llm, graph=graph)

chain.run("how many outgoing routes does the Austin airport have?")
    '奥斯汀机场有98条出站航线。'