fix: fetch composio apps list dynamically (#5427)
* fix: fetch composio apps list dynamically * Ensure apps only get loaded once API key is entered * Add comment * typo fix --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
parent
a626209da6
commit
c4de1da4d4
3 changed files with 34 additions and 29 deletions
|
|
@ -35,7 +35,7 @@ class ComposioAPIComponent(LCToolComponent):
|
|||
DropdownInput(
|
||||
name="app_names",
|
||||
display_name="App Name",
|
||||
options=[str(app).replace("App.", "") for app in App.all()],
|
||||
options=[],
|
||||
value="",
|
||||
info="The app name to use. Please refresh after selecting app name",
|
||||
refresh_button=True,
|
||||
|
|
@ -222,6 +222,11 @@ class ComposioAPIComponent(LCToolComponent):
|
|||
return self.app_names.replace(" ✅", "").replace("_connected", "")
|
||||
|
||||
def update_build_config(self, build_config: dict, field_value: Any, field_name: str | None = None) -> dict: # noqa: ARG002
|
||||
# Update the available apps options from the API
|
||||
if hasattr(self, "api_key") and self.api_key != "":
|
||||
toolset = self._build_wrapper()
|
||||
build_config["app_names"]["options"] = list(App.iter())
|
||||
|
||||
# First, ensure all dynamic fields are hidden by default
|
||||
dynamic_fields = ["app_credentials", "username", "auth_link", "auth_status", "action_names"]
|
||||
for field in dynamic_fields:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue