diff --git a/src/AIHelpMe.jl b/src/AIHelpMe.jl index 0749f7a..746cbba 100644 --- a/src/AIHelpMe.jl +++ b/src/AIHelpMe.jl @@ -29,10 +29,9 @@ function __init__() CONV_HISTORY::Vector{Vector{<:Any}} = Vector{Vector{<:Any}}() CONV_HISTORY_LOCK::ReentrantLock = ReentrantLock() MAX_HISTORY_LENGTH::Int = 1 - MAIN_INDEX::Union{Nothing, RAG.AbstractChunkIndex} = nothing LAST_CONTEXT::Union{Nothing, RAG.RAGContext} = nothing ## Load index - # TODO: load_index!() + MAIN_INDEX::Union{Nothing, RAG.AbstractChunkIndex} = load_index!() end end diff --git a/src/utils.jl b/src/utils.jl index db85d34..ef2703c 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -82,13 +82,15 @@ function load_index!(file_path::Union{Nothing, AbstractString} = nothing; global MAIN_INDEX if !isnothing(file_path) @assert endswith(file_path, ".jls") "Provided file path must end with `.jls` (serialized Julia object)." + file_str = "from file $(file_path) " else artifact_path = artifact"juliaextra" file_path = joinpath(artifact_path, "docs-index.jls") + file_str = " " end index = deserialize(file_path) @assert index isa RAG.AbstractChunkIndex "Provided file path must point to a serialized RAG index (Deserialized type: $(typeof(index)))." - verbose && @info "Loaded index in $file_path into MAIN_INDEX" + verbose && @info "Loaded index $(file_str)into MAIN_INDEX" MAIN_INDEX = index return index