fix zustand

This commit is contained in:
cristhianzl 2024-03-28 11:59:32 -03:00
commit f13d7ecab4
119 changed files with 2517 additions and 2077 deletions

View file

@ -305,10 +305,7 @@
"_type": "initialize_agent"
},
"description": "Construct a zero shot agent from an LLM and tools.",
"base_classes": [
"AgentExecutor",
"function"
],
"base_classes": ["AgentExecutor", "function"],
"display_name": "AgentInitializer"
},
"id": "AgentInitializer-QiQ4x",
@ -372,9 +369,7 @@
"_type": "PythonFunctionTool"
},
"description": "Python function to be executed.",
"base_classes": [
"Tool"
],
"base_classes": ["Tool"],
"display_name": "PythonFunctionTool"
},
"id": "PythonFunctionTool-kX99N",
@ -434,9 +429,7 @@
"selected": false,
"data": {
"sourceHandle": {
"baseClasses": [
"Tool"
],
"baseClasses": ["Tool"],
"dataType": "PythonFunctionTool",
"id": "PythonFunctionTool-kX99N"
},
@ -822,10 +815,7 @@
"_type": "initialize_agent"
},
"description": "Construct a zero shot agent from an LLM and tools.",
"base_classes": [
"AgentExecutor",
"function"
],
"base_classes": ["AgentExecutor", "function"],
"display_name": "AgentInitializer"
},
"id": "AgentInitializer-YJgqs",
@ -889,9 +879,7 @@
"_type": "PythonFunctionTool"
},
"description": "Python function to be executed.",
"base_classes": [
"Tool"
],
"base_classes": ["Tool"],
"display_name": "PythonFunctionTool"
},
"id": "PythonFunctionTool-gqQDg",
@ -951,9 +939,7 @@
"selected": false,
"data": {
"sourceHandle": {
"baseClasses": [
"Tool"
],
"baseClasses": ["Tool"],
"dataType": "PythonFunctionTool",
"id": "PythonFunctionTool-gqQDg"
},
@ -1339,10 +1325,7 @@
"_type": "initialize_agent"
},
"description": "Construct a zero shot agent from an LLM and tools.",
"base_classes": [
"AgentExecutor",
"function"
],
"base_classes": ["AgentExecutor", "function"],
"display_name": "AgentInitializer"
},
"id": "AgentInitializer-grV0u",
@ -1406,9 +1389,7 @@
"_type": "PythonFunctionTool"
},
"description": "Python function to be executed.",
"base_classes": [
"Tool"
],
"base_classes": ["Tool"],
"display_name": "PythonFunctionTool"
},
"id": "PythonFunctionTool-SctM2",
@ -1468,9 +1449,7 @@
"selected": false,
"data": {
"sourceHandle": {
"baseClasses": [
"Tool"
],
"baseClasses": ["Tool"],
"dataType": "PythonFunctionTool",
"id": "PythonFunctionTool-SctM2"
},
@ -2210,10 +2189,7 @@
"_type": "initialize_agent"
},
"description": "Construct a zero shot agent from an LLM and tools.",
"base_classes": [
"AgentExecutor",
"function"
],
"base_classes": ["AgentExecutor", "function"],
"display_name": "AgentInitializer"
},
"id": "AgentInitializer-EE8R4",
@ -2277,9 +2253,7 @@
"_type": "PythonFunctionTool"
},
"description": "Python function to be executed.",
"base_classes": [
"Tool"
],
"base_classes": ["Tool"],
"display_name": "PythonFunctionTool"
},
"id": "PythonFunctionTool-YKkDL",
@ -2339,9 +2313,7 @@
"selected": false,
"data": {
"sourceHandle": {
"baseClasses": [
"Tool"
],
"baseClasses": ["Tool"],
"dataType": "PythonFunctionTool",
"id": "PythonFunctionTool-YKkDL"
},
@ -2727,10 +2699,7 @@
"_type": "initialize_agent"
},
"description": "Construct a zero shot agent from an LLM and tools.",
"base_classes": [
"AgentExecutor",
"function"
],
"base_classes": ["AgentExecutor", "function"],
"display_name": "AgentInitializer"
},
"id": "AgentInitializer-goPm2",
@ -2794,9 +2763,7 @@
"_type": "PythonFunctionTool"
},
"description": "Python function to be executed.",
"base_classes": [
"Tool"
],
"base_classes": ["Tool"],
"display_name": "PythonFunctionTool"
},
"id": "PythonFunctionTool-SQikY",
@ -2856,9 +2823,7 @@
"selected": false,
"data": {
"sourceHandle": {
"baseClasses": [
"Tool"
],
"baseClasses": ["Tool"],
"dataType": "PythonFunctionTool",
"id": "PythonFunctionTool-SQikY"
},
@ -2881,4 +2846,4 @@
"user_id": "6f6ebc2c-9e7a-4c35-84fc-51760db10d9b"
}
]
}
}

