mirror of
https://github.com/run-llama/workflows-py.git
synced 2026-07-20 01:04:22 -04:00
9910929b82
* chore: add llama_index to gitignore Added cloned reference repository llama_index/ to gitignore to avoid tracking the large external repository. * feat: add llama-index-integration-tests package Add a new internal (not published) package for running integration tests against llama-index-core workflow abstractions. This ensures that updates to the workflows package don't break the agent classes in llama-index-core. Includes tests for: - FunctionAgent: basic execution, tools, max iterations, context handling - ReActAgent: basic execution, retry on parse errors, memory persistence - AgentWorkflow: multi-agent execution, handoff, memory, event streaming Uses a custom MockFunctionCallingLLM to mock LLM responses without external dependencies, ensuring tests run reliably. * refactor: use llama-index-core MockFunctionCallingLLM - Update llama-index-core dependency to >= 0.14.13 - Remove custom mock_llm.py, use built-in MockFunctionCallingLLM - Enable test_early_stopping_method_generate (no longer needs skip) All 12 integration tests now pass. * fix: improve integration tests package - Update basedpyright config to Python 3.13 - Fix ruff format/check issues (sorted imports, removed unused imports) - Remove unused conftest.py fixture - Add workflow feature tests: - wait_for_event inside tool functions (HITL pattern) - Context state management via ctx.store - Pickle serialization for workflow pause/resume - Multiple sequential tool calls with shared state All 16 tests pass. * refactor: reorganize integration tests by workflow feature - Organize tests by workflow capability rather than agent type: - test_context_store.py: ctx.store.get/set operations - test_event_streaming.py: stream_events() and event types - test_human_in_the_loop.py: wait_for_event, serialization - test_error_handling.py: max_iterations, early stopping - Add pytest parameterization for FunctionAgent vs ReActAgent where applicable (non-tool tests use both; tool-based tests use FunctionAgent only since it uses function calling format) - Move helper functions to src/llama_index_integration_tests/helpers.py to avoid conftest.py import issues - Remove tests/__init__.py to fix mypy duplicate module error - Add type: ignore comments for Event dynamic fields * fix ci * better types * type fixes/ignores * Update packages/llama-index-integration-tests/src/llama_index_integration_tests/helpers.py Co-authored-by: Clelia (Astra) Bertelli <133636879+AstraBert@users.noreply.github.com> * fix * add to ci * 3.9 compat --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Clelia (Astra) Bertelli <133636879+AstraBert@users.noreply.github.com>
94 lines
2.2 KiB
TOML
94 lines
2.2 KiB
TOML
[build-system]
|
|
requires = ["uv_build>=0.9.10,<0.10.0"]
|
|
build-backend = "uv_build"
|
|
|
|
[dependency-groups]
|
|
dev = [
|
|
"pytest-xdist>=3.8.0",
|
|
"ruff>=0.14.5",
|
|
"ty>=0.0.1,<0.0.9"
|
|
]
|
|
|
|
[project]
|
|
name = "llama-agents-workspace"
|
|
version = "0.1.0"
|
|
description = "Monorepo workspace for the LlamaIndex Workflows packages."
|
|
readme = "README.md"
|
|
license = "MIT"
|
|
requires-python = ">=3.9"
|
|
|
|
[tool.basedpyright]
|
|
typeCheckingMode = "standard"
|
|
|
|
[[tool.basedpyright.executionEnvironments]]
|
|
root = "packages/llama-index-workflows"
|
|
pythonVersion = "3.9"
|
|
|
|
[[tool.basedpyright.executionEnvironments]]
|
|
root = "packages/llama-index-utils-workflow"
|
|
pythonVersion = "3.9"
|
|
|
|
[[tool.basedpyright.executionEnvironments]]
|
|
root = "packages/workflows-dev"
|
|
pythonVersion = "3.14"
|
|
|
|
[[tool.basedpyright.executionEnvironments]]
|
|
root = "packages/llama-index-integration-tests"
|
|
pythonVersion = "3.13"
|
|
|
|
[[tool.basedpyright.executionEnvironments]]
|
|
root = "examples"
|
|
pythonVersion = "3.14"
|
|
|
|
[tool.coverage.run]
|
|
omit = ["**/tests/*"]
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
# default flake8 rules
|
|
"E4",
|
|
"E7",
|
|
"E9",
|
|
"F", # Pyflakes rules https://docs.astral.sh/ruff/rules/#pyflakes-f
|
|
"I", # sort imports https://docs.astral.sh/ruff/rules/#isort-i
|
|
"UP007", # Use X | Y for type annotations
|
|
"UP045", # Use X | None for type annotations
|
|
"ANN001", # Missing type annotation for function argument {name}
|
|
"ANN002", # Missing type annotation for *{name}
|
|
"ANN003", # Missing type annotation for **{name}
|
|
"T201" # no print statements
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
# "tests/*" = ["D", "D100", "D101"]
|
|
"examples/**/*" = ["T201"]
|
|
"packages/*/tests/**/*" = [
|
|
"T201",
|
|
# remove UP007 and UP045 after removing 3.9 support
|
|
"UP007",
|
|
"UP045"
|
|
]
|
|
"*.ipynb" = ["T201", "ANN001", "ANN002", "ANN003"]
|
|
"__main__.py" = ["T201"]
|
|
|
|
[tool.ty.src]
|
|
exclude = ["**/uv.lock", "**/.gitignore"]
|
|
|
|
[tool.uv.sources]
|
|
llama-index-workflows = {workspace = true}
|
|
llama-index-utils-workflow = {workspace = true}
|
|
workflows-dev = {workspace = true}
|
|
llama-index-integration-tests = {workspace = true}
|
|
|
|
[tool.uv.workspace]
|
|
members = [
|
|
"packages/llama-index-workflows",
|
|
"packages/llama-index-utils-workflow",
|
|
"packages/workflows-dev",
|
|
"packages/llama-index-integration-tests",
|
|
"docs/api_docs"
|
|
]
|