diff --git a/src/backend/base/langflow/components/output_parsers/OutputParser.py b/src/backend/base/langflow/components/output_parsers/OutputParser.py index ce32700a09f0..0dfa37273767 100644 --- a/src/backend/base/langflow/components/output_parsers/OutputParser.py +++ b/src/backend/base/langflow/components/output_parsers/OutputParser.py @@ -34,11 +34,11 @@ class OutputParserComponent(Component): def build_parser(self) -> OutputParser: if self.parser_type == "CSV": return CommaSeparatedListOutputParser() - else: - raise ValueError("Unsupported or missing parser") + msg = "Unsupported or missing parser" + raise ValueError(msg) def format_instructions(self) -> Message: if self.parser_type == "CSV": return Message(text=CommaSeparatedListOutputParser().get_format_instructions()) - else: - raise ValueError("Unsupported or missing parser") + msg = "Unsupported or missing parser" + raise ValueError(msg) diff --git a/src/backend/base/langflow/services/database/models/message/model.py b/src/backend/base/langflow/services/database/models/message/model.py index 8fbbfe057295..d7c82b62ba87 100644 --- a/src/backend/base/langflow/services/database/models/message/model.py +++ b/src/backend/base/langflow/services/database/models/message/model.py @@ -37,7 +37,9 @@ def from_message(cls, message: "Message", flow_id: str | UUID | None = None): if hasattr(file, "path") and hasattr(file, "url") and file.path: session_id = message.session_id image_paths.append(f"{session_id}{file.path.split(session_id)[1]}") - message.files = image_paths + if image_paths: + message.files = image_paths + if isinstance(message.timestamp, str): timestamp = datetime.fromisoformat(message.timestamp) else: diff --git a/src/frontend/tests/core/integrations/Simple Agent.spec.ts b/src/frontend/tests/core/integrations/Simple Agent.spec.ts index 26dafbefccfb..1c7568466f9b 100644 --- a/src/frontend/tests/core/integrations/Simple Agent.spec.ts +++ b/src/frontend/tests/core/integrations/Simple Agent.spec.ts @@ -1,6 +1,7 @@ import { expect, test } from "@playwright/test"; import * as dotenv from "dotenv"; import path from "path"; +import uaParser from "ua-parser-js"; test("Simple Agent", async ({ page }) => { test.skip( @@ -37,6 +38,14 @@ test("Simple Agent", async ({ page }) => { modalCount = await page.getByTestId("modal-title")?.count(); } + const getUA = await page.evaluate(() => navigator.userAgent); + const userAgentInfo = uaParser(getUA); + let control = "Control"; + + if (userAgentInfo.os.name.includes("Mac")) { + control = "Meta"; + } + await page.getByRole("heading", { name: "Simple Agent" }).click(); await page.waitForSelector('[title="fit view"]', { @@ -124,7 +133,7 @@ test("Simple Agent", async ({ page }) => { await page.waitForTimeout(500); - await page.keyboard.press("Control+V"); + await page.keyboard.press(`${control}+V`); await page.waitForTimeout(500);