From cfe4b3c83d9433fc709da07f06367284730135ee Mon Sep 17 00:00:00 2001 From: SixZero Date: Thu, 16 Jan 2025 23:35:29 +0100 Subject: [PATCH] reranker improvements. --- src/contexts/CTX_workspace.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contexts/CTX_workspace.jl b/src/contexts/CTX_workspace.jl index 98bb5ee..5540566 100644 --- a/src/contexts/CTX_workspace.jl +++ b/src/contexts/CTX_workspace.jl @@ -27,7 +27,7 @@ function init_workspace_context(project_paths; show_tokens=false, verbose=true, return WorkspaceCTX(workspace, tracker_context, changes_tracker, ws_simi_filterer, ws_reranker_filterer, index_logger ) end -function process_workspace_context(workspace_context, ctx_question; enabled=true, age_tracker=nothing, extractor=nothing, io::Union{IO, Nothing}=nothing) +function process_workspace_context(workspace_context, ctx_question; rerank_query=ctx_question, enabled=true, age_tracker=nothing, extractor=nothing, io::Union{IO, Nothing}=nothing) !enabled && return "" workspace, tracker_context, changes_tracker, ws_simi_filterer, ws_reranker_filterer, index_logger = workspace_context.workspace, workspace_context.tracker_context, workspace_context.changes_tracker, workspace_context.ws_simi_filterer, workspace_context.ws_reranker_filterer, workspace_context.index_logger @time "the cd" scr_content = cd(workspace_context) do @@ -35,12 +35,12 @@ function process_workspace_context(workspace_context, ctx_question; enabled=true isempty(file_chunks) && return "" @time "indexgetting" indexx = get_index(ws_simi_filterer, file_chunks) @time "rag filter" file_chunks_selected = ws_simi_filterer(indexx, ctx_question) - @time "rerank" file_chunks_reranked = ws_reranker_filterer(file_chunks_selected, ctx_question) + @time "rerank" file_chunks_reranked = ws_reranker_filterer(file_chunks_selected, rerank_query) merged_file_chunks = tracker_context(file_chunks_reranked) !isnothing(extractor) && update_changes_from_extractor!(changes_tracker, extractor) _scr_content = changes_tracker(merged_file_chunks) !isnothing(age_tracker) && age_tracker(changes_tracker) - log_index(index_logger, indexx, ctx_question) + log_index(index_logger, indexx, rerank_query) return _scr_content end isa(scr_content,String) && return ""