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

Function build_lib

solutions/embeddings/using_pg_vector.py:44–64  ·  view source on GitHub ↗
(library_name, folder="Agreements")

Source from the content-addressed store, hash-verified

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

Callers 1

using_pg_vector.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