refactor: Search API component ensuring standard output pattern (#5435)

* refactor: Update Search API component to standard output pattern

* fix: rename component class to avoid conflict with legacy version

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* fix: address performance regression

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
This commit is contained in:
Raphael Valdetaro 2025-01-20 12:43:22 -03:00 • committed by GitHub
commit a9559515e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 106 additions and 27 deletions

View file

@ -1,5 +1,6 @@
import { expect, test } from "@playwright/test";
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
import { zoomOut } from "../../utils/zoom-out";
test(
"user should be able to use ComposIO without getting api_key error",
@ -42,53 +43,49 @@ test(
async ({ page }) => {
await awaitBootstrapTest(page);
await page.waitForSelector('[data-testid="blank-flow"]', {
timeout: 30000,
});
await page.getByTestId("blank-flow").click();
//first component
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("search api");
await page.waitForSelector('[data-testid="toolsSearch API"]', {
timeout: 3000,
timeout: 1000,
});
let modelElement = await page.getByTestId("toolsSearch API");
let targetElement = await page.locator('//*[@id="react-flow-id"]');
await modelElement.dragTo(targetElement);
await zoomOut(page, 3);
await page.mouse.up();
await page.mouse.down();
await page.getByTestId("fit_view").click();
await page.getByTestId("zoom_out").click();
await page.getByTestId("zoom_out").click();
await page
.getByTestId("toolsSearch API")
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
targetPosition: { x: 100, y: 100 },
});
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("tool calling agent");
await page.waitForSelector(
'[data-testid="langchain_utilitiesTool Calling Agent"]',
{
timeout: 3000,
timeout: 1000,
},
);
modelElement = page.getByTestId("langchain_utilitiesTool Calling Agent");
targetElement = await page.locator('//*[@id="react-flow-id"]');
await modelElement.dragTo(targetElement);
await page.mouse.up();
await page.mouse.down();
await page
.getByTestId("langchain_utilitiesTool Calling Agent")
.dragTo(page.locator('//*[@id="react-flow-id"]'), {
targetPosition: { x: 300, y: 300 },
});
await page.getByTestId("fit_view").click();
await page.getByTestId("zoom_out").click();
await page.getByTestId("zoom_out").click();
await page.getByTestId("title-Search API").first().click();
await page.getByTestId("tool-mode-button").click();
//connection
const searchApiOutput = await page
.getByTestId("handle-searchapi-shownode-tool-right")
.nth(0);
.getByTestId("handle-searchcomponent-shownode-toolset-right")
.first();
await searchApiOutput.hover();
await page.mouse.down();
const toolCallingAgentInput = await page