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

Function build_lib

solutions/embeddings/using_qdrant.py:29–49  ·  view source on GitHub ↗
(library_name, folder="Agreements")

Source from the content-addressed store, hash-verified

27
28
29def build_lib (library_name, folder="Agreements"):
30
31 # Step 1 - Create library which is the main 'organizing construct' in llmware
32 print ("\nupdate: Step 1 - Creating library: {}".format(library_name))
33
34 library = Library().create_new_library(library_name)
35
36 # Step 2 - Pull down the sample files from S3 through the .load_sample_files() command
37 # --note: if you need to refresh the sample files, set 'over_write=True'
38 print ("update: Step 2 - Downloading Sample Files")
39
40 sample_files_path = Setup().load_sample_files(over_write=False)
41
42 # Step 3 - point ".add_files" method to the folder of documents that was just created
43 # this method parses the documents, text chunks, and captures in MongoDB
44 print("update: Step 3 - Parsing and Text Indexing Files")
45
46 # options: Agreements | UN-Resolutions-500
47 library.add_files(input_folder_path=os.path.join(sample_files_path, folder))
48
49 return library
50
51
52# start script

Callers 1

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