Skip to content

Commit 61c1af5

Browse files
Update the chatbot example to use newer SparseVectorStrategy class (#327)
1 parent 6f9a71d commit 61c1af5

File tree

2 files changed

+144
-155
lines changed

2 files changed

+144
-155
lines changed

example-apps/chatbot-rag-app/api/chat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from langchain_elasticsearch import ElasticsearchStore
1+
from langchain_elasticsearch import ElasticsearchStore, SparseVectorStrategy
22
from llm_integrations import get_llm
33
from elasticsearch_client import (
44
elasticsearch_client,
@@ -20,7 +20,7 @@
2020
store = ElasticsearchStore(
2121
es_connection=elasticsearch_client,
2222
index_name=INDEX,
23-
strategy=ElasticsearchStore.SparseVectorRetrievalStrategy(model_id=ELSER_MODEL),
23+
strategy=SparseVectorStrategy(model_id=ELSER_MODEL),
2424
)
2525

2626

0 commit comments

Comments
 (0)