[PR #541] [MERGED] Add an option to get raw serialized event in event stream #538

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

📋 Pull Request Information

Original PR: https://github.com/run-llama/llama_deploy/pull/541
Author: @leehuwuj
Created: 6/16/2025
Status: Merged
Merged: 6/17/2025
Merged by: @masci

Base: mainHead: lee/serialize-event


📝 Commits (4)

  • 0f22c7c use JsonSerializer to serialize whole event object
  • 853d917 update api document
  • 8b27f0f fix wrong event type
  • 04ca51a fix e2e tests and linting issue

📊 Changes

5 files changed (+66 additions, -16 deletions)

View changed files

📝 docs/docs/module_guides/llama_deploy/apiserver.json (+1 -1)
📝 e2e_tests/basic_streaming/test_run_client.py (+6 -4)
📝 llama_deploy/apiserver/routers/deployments.py (+15 -3)
📝 llama_deploy/services/workflow.py (+2 -1)
📝 tests/apiserver/routers/test_deployments.py (+42 -7)

📄 Description

Use the default llamaindex's JsonSerializer to serialize whole event object and send to event stream instead of just event data.

  • Benefit:
    We have the same format of format when receiving and sending event to external system (as we are also using it in sending API, so it makes sense to me to have the same format in receiving API).
  • Disadvantage:
    The format doesn't look nice for external system with unnecessary fields like __is_pydantic or qualified_name.
    -> I think later on we can consider using a mapping to map the name with qualified name and store the mapping in deployment file or workflow context? Then we can get rid of the __is_pydantic and qualified_name

For backward compatibility, I added a new flag to the /{deployment_name}/tasks/{task_id}/events API that the user can choose whether they want to get raw event or not.


🔄 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/llama_deploy/pull/541 **Author:** [@leehuwuj](https://github.com/leehuwuj) **Created:** 6/16/2025 **Status:** ✅ Merged **Merged:** 6/17/2025 **Merged by:** [@masci](https://github.com/masci) **Base:** `main` ← **Head:** `lee/serialize-event` --- ### 📝 Commits (4) - [`0f22c7c`](https://github.com/run-llama/llama_deploy/commit/0f22c7c68f09c7a70e38418a5ae4fe1a4d607cf8) use JsonSerializer to serialize whole event object - [`853d917`](https://github.com/run-llama/llama_deploy/commit/853d91721935ca91f296aec4b4a099210d2b2bcd) update api document - [`8b27f0f`](https://github.com/run-llama/llama_deploy/commit/8b27f0fad8a0f432c44cf0109886010bbf215780) fix wrong event type - [`04ca51a`](https://github.com/run-llama/llama_deploy/commit/04ca51a84455bcfe5f3d34fb014ad537c13e4b95) fix e2e tests and linting issue ### 📊 Changes **5 files changed** (+66 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/docs/module_guides/llama_deploy/apiserver.json` (+1 -1) 📝 `e2e_tests/basic_streaming/test_run_client.py` (+6 -4) 📝 `llama_deploy/apiserver/routers/deployments.py` (+15 -3) 📝 `llama_deploy/services/workflow.py` (+2 -1) 📝 `tests/apiserver/routers/test_deployments.py` (+42 -7) </details> ### 📄 Description Use the default llamaindex's JsonSerializer to serialize whole event object and send to event stream instead of just event data. + Benefit: We have the same format of format when receiving and sending event to external system (as we are also using it in sending API, so it makes sense to me to have the same format in receiving API). + Disadvantage: The format doesn't look nice for external system with unnecessary fields like `__is_pydantic` or `qualified_name`. -> I think later on we can consider using a mapping to map the name with qualified name and store the mapping in deployment file or workflow context? Then we can get rid of the `__is_pydantic` and `qualified_name` For backward compatibility, I added a new flag to the `/{deployment_name}/tasks/{task_id}/events` API that the user can choose whether they want to get raw event or not. --- <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:15:32 -05:00
yindo closed this issue 2026-02-16 02:15:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_deploy#538