diff --git a/examples/canonirag/final_impl/app.jac b/examples/canonirag/final_impl/app.jac index cb33d6bc6..953aab97e 100644 --- a/examples/canonirag/final_impl/app.jac +++ b/examples/canonirag/final_impl/app.jac @@ -163,9 +163,9 @@ walker save_data { can main { :g: state ; - + :g: RagEngine ; - + gui.page_build(); if state == PR_states.init_PR { # Import the data from JSON file diff --git a/examples/canonirag/final_impl/rag.jac b/examples/canonirag/final_impl/rag.jac index 2d331e97d..3b800e378 100644 --- a/examples/canonirag/final_impl/rag.jac +++ b/examples/canonirag/final_impl/rag.jac @@ -43,7 +43,7 @@ obj rag_engine { can add_chunk_id(chunks: str) { last_page_id = None; current_chunk_index = 0; - + for chunk in chunks { source = chunk.metadata.get('source'); page = chunk.metadata.get('page'); @@ -70,11 +70,11 @@ obj rag_engine { embedding_function=self.get_embedding_function() ); chunks_with_ids = self.add_chunk_id(chunks);#Chunk ID Calculation - + #Adding and Updating the documents existing_items = db.get(include=[]); existing_ids = set(existing_items['ids']); - + #Only adding new documents that does not exist in the database new_chunks = []; for chunk in chunks_with_ids {