{'a.name': 'Val Kilmer'},     {'a.name': 'Anthony Edwards'},     {'a.name': 'Meg Ryan'}]Add examples in the Cypher generation prompt‚ÄãYou can define the Cypher statement you want the LLM to generate for particular questionsfrom langchain.prompts.prompt import PromptTemplateCYPHER_GENERATION_TEMPLATE = """Task:Generate Cypher statement to query a graph database.Instructions:Use only the provided relationship types and properties in the schema.Do not use any other relationship types or properties that are not provided.Schema:{schema}Note: Do not include any explanations or apologies in your responses.Do not respond to any questions that might ask anything else than for you to construct a Cypher statement.Do not include any text except the generated Cypher statement.Examples: Here are a few examples of generated Cypher statements for particular questions:# How many people played in Top Gun?MATCH (m:Movie {{title:"Top Gun"}})<-[:ACTED_IN]-()RETURN count(*) AS numberOfActorsThe question is:{question}"""CYPHER_GENERATION_PROMPT = PromptTemplate(    input_variables=["schema", "question"], template=CYPHER_GENERATION_TEMPLATE)chain = GraphCypherQAChain.from_llm(    ChatOpenAI(temperature=0), graph=graph, verbose=True, cypher_prompt=CYPHER_GENERATION_PROMPT)chain.run("How many people played in Top Gun?")            > Entering new GraphCypherQAChain chain...    Generated Cypher:    MATCH (m:Movie {name:"Top Gun"})<-[:ACTED_IN]-(:Actor)    RETURN count(*) AS numberOfActors    Full Context:    [{'numberOfActors': 4}]        > Finished chain.    'Four people played in Top Gun.'Use separate LLMs for Cypher and answer generation‚ÄãYou can use the cypher_llm and qa_llm parameters to define different llmschain = GraphCypherQAChain.from_llm(     graph=graph,     cypher_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo"),     qa_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo-16k"),     verbose=True,)chain.run("Who played in Top Gun?")            > Entering new
This notebook shows how to use LLMs to provide a natural language interface to a graph database you can query with the Cypher query language.
This notebook shows how to use LLMs to provide a natural language interface to a graph database you can query with the Cypher query language. ->: {'a.name': 'Val Kilmer'},     {'a.name': 'Anthony Edwards'},     {'a.name': 'Meg Ryan'}]Add examples in the Cypher generation prompt‚ÄãYou can define the Cypher statement you want the LLM to generate for particular questionsfrom langchain.prompts.prompt import PromptTemplateCYPHER_GENERATION_TEMPLATE = """Task:Generate Cypher statement to query a graph database.Instructions:Use only the provided relationship types and properties in the schema.Do not use any other relationship types or properties that are not provided.Schema:{schema}Note: Do not include any explanations or apologies in your responses.Do not respond to any questions that might ask anything else than for you to construct a Cypher statement.Do not include any text except the generated Cypher statement.Examples: Here are a few examples of generated Cypher statements for particular questions:# How many people played in Top Gun?MATCH (m:Movie {{title:"Top Gun"}})<-[:ACTED_IN]-()RETURN count(*) AS numberOfActorsThe question is:{question}"""CYPHER_GENERATION_PROMPT = PromptTemplate(    input_variables=["schema", "question"], template=CYPHER_GENERATION_TEMPLATE)chain = GraphCypherQAChain.from_llm(    ChatOpenAI(temperature=0), graph=graph, verbose=True, cypher_prompt=CYPHER_GENERATION_PROMPT)chain.run("How many people played in Top Gun?")            > Entering new GraphCypherQAChain chain...    Generated Cypher:    MATCH (m:Movie {name:"Top Gun"})<-[:ACTED_IN]-(:Actor)    RETURN count(*) AS numberOfActors    Full Context:    [{'numberOfActors': 4}]        > Finished chain.    'Four people played in Top Gun.'Use separate LLMs for Cypher and answer generation‚ÄãYou can use the cypher_llm and qa_llm parameters to define different llmschain = GraphCypherQAChain.from_llm(     graph=graph,     cypher_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo"),     qa_llm=ChatOpenAI(temperature=0, model="gpt-3.5-turbo-16k"),     verbose=True,)chain.run("Who played in Top Gun?")            > Entering new