Skip to content

Commit

Permalink
os environment variables should take precedences over the defaults, f… (
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushin authored Oct 28, 2024
1 parent 6c682be commit 21c282e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions dbgpt/storage/vector_store/elastic_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,18 @@ def __init__(self, vector_store_config: ElasticsearchVectorConfig) -> None:

connect_kwargs = {}
elasticsearch_vector_config = vector_store_config.dict()
self.uri = elasticsearch_vector_config.get("uri") or os.getenv(
self.uri = os.getenv(
"ELASTICSEARCH_URL", "localhost"
)
self.port = elasticsearch_vector_config.get("post") or os.getenv(
) or elasticsearch_vector_config.get("uri")
self.port = os.getenv(
"ELASTICSEARCH_PORT", "9200"
)
self.username = elasticsearch_vector_config.get("username") or os.getenv(
) or elasticsearch_vector_config.get("post")
self.username = os.getenv(
"ELASTICSEARCH_USERNAME"
)
self.password = elasticsearch_vector_config.get("password") or os.getenv(
) or elasticsearch_vector_config.get("username")
self.password = os.getenv(
"ELASTICSEARCH_PASSWORD"
)
) or elasticsearch_vector_config.get("password")

self.collection_name = (
elasticsearch_vector_config.get("name") or vector_store_config.name
Expand Down

0 comments on commit 21c282e

Please sign in to comment.