Skip to content

Commit c326101

Browse files
committed
fix-cypher-history
1 parent 6154797 commit c326101

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

api/prompts.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,21 @@
6666
- If it is relevant, incorporate necessary information from it into the query.
6767
- If it is not relevant, generate the query solely based on the current question.
6868
- Use **only** the entities, relationship types, and properties specified in the ontology.
69-
- **Pay attention to property data types as defined in the ontology:**
70-
- Use list functions for list properties.
71-
- Avoid unnecessary splitting of properties.
72-
- Ensure relationships are correctly directed; arrows should point from the **source** to the **target**.
73-
- If you cannot generate a valid OpenCypher statement for any reason, return an empty string.
69+
- **Relationship Types:**
70+
- Specify relationship types when required.
71+
- If any relationship type is acceptable, you can omit it by using `[*]`.
72+
- **Node Property Matching:**
73+
- Specify node properties within the `MATCH` clause or using a `WHERE` clause.
74+
- Use a `WHERE` clause when matching multiple node properties or for clarity.
75+
- **UNWIND Clause:**
76+
- Use `UNWIND` to expand a list into individual rows when you need to return individual node properties from a path.
77+
- Do **not** split **string properties** properties; they are already lists.
78+
- Ensure relationships are correctly directed; arrows should always point from the **source** to the **target**.
79+
- Verify that your Cypher query is valid and correct any errors.
80+
- Extract only the attributes relevant to the question.
81+
- If you cannot generate a valid OpenCypher statement for any reason, return an empty response.
7482
- Output the Cypher statement enclosed in triple backticks.
7583
76-
7784
**Last Answer:** {last_answer}
7885
7986
**Question:** {question}

0 commit comments

Comments
 (0)