wzhero1 opened a new pull request, #813:
URL: https://github.com/apache/flink-agents/pull/813

   Linked issue: #793
   
   ### Purpose of change
   
   Two documentation/API-contract clarifications on
   `docs/content/docs/development/workflow_agent.md`, per #793 (docs-only, no
   runtime/API change):
   
   - **Send Event snippet (Part 1)**: the previous snippet sent both a
     `ChatRequestEvent` and an `OutputEvent` from a single action, which is 
valid
     but misleading — at runtime an `OutputEvent` is emitted downstream 
immediately
     while the `ChatRequestEvent` continues through the chat-model path, so one
     input can produce both an immediate output and a later model-based output.
     Split it into two separate examples — **"Trigger another action"** (sends 
only
     `ChatRequestEvent`) and **"Emit downstream output"** (sends `OutputEvent` 
from
     the `ChatResponseEvent` handler) — and add a hint stating that 
`OutputEvent`
     is collected/emitted downstream immediately, bypassing action routing, 
while
     other events are routed to their listening actions.
   - **Custom event metadata contract (Part 2)**: the `from_event` / `fromEvent`
     examples did not say whether base `Event` metadata should be preserved.
     Document the contract — reconstruction should preserve the base `id` (both
     languages) and `sourceTimestamp` (Java only, runtime-internal; the Python
     `Event` has no equivalent) — matching all built-in events, and update the
     `MyEvent` example to follow it (Python assigns `result.id = event.id` last
     because the content-based id regenerates on field changes; Java gains a
     `@JsonCreator` id-accepting constructor and carries `sourceTimestamp` when
     present).
   
   ### Tests
   
   Documentation-only change; no runtime impact. Verified manually:
   - Both claims audited against source: all 8 built-in Java events and 8 Python
     events preserve `id` in their `fromEvent` / `from_event`; Java additionally
     preserves `sourceTimestamp`; `ActionExecutionOperator.processEvent` 
collects
     `OutputEvent` downstream immediately and routes all other events to 
triggered
     actions.
   - The updated `MyEvent` Java snippet compiles (JDK 11 + Flink 2.2.0 
classpath)
     and runs — `fromEvent` preserves both `id` and `sourceTimestamp`. The 
Python
     snippet runs in the venv — `from_event` preserves a custom `id`.
   - Hugo shortcodes are balanced (tabs/tab/hint), all tab-group ids are unique,
     and code fences are even.
   
   ### API
   
   No public API changes.
   
   ### Documentation
   
   - [ ] `doc-needed`
   - [ ] `doc-not-needed`
   - [x] `doc-included`
   
   Closes #793
   


-- 
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]

Reply via email to