Merge branch 'dev' into python_custom_node_component
This commit is contained in:
commit
d7a13755b3
8 changed files with 156 additions and 408 deletions
19
README.md
19
README.md
|
|
@ -51,9 +51,24 @@
|
||||||
You can install Langflow from pip:
|
You can install Langflow from pip:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
# This installs the package without dependencies for local models
|
||||||
pip install langflow
|
pip install langflow
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To use local models (e.g llama-cpp-python) run:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
pip install langflow[local]
|
||||||
|
```
|
||||||
|
|
||||||
|
This will install the following dependencies:
|
||||||
|
|
||||||
|
- [CTransformers](https://github.com/marella/ctransformers)
|
||||||
|
- [llama-cpp-python](https://github.com/abetlen/llama-cpp-python)
|
||||||
|
- [sentence-transformers](https://github.com/UKPLab/sentence-transformers)
|
||||||
|
|
||||||
|
You can still use models from projects like LocalAI
|
||||||
|
|
||||||
Next, run:
|
Next, run:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|
@ -74,7 +89,7 @@ You can also check it out on [HuggingFace Spaces](https://huggingface.co/spaces/
|
||||||
|
|
||||||
Langflow provides a command-line interface (CLI) for easy management and configuration.
|
Langflow provides a command-line interface (CLI) for easy management and configuration.
|
||||||
|
|
||||||
### Usage
|
## Usage
|
||||||
|
|
||||||
You can run the Langflow using the following command:
|
You can run the Langflow using the following command:
|
||||||
|
|
||||||
|
|
@ -127,6 +142,8 @@ Langflow integrates with langchain-serve to provide a one-command deployment to
|
||||||
Start by installing `langchain-serve` with
|
Start by installing `langchain-serve` with
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
pip install langflow[deploy]
|
||||||
|
# or
|
||||||
pip install -U langchain-serve
|
pip install -U langchain-serve
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
501
poetry.lock
generated
501
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -37,9 +37,9 @@ langchain = "^0.0.240"
|
||||||
openai = "^0.27.8"
|
openai = "^0.27.8"
|
||||||
pandas = "^2.0.0"
|
pandas = "^2.0.0"
|
||||||
chromadb = "^0.3.21"
|
chromadb = "^0.3.21"
|
||||||
huggingface-hub = "^0.15.0"
|
huggingface-hub = { version = "^0.16.0", extras = ["inference"] }
|
||||||
rich = "^13.4.2"
|
rich = "^13.4.2"
|
||||||
llama-cpp-python = "~0.1.0"
|
llama-cpp-python = { version = "~0.1.0", optional = true }
|
||||||
networkx = "^3.1"
|
networkx = "^3.1"
|
||||||
unstructured = "^0.7.0"
|
unstructured = "^0.7.0"
|
||||||
pypdf = "^3.11.0"
|
pypdf = "^3.11.0"
|
||||||
|
|
@ -56,8 +56,8 @@ qdrant-client = "^1.3.0"
|
||||||
websockets = "^10.3"
|
websockets = "^10.3"
|
||||||
weaviate-client = "^3.21.0"
|
weaviate-client = "^3.21.0"
|
||||||
jina = "3.15.2"
|
jina = "3.15.2"
|
||||||
sentence-transformers = "^2.2.2"
|
sentence-transformers = { version = "^2.2.2", optional = true }
|
||||||
ctransformers = "^0.2.10"
|
ctransformers = { version = "^0.2.10", optional = true }
|
||||||
cohere = "^4.11.0"
|
cohere = "^4.11.0"
|
||||||
python-multipart = "^0.0.6"
|
python-multipart = "^0.0.6"
|
||||||
sqlmodel = "^0.0.8"
|
sqlmodel = "^0.0.8"
|
||||||
|
|
@ -76,7 +76,7 @@ google-cloud-aiplatform = "^1.26.1"
|
||||||
psycopg = "^3.1.9"
|
psycopg = "^3.1.9"
|
||||||
psycopg-binary = "^3.1.9"
|
psycopg-binary = "^3.1.9"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
black = "^23.1.0"
|
black = "^23.1.0"
|
||||||
ipykernel = "^6.21.2"
|
ipykernel = "^6.21.2"
|
||||||
mypy = "^1.1.1"
|
mypy = "^1.1.1"
|
||||||
|
|
@ -94,6 +94,9 @@ types-pyyaml = "^6.0.12.8"
|
||||||
|
|
||||||
[tool.poetry.extras]
|
[tool.poetry.extras]
|
||||||
deploy = ["langchain-serve"]
|
deploy = ["langchain-serve"]
|
||||||
|
local = ["llama-cpp-python", "sentence-transformers", "ctransformers"]
|
||||||
|
all = ["deploy", "local"]
|
||||||
|
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
minversion = "6.0"
|
minversion = "6.0"
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,8 @@ memories:
|
||||||
documentation: "https://python.langchain.com/docs/modules/memory/how_to/vectorstore_retriever_memory"
|
documentation: "https://python.langchain.com/docs/modules/memory/how_to/vectorstore_retriever_memory"
|
||||||
MongoDBChatMessageHistory:
|
MongoDBChatMessageHistory:
|
||||||
documentation: "https://python.langchain.com/docs/modules/memory/integrations/mongodb_chat_message_history"
|
documentation: "https://python.langchain.com/docs/modules/memory/integrations/mongodb_chat_message_history"
|
||||||
|
MotorheadMemory:
|
||||||
|
documentation: "https://python.langchain.com/docs/integrations/memory/motorhead_memory"
|
||||||
prompts:
|
prompts:
|
||||||
ChatMessagePromptTemplate:
|
ChatMessagePromptTemplate:
|
||||||
documentation: "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates"
|
documentation: "https://python.langchain.com/docs/modules/model_io/prompts/prompt_templates/msg_prompt_templates"
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,14 @@ class MemoryFrontendNode(FrontendNode):
|
||||||
field.show = False
|
field.show = False
|
||||||
field.required = False
|
field.required = False
|
||||||
|
|
||||||
|
if name == "MotorheadMemory":
|
||||||
|
if field.name == "chat_memory":
|
||||||
|
field.show = False
|
||||||
|
field.required = False
|
||||||
|
elif field.name == "client_id":
|
||||||
|
field.show = True
|
||||||
|
field.advanced = False
|
||||||
|
|
||||||
|
|
||||||
class PostgresChatMessageHistoryFrontendNode(MemoryFrontendNode):
|
class PostgresChatMessageHistoryFrontendNode(MemoryFrontendNode):
|
||||||
name: str = "PostgresChatMessageHistory"
|
name: str = "PostgresChatMessageHistory"
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import {
|
||||||
import { APIClassType, APITemplateType } from "../types/api";
|
import { APIClassType, APITemplateType } from "../types/api";
|
||||||
import { FlowType, NodeType } from "../types/flow";
|
import { FlowType, NodeType } from "../types/flow";
|
||||||
import { TabsContextType, TabsState } from "../types/tabs";
|
import { TabsContextType, TabsState } from "../types/tabs";
|
||||||
import { updateIds, updateTemplate } from "../utils/reactflowUtils";
|
import { addVersionToDuplicates, updateIds, updateTemplate } from "../utils/reactflowUtils";
|
||||||
import { getRandomDescription, getRandomName } from "../utils/utils";
|
import { getRandomDescription, getRandomName } from "../utils/utils";
|
||||||
import { alertContext } from "./alertContext";
|
import { alertContext } from "./alertContext";
|
||||||
import { typesContext } from "./typesContext";
|
import { typesContext } from "./typesContext";
|
||||||
|
|
@ -450,6 +450,10 @@ export function TabsProvider({ children }: { children: ReactNode }) {
|
||||||
processFlowEdges(newFlow);
|
processFlowEdges(newFlow);
|
||||||
processFlowNodes(newFlow);
|
processFlowNodes(newFlow);
|
||||||
|
|
||||||
|
const flowName = addVersionToDuplicates(newFlow, flows);
|
||||||
|
|
||||||
|
newFlow.name = flowName;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { id } = await saveFlowToDatabase(newFlow);
|
const { id } = await saveFlowToDatabase(newFlow);
|
||||||
// Change the id to the new id.
|
// Change the id to the new id.
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ function BaseModal({
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case "smaller":
|
case "smaller":
|
||||||
minWidth = "min-w-[40vw]";
|
minWidth = "min-w-[40vw]";
|
||||||
height = "h-[25vh]";
|
height = "h-[27vh]";
|
||||||
break;
|
break;
|
||||||
case "small":
|
case "small":
|
||||||
minWidth = "min-w-[40vw]";
|
minWidth = "min-w-[40vw]";
|
||||||
|
|
|
||||||
|
|
@ -219,3 +219,16 @@ export function validateNodes(reactFlowInstance: ReactFlowInstance) {
|
||||||
.getNodes()
|
.getNodes()
|
||||||
.flatMap((n: NodeType) => validateNode(n, reactFlowInstance));
|
.flatMap((n: NodeType) => validateNode(n, reactFlowInstance));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function addVersionToDuplicates(flow: FlowType, flows: FlowType[]) {
|
||||||
|
const existingNames = flows.map((item) => item.name);
|
||||||
|
let newName = flow.name;
|
||||||
|
let count = 1;
|
||||||
|
|
||||||
|
while (existingNames.includes(newName)) {
|
||||||
|
newName = `${flow.name} (${count})`;
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return newName;
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue