rosemarYuan commented on code in PR #869:
URL: https://github.com/apache/flink-agents/pull/869#discussion_r3527645484
##########
api/src/main/java/org/apache/flink/agents/api/event/ChatResponseEvent.java:
##########
@@ -46,7 +48,10 @@ public ChatResponseEvent(
setAttr("total_retry_wait_sec", totalRetryWaitSec);
}
- public ChatResponseEvent(UUID id, Map<String, Object> attributes) {
+ @JsonCreator
+ public ChatResponseEvent(
+ @JsonProperty("id") UUID id,
+ @JsonProperty("attributes") Map<String, Object> attributes) {
super(id, EVENT_TYPE, attributes);
Review Comment:
The custom-event hint in workflow_agent.md already notes this.
`If the subclass stores typed objects in attributes, convert them back to
their typed forms inside this constructor too, as the built-in events do.`
Based on this, I added a code example under that hint showing how the
built-in events do it, using ChatResponseEvent's creator and its
normalizeAttributes helper.
--
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]