refactor: Update parameter order and hide token for DS users (#3920)

* Update parameter order and hide token for DS users

* cleanup

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Mike Fortman 2024-09-26 08:31:00 -05:00 • committed by GitHub
commit 5520cb647b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 12 deletions

View file

@ -1,3 +1,5 @@
import os
from langflow.base.memory.model import LCChatMemoryComponent from langflow.base.memory.model import LCChatMemoryComponent
from langflow.field_typing import BaseChatMessageHistory from langflow.field_typing import BaseChatMessageHistory
from langflow.inputs import MessageTextInput, SecretStrInput, StrInput from langflow.inputs import MessageTextInput, SecretStrInput, StrInput
@ -10,18 +12,13 @@ class AstraDBChatMemory(LCChatMemoryComponent):
icon: str = "AstraDB" icon: str = "AstraDB"
inputs = [ inputs = [
StrInput(
name="collection_name",
display_name="Collection Name",
info="The name of the collection within Astra DB where the vectors will be stored.",
required=True,
),
SecretStrInput( SecretStrInput(
name="token", name="token",
display_name="Astra DB Application Token", display_name="Astra DB Application Token",
info="Authentication token for accessing Astra DB.", info="Authentication token for accessing Astra DB.",
value="ASTRA_DB_APPLICATION_TOKEN", value="ASTRA_DB_APPLICATION_TOKEN",
required=True, required=True,
advanced=os.getenv("ASTRA_ENHANCED", "false").lower() == "true",
), ),
SecretStrInput( SecretStrInput(
name="api_endpoint", name="api_endpoint",
@ -30,6 +27,12 @@ class AstraDBChatMemory(LCChatMemoryComponent):
value="ASTRA_DB_API_ENDPOINT", value="ASTRA_DB_API_ENDPOINT",
required=True, required=True,
), ),
StrInput(
name="collection_name",
display_name="Collection Name",
info="The name of the collection within Astra DB where the vectors will be stored.",
required=True,
),
StrInput( StrInput(
name="namespace", name="namespace",
display_name="Namespace", display_name="Namespace",

View file

@ -1,3 +1,5 @@
import os
from loguru import logger from loguru import logger
from langflow.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store from langflow.base.vectorstores.model import LCVectorStoreComponent, check_cached_vector_store
@ -58,18 +60,13 @@ class AstraVectorStoreComponent(LCVectorStoreComponent):
} }
inputs = [ inputs = [
StrInput(
name="collection_name",
display_name="Collection Name",
info="The name of the collection within Astra DB where the vectors will be stored.",
required=True,
),
SecretStrInput( SecretStrInput(
name="token", name="token",
display_name="Astra DB Application Token", display_name="Astra DB Application Token",
info="Authentication token for accessing Astra DB.", info="Authentication token for accessing Astra DB.",
value="ASTRA_DB_APPLICATION_TOKEN", value="ASTRA_DB_APPLICATION_TOKEN",
required=True, required=True,
advanced=os.getenv("ASTRA_ENHANCED", "false").lower() == "true",
), ),
SecretStrInput( SecretStrInput(
name="api_endpoint", name="api_endpoint",
@ -78,6 +75,12 @@ class AstraVectorStoreComponent(LCVectorStoreComponent):
value="ASTRA_DB_API_ENDPOINT", value="ASTRA_DB_API_ENDPOINT",
required=True, required=True,
), ),
StrInput(
name="collection_name",
display_name="Collection Name",
info="The name of the collection within Astra DB where the vectors will be stored.",
required=True,
),
MultilineInput( MultilineInput(
name="search_input", name="search_input",
display_name="Search Input", display_name="Search Input",