langchain-ai / langchain

🦜🔗 Build context-aware reasoning applications
https://python.langchain.com
MIT License
94.86k stars 15.36k forks source link

DOC: The hybrid search in the use case part is broken. #25470

Open nan-wang opened 3 months ago

nan-wang commented 3 months ago

URL

https://python.langchain.com/v0.1/docs/use_cases/question_answering/hybrid/

Checklist

Issue with current documentation:

import cassio

cassio.init(
    database_id="Your database ID",
    token="Your application token",
    keyspace="Your key space",
)

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

venkatram-dev commented 2 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)