[PR #134] [MERGED] Add type validators, and return full types to support extensability #153

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

📋 Pull Request Information

Original PR: https://github.com/run-llama/workflows-py/pull/134
Author: @adrianlyjak
Created: 10/10/2025
Status: Merged
Merged: 10/10/2025
Merged by: @adrianlyjak

Base: clelia/workflows-clientHead: adrian/workflows-client-edits


📝 Commits (4)

  • 8357f02 Add type validators, and return full types to support extensability
  • d14a8bc Test edits
  • e26512a switch to pydantic
  • d47b17a fix deserialization duplication

📊 Changes

12 files changed (+292 additions, -225 deletions)

View changed files

📝 examples/client/base/workflow_client.py (+8 -28)
📝 examples/client/base/workflow_server.py (+4 -16)
📝 examples/client/human_in_the_loop/workflow_client_hitl.py (+3 -2)
📝 src/workflows/client/client.py (+42 -37)
src/workflows/protocol/__init__.py (+90 -0)
📝 src/workflows/server/representation_utils.py (+25 -17)
📝 src/workflows/server/server.py (+46 -31)
📝 src/workflows/server/utils.py (+0 -29)
📝 tests/client/test_client.py (+61 -19)
📝 tests/server/test_handler_serialization.py (+6 -4)
📝 tests/server/test_utils.py (+1 -40)
📝 uv.lock (+6 -2)

📄 Description

Adds TypedDict objects that are shared between client and server, so that the types don't wander and inconsistencies are obvious.

Additonally refactors the client return results to prefer returning the whole object. This makes future changes easy to be non-breaking in the types. For example we are free to add add pagination and pagination fields to the handler list response.

Also somewhat backs out of the serdes. I think that's confusingly typed right now, and our event request/response typing is in a little bit of a flux. Trying to keep things simple for now to avoid implementations wandering. In the future I think we can clean this up a bit more


🔄 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/134 **Author:** [@adrianlyjak](https://github.com/adrianlyjak) **Created:** 10/10/2025 **Status:** ✅ Merged **Merged:** 10/10/2025 **Merged by:** [@adrianlyjak](https://github.com/adrianlyjak) **Base:** `clelia/workflows-client` ← **Head:** `adrian/workflows-client-edits` --- ### 📝 Commits (4) - [`8357f02`](https://github.com/run-llama/workflows-py/commit/8357f02935f2f706e649e5129465e10885871344) Add type validators, and return full types to support extensability - [`d14a8bc`](https://github.com/run-llama/workflows-py/commit/d14a8bcfc36add1507de92dc303a855ab187323a) Test edits - [`e26512a`](https://github.com/run-llama/workflows-py/commit/e26512a2948001bb6b2658d17d83470be6c0902e) switch to pydantic - [`d47b17a`](https://github.com/run-llama/workflows-py/commit/d47b17a61246c1639a4ae7647a81408354c0b7b9) fix deserialization duplication ### 📊 Changes **12 files changed** (+292 additions, -225 deletions) <details> <summary>View changed files</summary> 📝 `examples/client/base/workflow_client.py` (+8 -28) 📝 `examples/client/base/workflow_server.py` (+4 -16) 📝 `examples/client/human_in_the_loop/workflow_client_hitl.py` (+3 -2) 📝 `src/workflows/client/client.py` (+42 -37) ➕ `src/workflows/protocol/__init__.py` (+90 -0) 📝 `src/workflows/server/representation_utils.py` (+25 -17) 📝 `src/workflows/server/server.py` (+46 -31) 📝 `src/workflows/server/utils.py` (+0 -29) 📝 `tests/client/test_client.py` (+61 -19) 📝 `tests/server/test_handler_serialization.py` (+6 -4) 📝 `tests/server/test_utils.py` (+1 -40) 📝 `uv.lock` (+6 -2) </details> ### 📄 Description Adds TypedDict objects that are shared between client and server, so that the types don't wander and inconsistencies are obvious. Additonally refactors the client return results to prefer returning the whole object. This makes future changes easy to be non-breaking in the types. For example we are free to add add pagination and pagination fields to the handler list response. Also somewhat backs out of the serdes. I think that's confusingly typed right now, and our event request/response typing is in a little bit of a flux. Trying to keep things simple for now to avoid implementations wandering. In the future I think we can clean this up a bit more --- <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:16:45 -05:00
yindo closed this issue 2026-02-16 02:16:45 -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#153