fix: Use global var if available for api endpoint (#4909)

* fix: Use global var if available for api endpoint

* Update astradb.py
This commit is contained in:
Eric Hare 2024-11-27 16:39:23 -08:00 committed by GitHub
commit e38af369e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,4 @@
import os
from typing import Any
from astrapy import Collection, DataAPIClient, Database
@ -10,7 +11,7 @@ from langflow.schema import Data
class AstraDBToolComponent(LCToolComponent):
display_name: str = "Astra DB"
display_name: str = "Astra DB Tool"
description: str = "Create a tool to get transactional data from DataStax Astra DB Collection"
documentation: str = "https://docs.langflow.org/Components/components-tools#astra-db-tool"
icon: str = "AstraDB"
@ -48,9 +49,9 @@ class AstraDBToolComponent(LCToolComponent):
value="ASTRA_DB_APPLICATION_TOKEN",
required=True,
),
StrInput(
SecretStrInput(
name="api_endpoint",
display_name="API Endpoint",
display_name="Database" if os.getenv("ASTRA_ENHANCED", "false").lower() == "true" else "API Endpoint",
info="API endpoint URL for the Astra DB service.",
value="ASTRA_DB_API_ENDPOINT",
required=True,