Skip to content
Open
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
6 changes: 3 additions & 3 deletions mem0/configs/vector_stores/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def validate_auth(cls, values: Dict[str, Any]) -> Dict[str, Any]:
raise ValueError("Either cloud_id or host must be provided")

# Check if authentication is provided
if not any([values.get("api_key"), (values.get("user") and values.get("password"))]):
if not (values.get("api_key") or (values.get("user") and values.get("password"))):
raise ValueError("Either api_key or user/password must be provided")

return values
Expand All @@ -43,12 +43,12 @@ def validate_headers(cls, values: Dict[str, Any]) -> Dict[str, Any]:
# Check if headers is a dictionary
if not isinstance(headers, dict):
raise ValueError("headers must be a dictionary")

# Check if all keys and values are strings
for key, value in headers.items():
if not isinstance(key, str) or not isinstance(value, str):
raise ValueError("All header keys and values must be strings")

return values

@model_validator(mode="before")
Expand Down