refactor(setup): generalize tool/agent node logic and update starter templates (#8618)

* update several templates

* updated templates

* change custom component maker

* Update Twitter Thread Generator.json

* updates from main

* llm reset issue

* Update setup.py

* Update Custom Component Maker.json

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* udpate templates

* [autofix.ci] apply automated fixes

* Update setup.py

* Update Custom Component Maker.json

* [autofix.ci] apply automated fixes

* Update Custom Component Maker.json

* text fixes

---------

Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
This commit is contained in:
Edwin Jose 2025-06-20 13:51:35 -05:00 committed by GitHub
commit 4832093e99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 2548 additions and 3047 deletions

View file

@ -43,3 +43,4 @@ FIELD_FORMAT_ATTRIBUTES = [
]
SKIPPED_FIELD_ATTRIBUTES = ["advanced"]
ORJSON_OPTIONS = orjson.OPT_INDENT_2 | orjson.OPT_SORT_KEYS | orjson.OPT_OMIT_MICROSECONDS
SKIPPED_COMPONENTS = {"LanguageModelComponent"}

View file

@ -30,6 +30,7 @@ from langflow.base.constants import (
FIELD_FORMAT_ATTRIBUTES,
NODE_FORMAT_ATTRIBUTES,
ORJSON_OPTIONS,
SKIPPED_COMPONENTS,
SKIPPED_FIELD_ATTRIBUTES,
)
from langflow.initial_setup.constants import STARTER_FOLDER_DESCRIPTION, STARTER_FOLDER_NAME
@ -65,8 +66,15 @@ def update_projects_components_with_latest_component_versions(project_data, all_
latest_node = all_types_dict_flat.get(node_type)
latest_template = latest_node.get("template")
node_data["template"]["code"] = latest_template["code"]
# skip components that are having dynamic values that need to be persisted for templates
is_tool_or_agent = node_data.get("tool_mode", False) or node_data.get("key") == "Agent"
if node_data.get("key") in SKIPPED_COMPONENTS:
continue
is_tool_or_agent = node_data.get("tool_mode", False) or node_data.get("key") in {
"Agent",
"LanguageModelComponent",
}
has_tool_outputs = any(output.get("types") == ["Tool"] for output in node_data.get("outputs", []))
if "outputs" in latest_node and not has_tool_outputs and not is_tool_or_agent:
# Set selected output as the previous selected output

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -35,6 +35,9 @@ withEventDeliveryModes(
skipSelectGptModel: true,
});
await page.getByTestId("dropdown_str_provider").click();
await page.getByTestId("Anthropic-1-option").click();
await page
.getByTestId("popover-anchor-input-api_key")
.last()

View file

@ -39,10 +39,14 @@ withEventDeliveryModes(
await page.waitForTimeout(500);
await page.getByTestId("select-files-modal-button").click();
await page.waitForSelector('[data-testid="button_run_chat output"]', {
await page.waitForSelector('[data-testid="title-Chat Output"]', {
timeout: 3000,
});
await page.getByTestId("title-Chat Output").last().click();
await page.getByTestId("icon-MoreHorizontal").click();
await page.getByText("Expand").click();
await page.getByTestId("button_run_chat output").last().click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });

View file

@ -34,6 +34,10 @@ withEventDeliveryModes(
await initialGPTsetup(page);
await page.getByTestId("title-Chat Output").click();
await page.getByTestId("icon-MoreHorizontal").click();
await page.getByText("Expand").click();
await page.getByTestId("button_run_chat output").click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });