# llm = ChatGoogleGenerativeAI( # model="gemini-1.5-pro", # temperature=0, # max_tokens=None, # timeout=None, # max_retries=2, # api_key=api_key # ) CYPHER_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. Return every node as whole, do not return only the properties. The question is: {question}""" CYPHER_GENERATION_PROMPT = PromptTemplate( input_variables=["schema", "question"], template=CYPHER_GENERATION_TEMPLATE ) chain = GraphCypherQAChain.from_llm( llm, graph=graph, verbose=True, allow_dangerous_requests=True, return_intermediate_steps=True, cypher_prompt=CYPHER_GENERATION_PROMPT )