Pergunta 1 - Após instalar as bibliotecas a compilação teve o seguinte erro:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[2], line 20
17 from langchain_openai import ChatOpenAI
19 # Cadeia RAG
---> 20 from langchain.chains import RetrievalQA
ModuleNotFoundError: No module named 'langchain.chains'
como resolver este erro?
Pergunta 2 - Estou usando o exemplo disponibilizado na aula. No item 3 - Embeddings e Vanco Vetorial, usando o código disponíbilizado, foi disponibilizado um código de acesso "openai_api_key="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"
este parte do programa deu o seguinte erro:
---------------------------------------------------------------------------
AuthenticationError Traceback (most recent call last)
Cell In[8], line 8
2 embeddings = OpenAIEmbeddings(
3 model="text-embedding-3-small",
4 openai_api_key="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"
5 )
7 # Cria o banco vetorial
----> 8 vectorstore = Chroma.from_documents(
9 documents=chunks,
10 embedding=embeddings,
11 persist_directory="./chroma_regras_futebol"
12 )
File c:\Users\dutra\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain_community\vectorstores\chroma.py:887, in Chroma.from_documents(cls, documents, embedding, ids, collection_name, persist_directory, client_settings, client, collection_metadata, **kwargs)
885 texts = [doc.page_content for doc in documents]
886 metadatas = [doc.metadata for doc in documents]
--> 887 return cls.from_texts(
888 texts=texts,
889 embedding=embedding,
890 metadatas=metadatas,
891 ids=ids,
892 collection_name=collection_name,
893 persist_directory=persist_directory,
894 client_settings=client_settings,
...
-> 1070 raise self._make_status_error_from_response(err.response) from None
1072 break
1074 assert response is not None, "could not resolve response (should never happen)"
AuthenticationError: Error code: 401 - {'error': {'message': 'Incorrect API key provided: sk-proj-********************************************************************************************************************************************************SdsA. You can find your API key at https://platform.openai.com/account/api-keys.', 'type': 'invalid_request_error', 'code': 'invalid_api_key', 'param': None}, 'status': 401}
é possível rodar o exemplo sem uma IA paga? eu tenho acesso ao COPILOT, como poderia usá-lo neste acaso?