wenjin272 commented on issue #424: URL: https://github.com/apache/flink-agents/issues/424#issuecomment-4404691125
Hi, @addu390, thank you for your contribution! The code PR has been merged. After reviewing the relevant documentation, I found that the introduction to `Event` needs to be updated and supplemented with additional content. The current introduction to `Event` is located in [docs/content/docs/development/workflow_agent.md](https://github.com/apache/flink-agents/blob/77a2ca4d200ebc95ffd1af681e674301dd49c71b/docs/content/docs/development/workflow_agent.md?plain=1#L493), and it still describes the original typed event. I think we need introduce: 1. Unified event ``` # send event in one action ctx.send_event(Event(type="my_event", attributes={"field1": "test", "field2": 42})) # consume event in another action field1: str = event.get_attr("field1") ``` 2. Json SerDe ``` input_data = ItemData.model_validate(InputEvent.from_event(event).input) ``` The field of a non-trivial type loses its type information after JSON serialization and deserialization, requiring users to manually reconstruct the object of the specific type. (This is only required for Python actions, not for Java actions, because event passing between Java actions does not require serialization.) 3. For subclass event, user need implement `from_event` method, and do validation and deserialization. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
