Split Langflow into Langflow and Langflow Base (#1562)
* Initial Restructure * Replace import langflow for import langflow_base * Fix dependencies * 🔧 chore(Makefile): refactor build process to separate base and frontend builds for better organization and maintainability * 🚀 chore(Makefile): update build_frontend command to copy frontend build to the correct directory 🔖 chore(pyproject.toml): update python and httpx dependencies versions 🔧 chore(__init__.py): update import statement for load_flow_from_json function * 🔖 chore(pyproject.toml): update package version from 0.0.6 to 0.0.8 to reflect changes in the codebase * 🚀 feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics 🚀 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port * 🐛 fix(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics ✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🚚 chore(pyproject.toml): update langflow-base version from 0.0.8 to 0.0.10 ✨ feat(server.ts): add new agent component LCAgentComponent to langflow_base ✨ feat(server.ts): add new model component LCModelComponent to langflow_base ✨ feat(server.ts): add new helper functions docs_to_records and records_to_text to langflow_base ✨ feat(server.ts): add new flow helper functions list_flows, load_flow, run_flow, generate_function_for_flow, get_flow_inputs, build_schema_from_inputs to langflow_base ✨ feat(server.ts): add new prompt component PromptComponent to langflow_base ✨ feat(server.ts): add new chat components ChatInput and ChatOutput to langflow_base ✨ feat(server.ts): add new model component OpenAIModelComponent to langflow_base 🚚 chore(main.py): update import path from langflow.main to langflow_base.main 🚚 chore(service.py): update import path from langflow.services.database.manager to langflow_base.services.database.manager 🚚 chore(factory.py): update import path from langflow.services to langflow_base.services 🚚 chore(service.py): update import path from langflow.services.plugins to langflow_base.services.plugins 🚚 chore(utils.py): update import path from langflow.services to langflow_base.services 🚚 chore(validate.py): update import path from langflow.field_typing to langflow_base.field_typing 🚚 chore(pyproject.toml): update langflow-base version from 0.0.8 to 0.0.10 * Update Makefile to install backend dependencies and build langflow * Add langflow main module and update __init__.py * Update langflow install process to use implicit namespace * Add langflow-base as a local dependency * Add setup_poetry target to Makefile * Update Poetry version and add poetry-monorepo-dependency-plugin * Refactor code to improve performance and readability * Update imports to custom and load * Update content-hash in poetry.lock --------- Co-authored-by: Matheus <jacquesmats@gmail.com> Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@logspace.ai>
This commit is contained in:
parent
9c0bad3883
commit
8172e62236
466 changed files with 5418 additions and 1144 deletions
44
Makefile
44
Makefile
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
all: help
|
||||
|
||||
setup_poetry:
|
||||
pipx install poetry
|
||||
poetry self add poetry-monorepo-dependency-plugin
|
||||
|
||||
init:
|
||||
@echo 'Installing backend dependencies'
|
||||
make install_backend
|
||||
|
|
@ -28,7 +32,7 @@ format:
|
|||
|
||||
lint:
|
||||
make install_backend
|
||||
poetry run mypy src/backend/langflow
|
||||
poetry run mypy src/backend
|
||||
poetry run ruff . --fix
|
||||
|
||||
install_frontend:
|
||||
|
|
@ -69,6 +73,7 @@ frontendc:
|
|||
|
||||
install_backend:
|
||||
poetry install --extras deploy
|
||||
poetry run pip install -e src/backend/base/.
|
||||
|
||||
backend:
|
||||
make install_backend
|
||||
|
|
@ -82,24 +87,35 @@ else
|
|||
endif
|
||||
|
||||
build_and_run:
|
||||
echo 'Removing dist folder'
|
||||
@echo 'Removing dist folder'
|
||||
rm -rf dist
|
||||
make build && poetry run pip install dist/*.tar.gz && poetry run langflow run
|
||||
rm -rf src/backend/base/dist
|
||||
make build
|
||||
poetry run pip install dist/*.tar.gz && pip install src/backend/base/dist/*.tar.gz
|
||||
poetry run langflow run
|
||||
|
||||
build_and_install:
|
||||
echo 'Removing dist folder'
|
||||
@echo 'Removing dist folder'
|
||||
rm -rf dist
|
||||
make build && poetry run pip install dist/*.tar.gz
|
||||
rm -rf src/backend/base/dist
|
||||
make build && poetry run pip install dist/*.tar.gz && pip install src/backend/base/dist/*.tar.gz
|
||||
|
||||
build_frontend:
|
||||
cd src/frontend && CI='' npm run build
|
||||
cp -r src/frontend/build src/backend/langflow/frontend
|
||||
cp -r src/frontend/build src/backend/base/langflow/frontend
|
||||
|
||||
build:
|
||||
make build_langflow_base
|
||||
make build_langflow
|
||||
|
||||
build_langflow:
|
||||
poetry build-rewrite-path-deps --version-pinning-strategy=semver
|
||||
|
||||
build_langflow_base:
|
||||
make install_frontend
|
||||
make build_frontend
|
||||
poetry build --format sdist
|
||||
rm -rf src/backend/langflow/frontend
|
||||
cd src/backend/base && poetry build-rewrite-path-deps --version-pinning-strategy=semver
|
||||
rm -rf src/backend/base/langflow/frontend
|
||||
|
||||
dev:
|
||||
make install_frontend
|
||||
|
|
@ -111,10 +127,18 @@ else
|
|||
docker compose $(if $(debug),-f docker-compose.debug.yml) up
|
||||
endif
|
||||
|
||||
publish:
|
||||
make build
|
||||
publish_base:
|
||||
make build_langflow_base
|
||||
cd src/backend/base && poetry publish
|
||||
|
||||
publish_langflow:
|
||||
make build_langflow
|
||||
poetry publish
|
||||
|
||||
publish:
|
||||
make publish_base
|
||||
make publish_langflow
|
||||
|
||||
help:
|
||||
@echo '----'
|
||||
@echo 'format - run code formatters'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue