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:
parent
7e7fe19f4f
commit
e38af369e5
1 changed files with 4 additions and 3 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from astrapy import Collection, DataAPIClient, Database
|
from astrapy import Collection, DataAPIClient, Database
|
||||||
|
|
@ -10,7 +11,7 @@ from langflow.schema import Data
|
||||||
|
|
||||||
|
|
||||||
class AstraDBToolComponent(LCToolComponent):
|
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"
|
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"
|
documentation: str = "https://docs.langflow.org/Components/components-tools#astra-db-tool"
|
||||||
icon: str = "AstraDB"
|
icon: str = "AstraDB"
|
||||||
|
|
@ -48,9 +49,9 @@ class AstraDBToolComponent(LCToolComponent):
|
||||||
value="ASTRA_DB_APPLICATION_TOKEN",
|
value="ASTRA_DB_APPLICATION_TOKEN",
|
||||||
required=True,
|
required=True,
|
||||||
),
|
),
|
||||||
StrInput(
|
SecretStrInput(
|
||||||
name="api_endpoint",
|
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.",
|
info="API endpoint URL for the Astra DB service.",
|
||||||
value="ASTRA_DB_API_ENDPOINT",
|
value="ASTRA_DB_API_ENDPOINT",
|
||||||
required=True,
|
required=True,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue