SharePointReader Error: sharepoint_site_name or sharepoint_site_id must be provided #16043
-
I´m trying to use Microsoft SharePoint Reader to retrieve documents from my site, but im receiving the error: An error occurred while accessing SharePoint: sharepoint_site_name or sharepoint_site_id must be provided.
None
C:\Users\mariana.cruz\AppData\Local\anaconda3\envs\llama\lib\site-packages\transformers\tokenization_utils_base.py:1601: FutureWarning: `clean_up_tokenization_spaces` was not set. It will be set to `True` by default. This behavior will be depracted in transformers v4.45, and will be then set to `False` by default. For more details check this issue: https://github.com/huggingface/transformers/issues/31884
warnings.warn(
Traceback (most recent call last):
File "C:\Users\mariana.cruz\Desktop\llama\llama.py", line 41, in <module>
index = VectorStoreIndex.from_documents(
File "C:\Users\mariana.cruz\AppData\Local\anaconda3\envs\llama\lib\site-packages\llama_index\core\indices\base.py", line 109, in from_documents
for doc in documents:
TypeError: 'NoneType' object is not iterable My Loader: documents = loader.load_data(
sharepoint_site_name="SiteDaMari",
sharepoint_folder_path="Test",
recursive=True,
) print(documents) What am I doing wrong? Can someone help me? I did't find anything that could help me with this error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey there, @MarianaMendanha! I'm here to help you with your bug. Let's squash it together! To resolve the "sharepoint_site_name or sharepoint_site_id must be provided" error, ensure that you are correctly initializing the from llama_index.readers.microsoft_sharepoint import SharePointReader
# Initialize the SharePointReader with the required parameters
loader = SharePointReader(
client_id="your_client_id",
client_secret="your_client_secret",
tenant_id="your_tenant_id",
)
# Use the loader to retrieve documents
documents = loader.load_data(
sharepoint_site_name="SiteDaMari", # Provide either this
# sharepoint_site_id="your_sharepoint_site_id", # Or provide this
sharepoint_folder_path="Test",
recursive=True,
)
# Process the documents as needed
print(documents) Make sure to replace |
Beta Was this translation helpful? Give feedback.
I had to put my site name and folder path on the reader params for it to work:
returns: