feat: add env support for Astra Db components (#3908)

* add env support for Astra Db components

* [autofix.ci] apply automated fixes

* use parse_api_endpoint

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* quick cleanup

* merge

* package lock

* reset templates

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mike Fortman 2024-09-27 16:00:31 -05:00 committed by GitHub
commit e1816246b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View file

@ -1,5 +1,7 @@
import os
from astrapy.admin import parse_api_endpoint
from langflow.base.memory.model import LCChatMemoryComponent
from langflow.field_typing import BaseChatMessageHistory
from langflow.inputs import MessageTextInput, SecretStrInput, StrInput
@ -62,5 +64,6 @@ class AstraDBChatMemory(LCChatMemoryComponent):
token=self.token,
api_endpoint=self.api_endpoint,
namespace=self.namespace or None,
environment=parse_api_endpoint(self.api_endpoint).environment,
)
return memory

View file

@ -1,5 +1,6 @@
import os
from astrapy.admin import parse_api_endpoint
from loguru import logger
from langflow.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store
@ -397,6 +398,7 @@ class AstraVectorStoreComponent(LCVectorStoreComponent):
"token": self.token,
"api_endpoint": self.api_endpoint,
"namespace": self.namespace or None,
"environment": parse_api_endpoint(self.api_endpoint).environment,
"metric": self.metric or None,
"batch_size": self.batch_size or None,
"bulk_insert_batch_concurrency": self.bulk_insert_batch_concurrency or None,

View file

@ -858,6 +858,7 @@
},
"node_modules/@clack/prompts/node_modules/is-unicode-supported": {
"version": "1.3.0",
"extraneous": true,
"inBundle": true,
"license": "MIT",
"engines": {