Skip to content

Commit

Permalink
changed fromCypher prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed May 10, 2024
1 parent 4d2351f commit 7532119
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions extended/src/main/java/apoc/ml/Prompt.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,17 @@ public boolean hasError() {
@Description("Takes a query in cypher and in natural language and returns the results in natural language")
public Stream<StringResult> fromCypher(@Name("cypher") String cypher,
@Name(value = "conf", defaultValue = "{}") Map<String, Object> conf) throws MalformedURLException, JsonProcessingException {
String schema = loadSchema(tx, conf);
String schemaAndCypher = """
%s
while the cypher query is:
%s
""".formatted(
loadSchema(tx, conf),
cypher
);

String schemaExplanation = prompt("Please explain the graph database schema to me and relate it to well known concepts and domains.",
FROM_CYPHER_PROMPT, "This database schema ", schema, conf, List.of());
FROM_CYPHER_PROMPT, "This database schema ", schemaAndCypher, conf, List.of());
return Stream.of(new StringResult(schemaExplanation));
}

Expand Down

0 comments on commit 7532119

Please sign in to comment.