View file

@ -46,9 +46,7 @@
"dynamic": false,
"info": "",
"title_case": false,
"input_types": [
"Text"
]
"input_types": ["Text"]
},
"name": {
"type": "str",
@ -66,9 +64,7 @@
"dynamic": false,
"info": "",
"title_case": false,
"input_types": [
"Text"
]
"input_types": ["Text"]
},
"return_direct": {
"type": "bool",
@ -90,10 +86,7 @@
"_type": "PythonFunctionTool"
},
"description": "Python function to be executed.",
"base_classes": [
"BaseTool",
"Tool"
],
"base_classes": ["BaseTool", "Tool"],
"display_name": "PythonFunctionTool",
"documentation": "",
"custom_fields": {},
@ -208,9 +201,7 @@
"dynamic": false,
"info": "",
"title_case": false,
"input_types": [
"Text"
]
"input_types": ["Text"]
},
"code": {
"type": "code",
@ -269,10 +260,7 @@
"max_iterations": null,
"memory": null
},
"output_types": [
"AgentExecutor",
"Callable"
],
"output_types": ["AgentExecutor", "Callable"],
"field_formatters": {},
"pinned": false,
"beta": true
@ -372,9 +360,7 @@
"dynamic": false,
"info": "",
"title_case": false,
"input_types": [
"Text"
]
"input_types": ["Text"]
},
"openai_api_base": {
"type": "str",
@ -392,9 +378,7 @@
"dynamic": false,
"info": "The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\nYou can change this to use other APIs like JinaChat, LocalAI and Prem.",
"title_case": false,
"input_types": [
"Text"
]
"input_types": ["Text"]
},
"openai_api_key": {
"type": "str",
@ -412,9 +396,7 @@
"dynamic": false,
"info": "",
"title_case": false,
"input_types": [
"Text"
]
"input_types": ["Text"]
},
"temperature": {
"type": "float",
@ -462,10 +444,7 @@
"openai_api_key": null,
"temperature": null
},
"output_types": [
"BaseLanguageModel",
"BaseLLM"
],
"output_types": ["BaseLanguageModel", "BaseLLM"],
"field_formatters": {},
"pinned": false,
"beta": true
@ -528,10 +507,7 @@
"type": "Tool"
},
"sourceHandle": {
"baseClasses": [
"BaseTool",
"Tool"
],
"baseClasses": ["BaseTool", "Tool"],
"dataType": "PythonFunctionTool",
"id": "PythonFunctionTool-RfJui"
}
@ -553,4 +529,4 @@
"name": "Untitled document (20)",
"last_tested_version": "0.7.0a0",
"is_component": false
}
}

View file

