Skip to content
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

langchain.vectorstores.redis.base:score_threshold is deprecated #10

Open
antonum opened this issue Oct 17, 2023 · 1 comment
Open

langchain.vectorstores.redis.base:score_threshold is deprecated #10

antonum opened this issue Oct 17, 2023 · 1 comment

Comments

@antonum
Copy link
Collaborator

antonum commented Oct 17, 2023

Langchain-based notebooks display the following warning:

WARNING:langchain.vectorstores.redis.base:score_threshold is deprecated. Use distance_threshold instead.score_threshold should only be used in similarity_search_with_relevance_scores.score_threshold will be removed in a future release.

The following change would remove the warning:

# retriever=redis.as_retriever()
retriever=redis.as_retriever(search_type="similarity_distance_threshold",search_kwargs={"distance_threshold":0.5}),

Open questions:

  • What are the reasonable defaults for distance_threshold?
  • Any other defaults such as "k":5 worth adding?
@code2k13
Copy link

I too received that warning and modified the code like you did. I realized that I had to experiment with different values of "distance_threshold" and "k". In my case a value of 0.9 and "k" = 3 with some guardrails in the prompt to prevent hallucination seemed to work. I would encourage you to try different values and see what works for you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants