[PR #295] [MERGED] feat: Make resource dependencies more flexible #300

Closed
opened 2026-02-16 02:17:10 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/295
Author: @adrianlyjak
Created: 1/22/2026
Status: Merged
Merged: 1/23/2026
Merged by: @adrianlyjak

Base: mainHead: adrian/recursive-resources


📝 Commits (7)

  • 92099d5 first pass
  • 04186b8 Capture locals better for inspecting deferred types
  • 1614fe7 better handle future annotations on resources
  • 389471a handle sadowing better
  • 8072d61 add get_dependencies
  • 9461baa Update tough-ghosts-try.md
  • b9e1a31 actually hash

📊 Changes

9 files changed (+823 additions, -97 deletions)

View changed files

.changeset/tough-ghosts-try.md (+9 -0)
📝 packages/llama-index-workflows/src/workflows/decorators.py (+79 -18)
📝 packages/llama-index-workflows/src/workflows/representation/build.py (+44 -18)
📝 packages/llama-index-workflows/src/workflows/resource.py (+195 -37)
📝 packages/llama-index-workflows/src/workflows/runtime/control_loop.py (+1 -1)
📝 packages/llama-index-workflows/src/workflows/runtime/types/step_function.py (+7 -5)
📝 packages/llama-index-workflows/src/workflows/utils.py (+37 -9)
packages/llama-index-workflows/tests/test_annotation_resolution.py (+183 -0)
📝 packages/llama-index-workflows/tests/test_resources.py (+268 -9)

📄 Description

  • Resources can now be injected into other Resources (recursively, with cycle detection)
  • ResourceConfigs can now be injected anywhere a Resource could
  • Better handle string / deferred types, usually in association with from __future__ import annotations, e.g. "Annotated[Foo, Resource(get_foo)]" vs Annotated[Foo, Resource(get_foo)]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/workflows-py/pull/295 **Author:** [@adrianlyjak](https://github.com/adrianlyjak) **Created:** 1/22/2026 **Status:** ✅ Merged **Merged:** 1/23/2026 **Merged by:** [@adrianlyjak](https://github.com/adrianlyjak) **Base:** `main` ← **Head:** `adrian/recursive-resources` --- ### 📝 Commits (7) - [`92099d5`](https://github.com/run-llama/workflows-py/commit/92099d57f2b3b7697e1d5021769869366e09d8f6) first pass - [`04186b8`](https://github.com/run-llama/workflows-py/commit/04186b8f57bd4a9180658cfc1a71d9166ca45278) Capture locals better for inspecting deferred types - [`1614fe7`](https://github.com/run-llama/workflows-py/commit/1614fe7b98d1d46b1decf73006a760009b074230) better handle future annotations on resources - [`389471a`](https://github.com/run-llama/workflows-py/commit/389471a248dcfe22084442fca4329a7befd7073c) handle sadowing better - [`8072d61`](https://github.com/run-llama/workflows-py/commit/8072d618b7c79dfba25d8b7c18e203b300bf012c) add get_dependencies - [`9461baa`](https://github.com/run-llama/workflows-py/commit/9461baae23047a3a60f88c430beb47773bb472ed) Update tough-ghosts-try.md - [`b9e1a31`](https://github.com/run-llama/workflows-py/commit/b9e1a312fcd98d1311acb38709f838ffa87b33c8) actually hash ### 📊 Changes **9 files changed** (+823 additions, -97 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/tough-ghosts-try.md` (+9 -0) 📝 `packages/llama-index-workflows/src/workflows/decorators.py` (+79 -18) 📝 `packages/llama-index-workflows/src/workflows/representation/build.py` (+44 -18) 📝 `packages/llama-index-workflows/src/workflows/resource.py` (+195 -37) 📝 `packages/llama-index-workflows/src/workflows/runtime/control_loop.py` (+1 -1) 📝 `packages/llama-index-workflows/src/workflows/runtime/types/step_function.py` (+7 -5) 📝 `packages/llama-index-workflows/src/workflows/utils.py` (+37 -9) ➕ `packages/llama-index-workflows/tests/test_annotation_resolution.py` (+183 -0) 📝 `packages/llama-index-workflows/tests/test_resources.py` (+268 -9) </details> ### 📄 Description - Resources can now be injected into other Resources (recursively, with cycle detection) - ResourceConfigs can now be injected anywhere a Resource could - Better handle string / deferred types, usually in association with `from __future__ import annotations`, e.g. `"Annotated[Foo, Resource(get_foo)]"` vs `Annotated[Foo, Resource(get_foo)]` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:17:10 -05:00
yindo closed this issue 2026-02-16 02:17:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/workflows-py#300