mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-22 10:08:34 +00:00
os environment variables should take precedences over the defaults, f… (#2100)
This commit is contained in:
parent
6c682befa8
commit
21c282e659
@ -130,18 +130,18 @@ class ElasticStore(VectorStoreBase):
|
|||||||
|
|
||||||
connect_kwargs = {}
|
connect_kwargs = {}
|
||||||
elasticsearch_vector_config = vector_store_config.dict()
|
elasticsearch_vector_config = vector_store_config.dict()
|
||||||
self.uri = elasticsearch_vector_config.get("uri") or os.getenv(
|
self.uri = os.getenv(
|
||||||
"ELASTICSEARCH_URL", "localhost"
|
"ELASTICSEARCH_URL", "localhost"
|
||||||
)
|
) or elasticsearch_vector_config.get("uri")
|
||||||
self.port = elasticsearch_vector_config.get("post") or os.getenv(
|
self.port = os.getenv(
|
||||||
"ELASTICSEARCH_PORT", "9200"
|
"ELASTICSEARCH_PORT", "9200"
|
||||||
)
|
) or elasticsearch_vector_config.get("post")
|
||||||
self.username = elasticsearch_vector_config.get("username") or os.getenv(
|
self.username = os.getenv(
|
||||||
"ELASTICSEARCH_USERNAME"
|
"ELASTICSEARCH_USERNAME"
|
||||||
)
|
) or elasticsearch_vector_config.get("username")
|
||||||
self.password = elasticsearch_vector_config.get("password") or os.getenv(
|
self.password = os.getenv(
|
||||||
"ELASTICSEARCH_PASSWORD"
|
"ELASTICSEARCH_PASSWORD"
|
||||||
)
|
) or elasticsearch_vector_config.get("password")
|
||||||
|
|
||||||
self.collection_name = (
|
self.collection_name = (
|
||||||
elasticsearch_vector_config.get("name") or vector_store_config.name
|
elasticsearch_vector_config.get("name") or vector_store_config.name
|
||||||
|
Loading…
Reference in New Issue
Block a user