MCPcopy
hub / github.com/llmware-ai/llmware / build_lib

Function build_lib

solutions/embeddings/using_neo4j.py:45–65  ·  view source on GitHub ↗
(library_name, folder="Agreements")

Source from the content-addressed store, hash-verified

43
44
45def build_lib (library_name, folder="Agreements"):
46
47 # Step 1 - Create library which is the main 'organizing construct' in llmware
48 print ("\nupdate: Step 1 - Creating library: {}".format(library_name))
49
50 library = Library().create_new_library(library_name)
51
52 # Step 2 - Pull down the sample files from S3 through the .load_sample_files() command
53 # --note: if you need to refresh the sample files, set 'over_write=True'
54 print ("update: Step 2 - Downloading Sample Files")
55
56 sample_files_path = Setup().load_sample_files(over_write=False)
57
58 # Step 3 - point ".add_files" method to the folder of documents that was just created
59 # this method parses the documents, text chunks, and captures in MongoDB
60 print("update: Step 3 - Parsing and Text Indexing Files")
61
62 # options: Agreements | UN-Resolutions-500
63 library.add_files(input_folder_path=os.path.join(sample_files_path, folder))
64
65 return library
66
67
68# start script

Callers 1

using_neo4j.pyFile · 0.70

Calls 6

LibraryClass · 0.90
SetupClass · 0.90
formatMethod · 0.80
create_new_libraryMethod · 0.80
load_sample_filesMethod · 0.80
add_filesMethod · 0.80

Tested by

no test coverage detected