-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Pinecone has no attribute 'from_texts' #388
Comments
@Mukku27 Thank you for raising this issue. The Python Pinecone SDK does not have the function If you can share the code or the Colab, we can help you further. You might also find our Langchain guide. useful too |
This is one cell of the whole notebook |
Thank you for the code. Unfortunately, it's incorrect. As I mentioned previously, Pinecone does not have a Here is the correct way to use import os
from langchain_pinecone import PineconeVectorStore
from langchain_openai import OpenAIEmbeddings
from langchain_community.document_loaders import TextLoader
from langchain_text_splitters import CharacterTextSplitter
os.environ['OPENAI_API_KEY'] = '<YOUR_OPENAI_API_KEY>'
os.environ['PINECONE_API_KEY'] = '<YOUR_PINECONE_API_KEY>'
index_name = "<YOUR_PINECONE_INDEX_NAME>"
embeddings = OpenAIEmbeddings()
texts = ["Tonight, I call on the Senate to: Pass the Freedom to Vote Act.", "ne of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court.", "One of our nation’s top legal minds, who will continue Justice Breyer’s legacy of excellence."]
vectorstore_from_texts = PineconeVectorStore.from_texts(
texts,
index_name=index_name,
embedding=embeddings
) There are examples in our Langchain guide. |
Thank you @mcpaddy |
Describe the bug
When attempting to create an embedding using Pinecone in a Google Colab notebook, an
AttributeError
is raised. The functionality that was working previously to generate embeddings from text chunks is now broken.Error information
The full stack trace of the error is as follows:
Steps to reproduce the issue locally
Environment
pinecone-io/pinecone-python-client
(latest version installed via pip)Additional context
The issue seems to be related to a name collision between Pinecone's
from_texts
method and another dependency that might be wrapping Pinecone functionality. I am using the notebook environment in Google Colab, and a screenshot of the error is attached for reference.The text was updated successfully, but these errors were encountered: