Skip to content

Commit

Permalink
Update the chatbot example to use newer SparseVectorStrategy class (#327
Browse files Browse the repository at this point in the history
)
  • Loading branch information
miguelgrinberg authored Sep 11, 2024
1 parent 6f9a71d commit 61c1af5
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 155 deletions.
4 changes: 2 additions & 2 deletions example-apps/chatbot-rag-app/api/chat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from langchain_elasticsearch import ElasticsearchStore
from langchain_elasticsearch import ElasticsearchStore, SparseVectorStrategy
from llm_integrations import get_llm
from elasticsearch_client import (
elasticsearch_client,
Expand All @@ -20,7 +20,7 @@
store = ElasticsearchStore(
es_connection=elasticsearch_client,
index_name=INDEX,
strategy=ElasticsearchStore.SparseVectorRetrievalStrategy(model_id=ELSER_MODEL),
strategy=SparseVectorStrategy(model_id=ELSER_MODEL),
)


Expand Down
Loading

0 comments on commit 61c1af5

Please sign in to comment.