Getting CypherSyntaxError and ValueError when running GraphCypherQAChain on Hugginface LLM #17643
Replies: 2 comments
-
🤖 Hey there, @KaifAhmad1! Great to see you back with another intriguing puzzle for us to crack together. 🛠️ The
To debug this issue, you should first check the generated Cypher query and the schema used for validation. If the issue persists, you should check the initialization parameters of the Regarding your question about the role of The The You can find more details in the source code of the GraphCypherQAChain class. I hope this helps! If you have any more questions or need further clarification, feel free to ask. Sources
|
Beta Was this translation helpful? Give feedback.
-
hospital_cypher_chain = GraphCypherQAChain.from_llm( model is ="mistralai/Mistral-7B-Instruct-v0.2" Generate Query , why include "Cypher statment": how can i remove it ,please provie me correct answer My OutPut and Error
Cypher statement: CypherSyntaxError Traceback (most recent call last) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/work/session.py:313, in Session.run(self, query, parameters, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/work/result.py:181, in Result._run(self, query, parameters, db, imp_user, access_mode, bookmarks, notifications_min_severity, notifications_disabled_categories) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/work/result.py:301, in Result._attach(self) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_common.py:178, in ConnectionErrorHandler.getattr..outer..inner(*args, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_bolt.py:850, in Bolt.fetch_message(self) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_bolt5.py:369, in Bolt5x0._process_message(self, tag, fields) File ~/anaconda3/lib/python3.9/site-packages/neo4j/_sync/io/_common.py:245, in Response.on_failure(self, metadata) CypherSyntaxError: {code: Neo.ClientError.Statement.SyntaxError} {message: Invalid input 'statement': expected During handling of the above exception, another exception occurred: ValueError Traceback (most recent call last) File ~/anaconda3/lib/python3.9/site-packages/langchain/chains/base.py:163, in Chain.invoke(self, input, config, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/langchain/chains/base.py:153, in Chain.invoke(self, input, config, **kwargs) File ~/anaconda3/lib/python3.9/site-packages/langchain/chains/graph_qa/cypher.py:268, in GraphCypherQAChain._call(self, inputs, run_manager) File ~/anaconda3/lib/python3.9/site-packages/langchain_community/graphs/neo4j_graph.py:252, in Neo4jGraph.query(self, query, params) ValueError: Generated Cypher Statement is not valid |
Beta Was this translation helpful? Give feedback.
-
Checked other resources
Commit to Help
Example Code
Description
System Info
pip = 24.0
Cuda = 12.1
OS = Windows 11 x64
Beta Was this translation helpful? Give feedback.
All reactions