Skip to content

Commit

Permalink
Google Java Format
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Sep 12, 2023
1 parent f786cad commit eb61274
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Examples/pinecone/PineconeExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,23 @@ public static void main(String[] args) {
PINECONE_UPSERT_API,
PINECONE_AUTH_KEY,
"machine-learning", // Passing namespace; read more on Pinecone documentation. You can
// pass empty string
// pass empty string
new ExponentialDelay(3, 3, 2, TimeUnit.SECONDS));

queryPineconeEndpoint =
new PineconeEndpoint(
PINECONE_QUERY_API,
PINECONE_AUTH_KEY,
"machine-learning", // Passing namespace; read more on Pinecone documentation. You can
// pass empty string
// pass empty string
new ExponentialDelay(3, 3, 2, TimeUnit.SECONDS));

deletePineconeEndpoint =
new PineconeEndpoint(
PINECONE_DELETE,
PINECONE_AUTH_KEY,
"machine-learning", // Passing namespace; read more on Pinecone documentation. You can
// pass empty string
// pass empty string
new FixedDelay(4, 5, TimeUnit.SECONDS));

contextEndpoint =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,14 @@ public EdgeChain<List<PostgresWordEmbeddings>> queryRRF(PostgresEndpoint postgre
val.setRawText(
Objects.nonNull(row.get("raw_text")) ? (String) row.get("raw_text") : null);

val.setFilename(
Objects.nonNull(row.get("filename"))
? (String) row.get("filename")
: null);
val.setTimestamp(
Objects.nonNull(row.get("timestamp"))
? ((Timestamp) row.get("timestamp")).toLocalDateTime()
: null);
val.setNamespace(
Objects.nonNull(row.get("namespace"))
? (String) row.get("namespace")
: null);
val.setFilename(
Objects.nonNull(row.get("filename")) ? (String) row.get("filename") : null);
val.setTimestamp(
Objects.nonNull(row.get("timestamp"))
? ((Timestamp) row.get("timestamp")).toLocalDateTime()
: null);
val.setNamespace(
Objects.nonNull(row.get("namespace")) ? (String) row.get("namespace") : null);

BigDecimal bigDecimal =
Objects.nonNull(row.get("rrf_score"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
public enum OrderRRFBy {
DEFAULT, // Preferred Way; ordered by rrf_score; (relevance over freshness)
TEXT_RANK, // First Ordered By Text_Rank; then ordered by rrf_score (text_rank preferred, then
// relevance)
// relevance)
SIMILARITY, // First Ordered by Similarity; then ordered by rrf_score; (similarity preferred, then
// relevance)
// relevance)
DATE_RANK; // First Ordered by date_rank; then ordered by rrf_score; (freshness preferred, then
// relevance)

// relevance)

public static OrderRRFBy fromString(String value) {
if (value != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ public List<Map<String, Object>> queryRRF(
"%s / (ROW_NUMBER() OVER (ORDER BY date_rank DESC) + %s) AS rrf_score\n",
dateWeight.getBaseWeight().getValue(), dateWeight.getFineTuneWeight()))
.append("FROM ( ")
.append("SELECT sv.id, sv.raw_text, sv.namespace, sv.filename, sv.timestamp, svtm.document_date, svtm.metadata, ")
.append(
"SELECT sv.id, sv.raw_text, sv.namespace, sv.filename, sv.timestamp,"
+ " svtm.document_date, svtm.metadata, ")
.append(
String.format(
"ts_rank_cd(sv.tsv, plainto_tsquery('%s', '%s')) AS text_rank, ",
Expand Down

0 comments on commit eb61274

Please sign in to comment.