Skip to content

Commit

Permalink
fix checkstyle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Ochoa committed Dec 3, 2024
1 parent 9de99e7 commit c3ca0bb
Showing 1 changed file with 32 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
import dev.langchain4j.store.graph.neo4j.Neo4jGraph;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
import java.util.logging.Level;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
import org.neo4j.driver.*;
import org.neo4j.driver.AuthTokens;
import org.neo4j.driver.Driver;
import org.neo4j.driver.GraphDatabase;

/**
* Neo4j Content Retriever Client.
Expand All @@ -24,9 +25,9 @@ public class Neo4jContentRetrieverClient extends BaseContentRetrieverClient {

@ConfigProperty(name = "neo4j.default.url")
private String neo4jUrl;
@ConfigProperty( name = "neo4j.default.username")
@ConfigProperty(name = "neo4j.default.username")
private String neo4jUser;
@ConfigProperty( name = "neo4j.default.password")
@ConfigProperty(name = "neo4j.default.password")
private String neo4jPassword;

Logger log = Logger.getLogger(Neo4jContentRetrieverClient.class);
Expand All @@ -37,33 +38,35 @@ public class Neo4jContentRetrieverClient extends BaseContentRetrieverClient {

// Task: Generate Accurate Cypher Statement to Query a Neo4J Graph
// Database About a Patients.
final PromptTemplate PROMPT_TEMPLATE =
static final PromptTemplate PROMPT_TEMPLATE =
PromptTemplate.from(
"""
You are Data scientist with deep understanding of Neo4J and the Cypher query language. You have great experience in healthcare. You return high quality Cypher queries based on our Neo4J nodes, relations and properties listed below.
## Rules:
1. Only use valid Cypher language, don't mix this with SQL or HTML.
2. Only return the Cypher query without formatting, explanation and markdown. We need it to inject to Neo4J.
3. Always do lowercase when matching with text.
4. If you cannot answer the question return empty string.
5. Only use the nodes, relationships and properties listed below.
6. When using relationships, make sure to use the correct direction.
7. Do not use BETWEEN to compare dates.
8. For date conversions use: datetime(ISODATE).epochMillis
9. Expect dates in future years like 2122
Schema:
{{schema}}
***Example usage***
Find all patients:
MATCH (p:Patient)
RETURN p
The user question is:
{{question}}
\s""");
You are Data scientist with deep understanding of Neo4J and the Cypher query language.
You have great experience in healthcare.
You return high quality Cypher queries based on our Neo4J nodes, relations and properties listed below.
## Rules:
1. Only use valid Cypher language, don't mix this with SQL or HTML.
2. Only return the Cypher query without formatting, explanation and markdown. We need it to inject to Neo4J.
3. Always do lowercase when matching with text.
4. If you cannot answer the question return empty string.
5. Only use the nodes, relationships and properties listed below.
6. When using relationships, make sure to use the correct direction.
7. Do not use BETWEEN to compare dates.
8. For date conversions use: datetime(ISODATE).epochMillis
9. Expect dates in future years like 2122
Schema:
{{schema}}
***Example usage***
Find all patients:
MATCH (p:Patient)
RETURN p
The user question is:
{{question}}
\s""");

/**
* Get the Content Retriever.
Expand Down

0 comments on commit c3ca0bb

Please sign in to comment.