Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SDK - Patch re-ranking#1521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SilasMarvin merged 2 commits intomasterfromsilas-patch-reranking
Jun 13, 2024
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletionpgml-sdks/pgml/src/vector_search_query_builder.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -326,7 +326,7 @@ pub async fn build_sqlx_query(
SIden::Str("chunk"),
SIden::Str("score"),
]);
query.expr_as(Expr::cust("(rank).score"), Alias::new("rank_score"));
query.expr_as(Expr::cust("(rank).score"), Alias::new("rerank_score"));

// Build the actual select statement sub query
let mut sub_query_rank_call = Query::select();
Expand DownExpand Up@@ -364,6 +364,20 @@ pub async fn build_sqlx_query(

query
} else {
// Wrap our query to return a fourth null column
let mut vector_search_cte = CommonTableExpression::from_select(query);
vector_search_cte.table_name(Alias::new(format!("{prefix}_vector_search")));
ctes.push(vector_search_cte);

let mut query = Query::select();
query
.columns([
SIden::Str("document"),
SIden::Str("chunk"),
SIden::Str("score"),
])
.expr_as(Expr::cust("NULL"), Alias::new("rerank_score"))
.from(SIden::String(format!("{prefix}_vector_search")));
query
};

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp