Files
langflow/scripts/ci/update_starter_projects.py
Eric Hare 662f0695c8 fix: Proper support for VLM in Docling (#10094)
* fix: Proper support for VLM in Docling

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Update file.py

* [autofix.ci] apply automated fixes

* Update pyproject.toml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Update uv.lock

* Fix project specs

* Add jpg as accepted file type

* [autofix.ci] apply automated fixes

* Update dep structure

* One more attempt at getting this right

* And again

* Add docling core

* Update pyproject.toml

* Update deps

* [autofix.ci] apply automated fixes

* Update knowledge_bases.py

* Package version bumps

* Add pytest tests for advanced mode

* Update test_file_component.py

* Update test_file_component.py

* Make pipeline a visible option in advanced mode

* Feat tool mode files (#10107)

* feat: Tool Mode Support for File Components

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: Better support for advanced parser in File Component (#10048)

* feat: Better support for advanced parser in files

* [autofix.ci] apply automated fixes

* Add docling mocked tests

* Update file.py

* Update test_file_component.py

* [autofix.ci] apply automated fixes

* Update News Aggregator.json

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Update file.py

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-03 18:39:33 +00:00

44 lines
1.7 KiB
Python

"""Script to update Langflow starter projects with the latest component versions."""
import asyncio
import os
import langflow.main # noqa: F401
from langflow.initial_setup.setup import (
get_project_data,
load_starter_projects,
update_edges_with_latest_component_versions,
update_project_file,
update_projects_components_with_latest_component_versions,
)
from langflow.services.utils import initialize_services
from lfx.interface.components import get_and_cache_all_types_dict
from lfx.services.deps import get_settings_service
async def main():
"""Updates the starter projects with the latest component versions.
Copies the code from langflow/initial_setup/setup.py. Doesn't use the
create_or_update_starter_projects function directly to avoid sql interactions.
"""
await initialize_services(fix_migration=False)
all_types_dict = await get_and_cache_all_types_dict(get_settings_service())
starter_projects = await load_starter_projects()
for project_path, project in starter_projects:
_, _, _, _, project_data, _, _, _, _ = get_project_data(project)
do_update_starter_projects = os.environ.get("LANGFLOW_UPDATE_STARTER_PROJECTS", "true").lower() == "true"
if do_update_starter_projects:
updated_project_data = update_projects_components_with_latest_component_versions(
project_data.copy(), all_types_dict
)
updated_project_data = update_edges_with_latest_component_versions(updated_project_data)
if updated_project_data != project_data:
project_data = updated_project_data
await update_project_file(project_path, project, updated_project_data)
if __name__ == "__main__":
asyncio.run(main())