mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-06 05:08:20 +00:00
chore: NebulaGraph prompt optmization (#6904)
Was preparing for a demo project of NebulaGraphQAChain to find out the prompt needed to be optimized a little bit. Please @hwchase17 kindly help review. Thanks!
This commit is contained in:
parent
0ba175e13f
commit
1c66aa6d56
@ -53,15 +53,16 @@ NEBULAGRAPH_EXTRA_INSTRUCTIONS = """
|
|||||||
Instructions:
|
Instructions:
|
||||||
|
|
||||||
First, generate cypher then convert it to NebulaGraph Cypher dialect(rather than standard):
|
First, generate cypher then convert it to NebulaGraph Cypher dialect(rather than standard):
|
||||||
1. it requires explicit label specification when referring to node properties: v.`Foo`.name
|
1. it requires explicit label specification only when referring to node properties: v.`Foo`.name
|
||||||
2. it uses double equals sign for comparison: `==` rather than `=`
|
2. note explicit label specification is not needed for edge properties, so it's e.name instead of e.`Bar`.name
|
||||||
|
3. it uses double equals sign for comparison: `==` rather than `=`
|
||||||
For instance:
|
For instance:
|
||||||
```diff
|
```diff
|
||||||
< MATCH (p:person)-[:directed]->(m:movie) WHERE m.name = 'The Godfather II'
|
< MATCH (p:person)-[e:directed]->(m:movie) WHERE m.name = 'The Godfather II'
|
||||||
< RETURN p.name;
|
< RETURN p.name, e.year, m.name;
|
||||||
---
|
---
|
||||||
> MATCH (p:`person`)-[:directed]->(m:`movie`) WHERE m.`movie`.`name` == 'The Godfather II'
|
> MATCH (p:`person`)-[e:directed]->(m:`movie`) WHERE m.`movie`.`name` == 'The Godfather II'
|
||||||
> RETURN p.`person`.`name`;
|
> RETURN p.`person`.`name`, e.year, m.`movie`.`name`;
|
||||||
```\n"""
|
```\n"""
|
||||||
|
|
||||||
NGQL_GENERATION_TEMPLATE = CYPHER_GENERATION_TEMPLATE.replace(
|
NGQL_GENERATION_TEMPLATE = CYPHER_GENERATION_TEMPLATE.replace(
|
||||||
|
Loading…
Reference in New Issue
Block a user