Replies: 1 comment 4 replies
-
Hello, @DiogoR23! I'm here to assist you with any bugs, questions, or contribution opportunities. Let's work together to resolve this issue. To resolve the error from langchain_community.vectorstores import Cassandra
from langchain_openai import OpenAIEmbeddings
def create_vstore(session):
"""
Create a Cassandra Vector Store from a session.
Store those Embeddings into the table.
"""
try:
logging.debug("Creating OpenAIEmbeddings...")
embeddings = OpenAIEmbeddings(
api_key=OPENAI_API_KEY,
base_url=BASE_URL,
model="nomic-ai/nomic-embed-text-v1.5-GGUF",
check_embedding_ctx_length=False
)
logging.debug("OpenAIEmbeddings created successfully.")
logging.debug("Creating Cassandra vector store...")
vstore = Cassandra(
embedding=embeddings,
session=session,
keyspace=KEYSPACE_ARTICLE,
table_name="my_vector_store"
)
logging.debug("Cassandra vector store created successfully.")
return vstore
except Exception as e:
logging.error(f"Error creating vector store: {e}")
return None Make sure you are importing the |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checked other resources
I added a very descriptive title to this question.
I searched the LangChain documentation with the integrated search.
I used the GitHub search to find a similar question and didn't find it.
Commit to Help
I commit to help with one of those options 👆
Example Code:
Description
Hello everyone, I am trying to create a Cassandra Vector Store from my own session, so I imported Cassandra from langchain_community.vectorstores. But it appears me this error, I do not know why.
Can someone help me?
System Info
Python version: 3.10.12
Poetry Show:
Beta Was this translation helpful? Give feedback.
All reactions