I am learning to use Datastax AstraDB to vector storage. I am trying to follow a tutorial. I am using cassio
to connect with astraDB using the following code:
ASTRA_DB_APPLICATION_TOKEN = os.environ.get("ASTRA_DB_APPLICATION_TOKEN")
ASTRA_DB_ID = os.environ.get("ASTRA_DB_ID")
cassio.init(token=ASTRA_DB_APPLICATION_TOKEN,database_id=ASTRA_DB_ID)
There seems to be no warning or error for the above code. But when I try to store the vectors, I get the error
from langchain.vectorstores.cassandra import Cassandra
embeddings = OllamaEmbeddings(model="llama3")
session = None
astra_vector_store = Cassandra(
embedding=embeddings,
table_name="groq_project",
session=session
)
Here is the full error:
---------------------------------------------------------------------------
ConnectError Traceback (most recent call last)
File /home/time/miniconda3/envs/bias-vision/lib/python3.9/site-packages/httpx/_transports/default.py:72, in map_httpcore_exceptions()
71 try:
---> 72 yield
73 except Exception as exc:
File /home/time/miniconda3/envs/bias-vision/lib/python3.9/site-packages/httpx/_transports/default.py:236, in HTTPTransport.handle_request(self, request)
235 with map_httpcore_exceptions():
--> 236 resp = self._pool.handle_request(req)
238 assert isinstance(resp.stream, typing.Iterable)
File /home/time/miniconda3/envs/bias-vision/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py:256, in ConnectionPool.handle_request(self, request)
255 self._close_connections(closing)
--> 256 raise exc from None
258 # Return the response. Note that in this case we still have to manage
259 # the point at which the response is closed.
File /home/time/miniconda3/envs/bias-vision/lib/python3.9/site-packages/httpcore/_sync/connection_pool.py:236, in ConnectionPool.handle_request(self, request)
234 try:
235 # Send the request on the assigned connection.
--> 236 response = connection.handle_request(
237 pool_request.request
238 )
239 except ConnectionNotAvailable:
...
86 raise
88 message = str(exc)
---> 89 raise mapped_exc(message) from exc
ConnectError: [Errno 111] Connection refused