@ -62,27 +62,21 @@
"name": "text_input",
"display_name": "Text Input",
"advanced": false,
"input_types": [
"str"
],
"input_types": ["str"],
"dynamic": false,
"info": "",
"value": ""
},
"_type": "CustomComponent"
},
"base_classes": [
"str"
],
"base_classes": ["str"],
"display_name": "text checkpoint",
"documentation": "http://docs.langflow.org/components/custom",
"custom_fields": {
"save_path": null,
"text_input": null
},
"output_types": [
"str"
],
"output_types": ["str"],
"field_formatters": {},
"beta": true
},
@ -161,18 +155,14 @@
"_type": "CustomComponent"
},
"description": "Converts audio to text using OpenAI's Whisper.",
"base_classes": [
"str"
],
"base_classes": ["str"],
"display_name": "Whisper Transcriber",
"documentation": "",
"custom_fields": {
"OpenAIKey": null,
"audio": null
},
"output_types": [
"str"
],
"output_types": ["str"],
"field_formatters": {},
"beta": true
},
@ -196,15 +186,11 @@
"targetHandle": {
"fieldName": "text_input",
"id": "CustomComponent-MtJjl",
"inputTypes": [
"str"
],
"inputTypes": ["str"],
"type": "str"
},
"sourceHandle": {
"baseClasses": [
"str"
],
"baseClasses": ["str"],
"dataType": "CustomComponent",
"id": "CustomComponent-7NQoq"
}
@ -228,4 +214,4 @@
"folder": null,
"id": "1b0814b7-2964-4e09-9b4b-f7413c4fb50b",
"user_id": "8b5cf798-f1b8-4108-88fd-d7274d08d471"
}
}

View file

@ -1,5 +1,4 @@
import { expect, test } from "@playwright/test";
import { readFileSync } from "fs";
test.describe("group node test", () => {
/// <reference lib="dom"/>
@ -7,71 +6,24 @@ test.describe("group node test", () => {
await page.goto("http:localhost:3000/");
await page.locator('//*[@id="new-project-btn"]').click();
await page.getByTestId("blank-flow").click();
await page.waitForTimeout(1000);
// Read your file into a buffer.
const jsonContent = readFileSync(
"tests/end-to-end/assets/flow_group_test.json",
"utf-8"
);
// Create the DataTransfer and File
const dataTransfer = await page.evaluateHandle((data) => {
const dt = new DataTransfer();
// Convert the buffer to a hex array
const file = new File([data], "flow_group_test.json", {
type: "application/json",
});
dt.items.add(file);
return dt;
}, jsonContent);
await page.waitForTimeout(1000);
// Now dispatch
await page.dispatchEvent(
"//*[@id='react-flow-id']/div[1]/div[1]/div",
"drop",
{
dataTransfer,
}
);
const genericNoda = page.getByTestId("div-generic-node");
const elementCount = await genericNoda.count();
if (elementCount > 0) {
expect(true).toBeTruthy();
}
await page.getByRole("heading", { name: "Data Ingestion" }).click();
await page.waitForTimeout(2000);
await page.getByLabel("fit view").click();
await page.keyboard.down("Control");
await page
.locator('//*[@id="react-flow-id"]/div[1]/div[2]/button[3]')
.click();
await page.getByTestId("title-Agent Initializer").click({
modifiers: ["Control"],
});
await page.getByTestId("title-PythonFunctionTool").click({
modifiers: ["Control"],
});
await page.getByTestId("title-ChatOpenAI").click({
modifiers: ["Control"],
});
.getByTestId("title-OpenAIEmbeddings")
.click({ modifiers: ["Control"] });
await page.getByTestId("title-URL").click({ modifiers: ["Control"] });
await page
.getByTestId("title-Recursive Character Text Splitter")
.click({ modifiers: ["Control"] });
await page.keyboard.up("Control");
await page.getByRole("button", { name: "Group" }).click();
const textArea = page.getByTestId("div-textarea-description");
const elementCountText = await textArea.count();
if (elementCountText > 0) {
expect(true).toBeTruthy();
}
const groupNode = page.getByTestId("title-Group");
const elementGroup = await groupNode.count();
if (elementGroup > 0) {
expect(true).toBeTruthy();
}
// Now dispatch
await page.getByTestId(/input-collection_name_Chroma-.*/).click();
await page.getByTestId(/input-collection_name_Chroma-.*/).fill("test");
await page.getByTestId("title-Group").click();
await page.keyboard.press("Control+g");
const value = await page.getByTestId("input-collection_name").inputValue();
expect(value).toBe("test");
});
});