Open nan-wang opened 3 months ago
The code snippet does work for me. You might want to check if there was some intermittent timeout issue.
We do not have to provide any api endpoint url. We Just need database id and ASTRA_DB_APPLICATION_TOKEN. keyspace is also optional.
Below code worked for me in both mac and google colab
import cassio
# Version: 0.1.8
ASTRA_DB_APPLICATION_TOKEN='yyy'
cassio.init(
database_id="xx-xx-xx-xx-xx",
token=ASTRA_DB_APPLICATION_TOKEN,
keyspace="test_keyspace"
)
# Run a simple query to check the connection
query = "SELECT * FROM system.local"
c_session = cassio.config.resolve_session()
c_keyspace = cassio.config.resolve_keyspace()
rows = c_session.execute(query)
# Print the result
print(rows)
for rows in rows:
print(rows)
URL
https://python.langchain.com/v0.1/docs/use_cases/question_answering/hybrid/
Checklist
Issue with current documentation:
this part of code snippet does work. I've created an issue at https://github.com/CassioML/cassio/issues/165.
Idea or request for content:
No response