Note: this setup_library method is provided to enable a self-contained example to create a test library
(library_name)
| 22 | |
| 23 | |
| 24 | def setup_library(library_name): |
| 25 | |
| 26 | """ Note: this setup_library method is provided to enable a self-contained example to create a test library """ |
| 27 | |
| 28 | # Step 1 - Create library which is the main 'organizing construct' in llmware |
| 29 | print ("\nupdate: Creating library: {}".format(library_name)) |
| 30 | |
| 31 | library = Library().create_new_library(library_name) |
| 32 | |
| 33 | # check the embedding status 'before' installing the embedding |
| 34 | embedding_record = library.get_embedding_status() |
| 35 | print("embedding record - before embedding ", embedding_record) |
| 36 | |
| 37 | # Step 2 - Pull down the sample files from S3 through the .load_sample_files() command |
| 38 | # --note: if you need to refresh the sample files, set 'over_write=True' |
| 39 | print ("update: Downloading Sample Files") |
| 40 | |
| 41 | sample_files_path = Setup().load_sample_files(over_write=False) |
| 42 | |
| 43 | # Step 3 - point ".add_files" method to the folder of documents that was just created |
| 44 | # this method parses the documents, text chunks, and captures in database |
| 45 | |
| 46 | print("update: Parsing and Text Indexing Files") |
| 47 | |
| 48 | library.add_files(input_folder_path=os.path.join(sample_files_path, "Agreements"), |
| 49 | chunk_size=400, max_chunk_size=600, smart_chunking=1) |
| 50 | |
| 51 | return library |
| 52 | |
| 53 | |
| 54 | def install_vector_embeddings(library, embedding_model_name): |
no test coverage detected