run-llama / llamacloud-demo

119 stars 30 forks source link

ApiError: 401, Not authenticated #45

Open Vasiliy-b opened 3 hours ago

Vasiliy-b commented 3 hours ago

Getting ApiError: status_code: 401, body: {'detail': 'Not authenticated'} despite all variables are set propperly.

Exploring file_retrieve_workflow.ipynb and constantly getting this error. Any clue? image

full error log:

`ApiError Traceback (most recent call last) in <cell line: 12>() 10 llm = OpenAI("gpt-4o") 11 ---> 12 doc_retriever = index.as_retriever(retrieval_mode="files_via_content", files_top_k=1) 13 query_engine_doc = RetrieverQueryEngine.from_args( 14 doc_retriever, llm=llm, response_mode="tree_summarize"

4 frames /usr/local/lib/python3.10/dist-packages/llama_index/indices/managed/llama_cloud/base.py in as_retriever(self, **kwargs) 367 dense_similarity_top_k = similarity_top_k 368 --> 369 return LlamaCloudRetriever( 370 project_id=self.project.id, 371 pipeline_id=self.pipeline.id,

/usr/local/lib/python3.10/dist-packages/llama_index/indices/managed/llama_cloud/retriever.py in init(self, name, index_id, id, pipeline_id, project_name, project_id, organization_id, api_key, base_url, app_url, timeout, httpx_client, async_httpx_client, dense_similarity_top_k, sparse_similarity_top_k, enable_reranking, rerank_top_n, alpha, filters, retrieval_mode, files_top_k, retrieve_image_nodes, **kwargs) 112 113 pipeline_id = id or index_id or pipeline_id --> 114 self.project, self.pipeline = resolve_project_and_pipeline( 115 self._client, name, pipeline_id, project_name, project_id, organization_id 116 )

/usr/local/lib/python3.10/dist-packages/llama_index/indices/managed/llama_cloud/api_utils.py in resolve_project_and_pipeline(client, pipeline_name, pipeline_id, project_name, project_id, organization_id) 82 # resolve pipeline by ID 83 if pipeline_id is not None: ---> 84 pipeline = resolve_pipeline( 85 client, pipeline_id=pipeline_id, project=None, pipeline_name=None 86 )

/usr/local/lib/python3.10/dist-packages/llama_index/indices/managed/llama_cloud/api_utils.py in resolve_pipeline(client, pipeline_id, project, pipeline_name) 54 ) -> Pipeline: 55 if pipeline_id is not None: ---> 56 return client.pipelines.get_pipeline(pipeline_id=pipeline_id) 57 else: 58 pipelines = client.pipelines.search_pipelines(

/usr/local/lib/python3.10/dist-packages/llama_cloud/resources/pipelines/client.py in get_pipeline(self, pipeline_id) 208 except JSONDecodeError: 209 raise ApiError(status_code=_response.status_code, body=_response.text) --> 210 raise ApiError(status_code=_response.status_code, body=_response_json) 211 212 def update_existing_pipeline(

ApiError: status_code: 401, body: {'detail': 'Not authenticated'}`

Vasiliy-b commented 2 hours ago

Solve problem. some pip install are missing in notebook. Not obvious for not a newbee.

%pip install llama-index-llms-openai was missing

Vasiliy-b commented 2 hours ago

Hmmm.... seems like taht niot quite working. Now having 401 in retrival pipeline

image