* feat: add selected_output property to Component and update validation logic * feat: add selected_output property to various components and update related logic * fix: improve error handling in JSON processing and update type hints * refactor: clean up Makefile and reorder JSON properties in Vector Store RAG.json * Removed the update_selected_outputs target from the Makefile to streamline the build process. * Reordered properties in Vector Store RAG.json for consistency, ensuring "selected_output" appears before "type" in multiple entries. * chore: remove add_selected_outputs.py script * Deleted the add_selected_outputs.py script, which was responsible for adding selected_output fields to Langflow JSON template files. This script is no longer needed as part of the project. * chore: clean up Makefile by removing unnecessary blank line * Removed an extra blank line in the Makefile to improve readability and maintain consistency. * chore: tidy up Makefile by adding a blank line for better readability * Added a blank line before the help target in the Makefile to enhance readability and maintain consistency in formatting. * chore: remove unnecessary blank line in Makefile * Eliminated an extra blank line before the help target in the Makefile to enhance readability and maintain consistency in formatting. * [autofix.ci] apply automated fixes * fix(GenericNode): update output selection logic to use selected_output name * Modified the logic for selecting the initial output in GenericNode to match the selected_output name from the data object. * Adjusted the return logic in NodeOutputs to ensure it correctly handles the selected output state. * fix(GenericNode): refine output selection logic to prioritize selected outputs * Updated the output selection logic in the cleanEdges function to filter for selected outputs before finding the matching output by name. This change enhances the accuracy of output handling for generic nodes. * updated blog writer * fix: update Memory Chatbot configuration for improved message handling - Adjusted JSON structure for Memory Chatbot to ensure correct output types and display names. - Added new input fields for sender type and refined existing fields for clarity. - Enhanced message retrieval methods to support dynamic output based on selected modes. - Improved overall structure for better integration with Langflow components. * Update src/backend/base/langflow/custom/custom_component/component.py Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> * [autofix.ci] apply automated fixes * Ruff linting error fix * [autofix.ci] apply automated fixes * fix: Update test to reflect change in heading from "OpenAi" to "Language Model" --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: Eric Hare <ericrhare@gmail.com>
136 lines
4.6 KiB
TypeScript
136 lines
4.6 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
|
|
|
test(
|
|
"curl_api_generation",
|
|
{ tag: ["@release", "@workspace", "@api"] },
|
|
|
|
async ({ page, context }) => {
|
|
await awaitBootstrapTest(page);
|
|
|
|
await page.getByTestId("side_nav_options_all-templates").click();
|
|
await page.getByRole("heading", { name: "Basic Prompting" }).click();
|
|
await page.getByTestId("publish-button").click();
|
|
await page.getByTestId("api-access-item").click();
|
|
await page.getByRole("tab", { name: "cURL" }).click();
|
|
await page.getByTestId("icon-Copy").click();
|
|
const handle = await page.evaluateHandle(() =>
|
|
navigator.clipboard.readText(),
|
|
);
|
|
const clipboardContent = await handle.jsonValue();
|
|
const oldValue = clipboardContent;
|
|
expect(clipboardContent.length).toBeGreaterThan(0);
|
|
await page.getByTestId("tweaks-button").click();
|
|
await page
|
|
.getByRole("heading", { name: "Language Model" })
|
|
.locator("div")
|
|
.first()
|
|
.click();
|
|
|
|
await page.waitForSelector('[data-testid="showstream"]', {
|
|
timeout: 1000,
|
|
});
|
|
|
|
await page.getByTestId("showstream").first().click();
|
|
|
|
await page.getByText("Close").last().click();
|
|
|
|
await page.getByRole("tab", { name: "cURL" }).click();
|
|
await page.getByTestId("icon-Copy").click();
|
|
const handle2 = await page.evaluateHandle(() =>
|
|
navigator.clipboard.readText(),
|
|
);
|
|
const clipboardContent2 = await handle2.jsonValue();
|
|
const newValue = clipboardContent2;
|
|
expect(oldValue).not.toBe(newValue);
|
|
expect(clipboardContent2.length).toBeGreaterThan(clipboardContent.length);
|
|
await awaitBootstrapTest(page, { skipModal: true });
|
|
await page.getByText("Basic Prompting").first().click();
|
|
await page.getByTestId("publish-button").click();
|
|
await page.getByTestId("api-access-item").click();
|
|
expect(
|
|
await page.getByText("Input Schema (1)", { exact: true }).isVisible(),
|
|
);
|
|
},
|
|
);
|
|
|
|
test("check if tweaks are updating when someothing on the flow changes", async ({
|
|
page,
|
|
}) => {
|
|
await awaitBootstrapTest(page);
|
|
|
|
await page.waitForSelector('[data-testid="blank-flow"]', {
|
|
timeout: 30000,
|
|
});
|
|
|
|
await page.getByTestId("blank-flow").click();
|
|
await page.getByTestId("sidebar-search-input").click();
|
|
await page.getByTestId("sidebar-search-input").fill("Chroma");
|
|
|
|
await page.waitForSelector('[data-testid="vectorstoresChroma DB"]', {
|
|
timeout: 1000,
|
|
});
|
|
|
|
await page
|
|
.getByTestId("vectorstoresChroma DB")
|
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
|
await page.mouse.up();
|
|
await page.mouse.down();
|
|
|
|
await page.waitForSelector('[data-testid="fit_view"]', {
|
|
timeout: 100000,
|
|
});
|
|
|
|
await page.getByTestId("fit_view").click();
|
|
await page.getByTestId("zoom_out").click();
|
|
await page.getByTestId("zoom_out").click();
|
|
await page.getByTestId("zoom_out").click();
|
|
await page.getByTestId("popover-anchor-input-collection_name").click();
|
|
await page
|
|
.getByTestId("popover-anchor-input-collection_name")
|
|
.fill("collection_name_test_123123123!@#$&*(&%$@");
|
|
|
|
await page.getByTestId("popover-anchor-input-persist_directory").click();
|
|
await page
|
|
.getByTestId("popover-anchor-input-persist_directory")
|
|
.fill("persist_directory_123123123!@#$&*(&%$@");
|
|
|
|
const focusElementsOnBoard = async ({ page }) => {
|
|
const focusElements = await page.getByTestId("publish-button").first();
|
|
await focusElements.click();
|
|
};
|
|
|
|
await focusElementsOnBoard({ page });
|
|
|
|
await page.getByTestId("api-access-item").click();
|
|
|
|
await page.getByTestId("tweaks-button").click();
|
|
|
|
await page
|
|
.getByRole("heading", { name: "Chroma" })
|
|
.locator("div")
|
|
.first()
|
|
.click();
|
|
|
|
await page.getByText("collection_name_test_123123123!@#$&*(&%$@").isVisible();
|
|
await page.getByText("persist_directory_123123123!@#$&*(&%$@").isVisible();
|
|
|
|
await page.getByText("Close").last().click();
|
|
|
|
await page.getByText("Python", { exact: true }).click();
|
|
|
|
await page.getByText("collection_name_test_123123123!@#$&*(&%$@").isVisible();
|
|
await page.getByText("persist_directory_123123123!@#$&*(&%$@").isVisible();
|
|
|
|
await page.getByText("JavaScript", { exact: true }).click();
|
|
|
|
await page.getByText("collection_name_test_123123123!@#$&*(&%$@").isVisible();
|
|
await page.getByText("persist_directory_123123123!@#$&*(&%$@").isVisible();
|
|
|
|
await page.getByText("cURL", { exact: true }).click();
|
|
|
|
await page.getByText("collection_name_test_123123123!@#$&*(&%$@").isVisible();
|
|
await page.getByText("persist_directory_123123123!@#$&*(&%$@").isVisible();
|
|
|
|
expect(await page.getByText("Input Schema (2)", { exact: true }).isVisible());
|
|
});
|