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

Bring back client attribute on ElasticsearchStore #29

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libs/elasticsearch/langchain_elasticsearch/vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ def __init__(
)

self.embedding = embedding
self.client = self._store.client
self._embedding_service = embedding_service
self.query_field = query_field
self.vector_query_field = vector_query_field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def assert_query(
)

# 2. check query result is okay
es_output = docsearch._store.client.search(
es_output = docsearch.client.search(
index=index_name,
query={
"bool": {
Expand Down
2 changes: 1 addition & 1 deletion libs/elasticsearch/tests/unit_tests/test_vectorstores.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def dummy_custom_query(query_body: dict, query: Optional[str]) -> Dict[str, Any]
return {"dummy": "query"}

def test_agent_header(self, store: ElasticsearchStore) -> None:
agent = store._store.client._headers["User-Agent"]
agent = store.client._headers["User-Agent"]
assert (
re.match(r"^langchain-py-vs/\d+\.\d+\.\d+(?:rc\d+)?$", agent) is not None
), f"The string '{agent}' does not match the expected pattern."
Expand Down
Loading