feat: change Text to Message type with backend and frontend support (#5652)
* ✨ (inputs.py): Update default prompt input types to include "MessageTextInput" for improved user experience 📝 (styleUtils.ts): Add color definition for "MessageTextInput" node to enhance visual representation in the frontend * 📝 (text.py): Update input_types for "Value" to include "Message" for better clarity 📝 (memory.py): Update input_types for "Session ID" to include "Message" for consistency 📝 (message.py): Update input_types for "Session ID" to include "Message" for uniformity 📝 (self_query.py): Update input_types for "Query" to only include "Message" for consistency 📝 (create_data.py): Update input_types for fields to only include "Message" for consistency 📝 (update_data.py): Update input_types for fields to only include "Message" for consistency 📝 (inputs.py): Update DEFAULT_PROMPT_INTUT_TYPES to only include "Message" for consistency 📝 (styleUtils.ts): Remove "MessageTextInput" from nodeColors and nodeColorsName for consistency * 📝 (model.py): update display name from "Text" to "Message" for better clarity 📝 (url.py): update display name from "Text" to "Message" for better consistency 📝 (memory.py): update display name from "Text" to "Message" for better understanding 📝 (text.py): update display name from "Text" to "Message" for better semantics 📝 (llm_math.py): update display name from "Text" to "Message" for improved readability 📝 (runnable_executor.py): update display name from "Text" to "Message" for better context 📝 (sql_generator.py): update display name from "Text" to "Message" for clearer communication 📝 (text.py): update display name from "Text" to "Message" for better consistency 📝 (parse_data.py): update display name from "Text" to "Message" for enhanced understanding 📝 (wikidata_api.py): update display name from "Text" to "Message" for improved semantics 📝 (test_cycles.py): update display name from "Text" to "Message" for better clarity * [autofix.ci] apply automated fixes * 🔧 (App.css): change width property value to fit-content to improve layout responsiveness * fix: resolve merge conflicts and clean up URLComponent implementation in starter projects - Removed conflicting sections in the JSON files for 'Custom Component Maker' and 'Graph Vector Store RAG'. - Ensured the URLComponent class is correctly defined with methods for URL validation and content fetching. - Updated input and output definitions for better clarity and functionality. * 🐛 (freeze.spec.ts): fix incorrect test selectors for handle-textinput-shownode and handle-parsedata-shownode elements to match updated element IDs * 📝 (NodeOutputfield/index.tsx): Add id prop to InspectButton component for better identification 🔧 (freeze-path.spec.ts, freeze.spec.ts, stop-building.spec.ts, decisionFlow.spec.ts, similarity.spec.ts, textInputOutput.spec.ts, generalBugs-shard-5.spec.ts, fileUploadComponent.spec.ts): Update test selectors to match changes in UI components for better test accuracy * ✨ (duckduckgo.spec.ts): update the test to click on a specific element with the test ID "output-inspection-data-duckduckgosearch" instead of "output-inspection-data" to match the updated frontend implementation. * ✨ (youtube-transcripts.spec.ts): update selector for clicking on transcript element to match changes in the frontend code, ensuring the test remains accurate --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
160452673c
commit
9dc6c24180
44 changed files with 186 additions and 156 deletions
|
|
@ -101,6 +101,7 @@ const InspectButton = memo(
|
|||
isToolMode,
|
||||
title,
|
||||
onClick,
|
||||
id,
|
||||
}: {
|
||||
disabled: boolean | undefined;
|
||||
displayOutputPreview: boolean;
|
||||
|
|
@ -109,10 +110,11 @@ const InspectButton = memo(
|
|||
isToolMode: boolean;
|
||||
title: string;
|
||||
onClick: () => void;
|
||||
id: string;
|
||||
}) => (
|
||||
<Button
|
||||
disabled={disabled}
|
||||
data-testid={`output-inspection-${title.toLowerCase()}`}
|
||||
data-testid={`output-inspection-${title.toLowerCase()}-${id.toLowerCase()}`}
|
||||
unstyled
|
||||
onClick={onClick}
|
||||
>
|
||||
|
|
@ -338,6 +340,7 @@ function NodeOutputField({
|
|||
onClick={() => {
|
||||
//just to trigger the memoization
|
||||
}}
|
||||
id={data?.type}
|
||||
/>
|
||||
</OutputModal>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -65,14 +65,20 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByTestId("output-inspection-text").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
const randomTextGeneratedByAI = await page
|
||||
.getByPlaceholder("Empty")
|
||||
.first()
|
||||
.inputValue();
|
||||
|
||||
await page.getByText("Close").first().click();
|
||||
await page.getByText("Close").last().click();
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.waitForSelector('[data-testid="default_slider_display_value"]', {
|
||||
timeout: 1000,
|
||||
|
|
@ -95,14 +101,20 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByTestId("output-inspection-text").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
const secondRandomTextGeneratedByAI = await page
|
||||
.getByPlaceholder("Empty")
|
||||
.first()
|
||||
.inputValue();
|
||||
|
||||
await page.getByText("Close").first().click();
|
||||
await page.getByText("Close").last().click();
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
await page.waitForSelector("text=OpenAI", {
|
||||
timeout: 1000,
|
||||
|
|
@ -140,14 +152,20 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.getByTestId("output-inspection-text").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
const thirdRandomTextGeneratedByAI = await page
|
||||
.getByPlaceholder("Empty")
|
||||
.first()
|
||||
.inputValue();
|
||||
|
||||
await page.getByText("Close").first().click();
|
||||
await page.getByText("Close").last().click();
|
||||
await page.getByText("Close").last().click();
|
||||
|
||||
expect(randomTextGeneratedByAI).not.toEqual(secondRandomTextGeneratedByAI);
|
||||
expect(randomTextGeneratedByAI).not.toEqual(thirdRandomTextGeneratedByAI);
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ test(
|
|||
|
||||
//connection 2
|
||||
const textOutput = await page
|
||||
.getByTestId("handle-textinput-shownode-text-right")
|
||||
.getByTestId("handle-textinput-shownode-message-right")
|
||||
.nth(0);
|
||||
await textOutput.hover();
|
||||
await page.mouse.down();
|
||||
|
|
@ -150,7 +150,7 @@ test(
|
|||
|
||||
//connection 4
|
||||
const parseDataOutput = await page
|
||||
.getByTestId("handle-parsedata-shownode-text-right")
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.nth(0);
|
||||
await parseDataOutput.hover();
|
||||
await page.mouse.down();
|
||||
|
|
@ -177,11 +177,17 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[data-testid="output-inspection-message"]', {
|
||||
timeout: 1000,
|
||||
});
|
||||
await page.waitForSelector(
|
||||
'[data-testid="output-inspection-message-chatoutput"]',
|
||||
{
|
||||
timeout: 1000,
|
||||
},
|
||||
);
|
||||
|
||||
await page.getByTestId("output-inspection-message").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
|
|
@ -203,11 +209,17 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[data-testid="output-inspection-message"]', {
|
||||
timeout: 1000,
|
||||
});
|
||||
await page.waitForSelector(
|
||||
'[data-testid="output-inspection-message-chatoutput"]',
|
||||
{
|
||||
timeout: 1000,
|
||||
},
|
||||
);
|
||||
|
||||
await page.getByTestId("output-inspection-message").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
|
|
@ -253,11 +265,17 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[data-testid="output-inspection-message"]', {
|
||||
timeout: 1000,
|
||||
});
|
||||
await page.waitForSelector(
|
||||
'[data-testid="output-inspection-message-chatoutput"]',
|
||||
{
|
||||
timeout: 1000,
|
||||
},
|
||||
);
|
||||
|
||||
await page.getByTestId("output-inspection-message").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
|
|
@ -292,11 +310,17 @@ test(
|
|||
timeout: 15000,
|
||||
});
|
||||
|
||||
await page.waitForSelector('[data-testid="output-inspection-message"]', {
|
||||
timeout: 1000,
|
||||
});
|
||||
await page.waitForSelector(
|
||||
'[data-testid="output-inspection-message-chatoutput"]',
|
||||
{
|
||||
timeout: 1000,
|
||||
},
|
||||
);
|
||||
|
||||
await page.getByTestId("output-inspection-message").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByRole("gridcell").nth(4).click();
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ test(
|
|||
//
|
||||
|
||||
const elementsTextOutputRight = await page
|
||||
.locator('[data-testid="handle-textoutput-shownode-text-right"]')
|
||||
.locator('[data-testid="handle-textoutput-shownode-message-right"]')
|
||||
.all();
|
||||
|
||||
for (const element of elementsTextOutputRight) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ test(
|
|||
|
||||
//connection 2
|
||||
const textOutput = await page
|
||||
.getByTestId("handle-textinput-shownode-text-right")
|
||||
.getByTestId("handle-textinput-shownode-message-right")
|
||||
.nth(0);
|
||||
await textOutput.hover();
|
||||
await page.mouse.down();
|
||||
|
|
@ -113,7 +113,7 @@ test(
|
|||
|
||||
//connection 4
|
||||
const parseDataOutput = await page
|
||||
.getByTestId("handle-parsedata-shownode-text-right")
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.nth(0);
|
||||
await parseDataOutput.hover();
|
||||
await page.mouse.down();
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ test(
|
|||
.nth(2)
|
||||
.click();
|
||||
await page
|
||||
.getByTestId("handle-parsedata-shownode-text-right")
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
//quebrando aqui
|
||||
|
|
@ -264,7 +264,7 @@ test(
|
|||
.nth(0)
|
||||
.click();
|
||||
await page
|
||||
.getByTestId("handle-parsedata-shownode-text-right")
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.nth(2)
|
||||
.click();
|
||||
await page
|
||||
|
|
@ -288,7 +288,7 @@ test(
|
|||
.nth(0)
|
||||
.click();
|
||||
await page
|
||||
.getByTestId("handle-openaimodel-shownode-text-right")
|
||||
.getByTestId("handle-openaimodel-shownode-message-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ test(
|
|||
|
||||
//connection 7
|
||||
const parseDataOutput = await page
|
||||
.getByTestId("handle-parsedata-shownode-text-right")
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.nth(0);
|
||||
await parseDataOutput.hover();
|
||||
await page.mouse.down();
|
||||
|
|
@ -245,7 +245,7 @@ test(
|
|||
|
||||
await page
|
||||
.getByTestId(/rf__node-TextOutput-[a-zA-Z0-9]{5}/)
|
||||
.getByTestId("output-inspection-text")
|
||||
.getByTestId("output-inspection-message-textoutput")
|
||||
.first()
|
||||
.click();
|
||||
const valueSimilarity = await page.getByTestId("textarea").textContent();
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ test.skip(
|
|||
await page.getByTestId("button_run_text_output").click();
|
||||
await page
|
||||
.getByTestId(/^rf__node-TextOutput-[a-zA-Z0-9]+$/)
|
||||
.getByTestId("output-inspection-text")
|
||||
.getByTestId("output-inspection-message-chatoutput")
|
||||
.click();
|
||||
await page.getByText("Run Flow", { exact: true }).click();
|
||||
await page.waitForTimeout(5000);
|
||||
|
|
|
|||
|
|
@ -88,13 +88,13 @@ test(
|
|||
await elementCombineTextOutput0.click();
|
||||
|
||||
const blockedHandle = page
|
||||
.getByTestId("div-handle-textinput-shownode-text-right")
|
||||
.getByTestId("div-handle-textinput-shownode-message-right")
|
||||
.first();
|
||||
const secondBlockedHandle = page
|
||||
.getByTestId("div-handle-combinetext-shownode-combined text-right")
|
||||
.nth(3);
|
||||
const thirdBlockedHandle = page
|
||||
.getByTestId("div-handle-textoutput-shownode-text-right")
|
||||
.getByTestId("div-handle-textoutput-shownode-message-right")
|
||||
.first();
|
||||
|
||||
const hasGradient = await blockedHandle?.evaluate((el) => {
|
||||
|
|
@ -170,7 +170,7 @@ test(
|
|||
await page
|
||||
.getByTestId("title-Combine Text")
|
||||
.first()
|
||||
.click({ modifiers: ["Control"] });
|
||||
.click({ modifiers: ["ControlOrMeta"] });
|
||||
|
||||
await page.waitForSelector('[data-testid="group-node"]', {
|
||||
timeout: 3000,
|
||||
|
|
@ -181,7 +181,7 @@ test(
|
|||
|
||||
//connection 1
|
||||
const elementTextOutput0 = page
|
||||
.getByTestId("handle-textinput-shownode-text-right")
|
||||
.getByTestId("handle-textinput-shownode-message-right")
|
||||
.nth(0);
|
||||
await elementTextOutput0.click();
|
||||
const elementGroupInput0 = page.getByTestId(
|
||||
|
|
@ -191,7 +191,7 @@ test(
|
|||
|
||||
//connection 2
|
||||
const elementTextOutput1 = page
|
||||
.getByTestId("handle-textinput-shownode-text-right")
|
||||
.getByTestId("handle-textinput-shownode-message-right")
|
||||
.nth(4);
|
||||
await elementTextOutput1.click();
|
||||
const elementGroupInput1 = page
|
||||
|
|
@ -201,7 +201,7 @@ test(
|
|||
|
||||
//connection 3
|
||||
const elementTextOutput2 = page
|
||||
.getByTestId("handle-textinput-shownode-text-right")
|
||||
.getByTestId("handle-textinput-shownode-message-right")
|
||||
.nth(2);
|
||||
await elementTextOutput2.click();
|
||||
|
||||
|
|
@ -243,9 +243,14 @@ test(
|
|||
});
|
||||
|
||||
expect(
|
||||
await page.getByTestId("output-inspection-combined text").first(),
|
||||
await page
|
||||
.getByTestId("output-inspection-combined text-groupnode")
|
||||
.first(),
|
||||
).not.toBeDisabled();
|
||||
await page.getByTestId("output-inspection-combined text").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-combined text-groupnode")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByText("Component Output").isVisible();
|
||||
|
||||
|
|
|
|||
|
|
@ -94,40 +94,14 @@ test(
|
|||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
|
||||
// Click and hold on the first element
|
||||
|
||||
const parseDataOutputElement = await page
|
||||
.getByTestId("handle-parsedata-shownode-text-right")
|
||||
.all();
|
||||
|
||||
for (const element of parseDataOutputElement) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await page.getByTitle("fit view").click();
|
||||
|
||||
await visibleElementHandle.hover();
|
||||
await page.mouse.down();
|
||||
|
||||
// Move to the second element
|
||||
const chatOutputElement = await page
|
||||
await page
|
||||
.getByTestId("handle-parsedata-shownode-message-right")
|
||||
.first()
|
||||
.click();
|
||||
await page
|
||||
.getByTestId("handle-chatoutput-noshownode-text-target")
|
||||
.all();
|
||||
|
||||
for (const element of chatOutputElement) {
|
||||
if (await element.isVisible()) {
|
||||
visibleElementHandle = element;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
await visibleElementHandle.hover();
|
||||
|
||||
// Release the mouse
|
||||
await page.mouse.up();
|
||||
.first()
|
||||
.click();
|
||||
|
||||
await page.getByText("Playground", { exact: true }).last().click();
|
||||
|
||||
|
|
@ -135,7 +109,7 @@ test(
|
|||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByText("Run Flow", { exact: true }).click();
|
||||
await page.getByText("Run Flow", { exact: true }).last().click();
|
||||
|
||||
await expect(page.getByText("this is a test file")).toBeVisible({
|
||||
timeout: 3000,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,10 @@ test(
|
|||
"built successfully",
|
||||
) ?? false;
|
||||
|
||||
await page.getByTestId("output-inspection-data").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-data-duckduckgosearch")
|
||||
.first()
|
||||
.click();
|
||||
|
||||
if (isBuiltSuccessfully) {
|
||||
await page.getByRole("gridcell").first().click();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,10 @@ test.skip(
|
|||
|
||||
await page.waitForSelector("text=built successfully", { timeout: 3000 });
|
||||
|
||||
await page.getByTestId("output-inspection-transcript").first().click();
|
||||
await page
|
||||
.getByTestId("output-inspection-transcript-youtube-transcripts")
|
||||
.first()
|
||||
.click();
|
||||
await page.waitForSelector("text=Component Output", { timeout: 3000 });
|
||||
await page.getByRole("gridcell").first().click();
|
||||
const value = await page.getByPlaceholder("Empty").inputValue();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue