Skip to content

Commit ff64c93

Browse files
rvirani1claude
andauthored
Add Event Writer docstrings and industrial section to block docs (#2214)
* Add Event Writer docstrings and industrial section to block docs (#ENT-1106) - Add docstrings to BlockManifest, EventWriterSinkBlockV1, and run() so mkdocstrings renders content on the API reference page - Add "industrial" entry to BLOCK_SECTIONS so industrial blocks (Event Writer, OPC Writer, MQTT Writer, PLC Ethernet/IP, PLC Modbus) appear in the workflow block docs nav and index Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * Move Event Writer block from industrial to data_storage section Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * Trim Event Writer docstrings to match PLC block style Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * List Event Writer in both data_storage and industrial doc sections Adds additional_sections support to build_block_docs.py so a block can appear in multiple doc sections. Event Writer uses this to show up under both Data Storage (its primary section) and Industrial. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> * Use industrial section for Event Writer, drop additional_sections logic Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
1 parent 5df1795 commit ff64c93

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

development/docs/build_block_docs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ def render_template(template_name, **kwargs):
249249
"title": "Advanced",
250250
"id": "advanced",
251251
"colorScheme": "orange"
252+
},
253+
{
254+
"title": "Industrial",
255+
"id": "industrial",
256+
"colorScheme": "gray"
252257
}
253258
]
254259

inference/enterprise/workflows/enterprise_blocks/sinks/event_writer/v1.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@
9595

9696

9797
class BlockManifest(WorkflowBlockManifest):
98+
"""Manifest for the Event Writer sink block.
99+
100+
Sends structured events to the Event Ingestion Service via its v2 API.
101+
Each event includes a schema (quality_check, inventory_count, safety_alert,
102+
or custom), schema-specific data, one image entry with optional annotations,
103+
and optional flat key-value custom metadata.
104+
"""
105+
98106
model_config = ConfigDict(
99107
json_schema_extra={
100108
"name": "Event Writer",
@@ -294,6 +302,13 @@ def get_execution_engine_compatibility(cls) -> Optional[str]:
294302

295303

296304
class EventWriterSinkBlockV1(WorkflowBlock):
305+
"""Sends structured events to the Event Ingestion Service via its v2 API.
306+
307+
Supports fire-and-forget (default) or synchronous execution modes.
308+
In fire-and-forget mode the HTTP request runs in the background and
309+
``event_id`` will be empty. In synchronous mode the block waits for
310+
the response and returns the created ``event_id``.
311+
"""
297312

298313
def __init__(
299314
self,
@@ -336,6 +351,19 @@ def run(
336351
instance_segmentations: Optional[Any] = None,
337352
keypoint_detections: Optional[Any] = None,
338353
) -> BlockResult:
354+
"""Build and send a v2 event to the Event Ingestion Service.
355+
356+
Args:
357+
event_ingestion_url (str): Base URL of the Event Ingestion Service.
358+
event_schema (str): One of 'quality_check', 'inventory_count', 'safety_alert', or 'custom'.
359+
output_image (WorkflowImageData): The output/visualization image sent as the primary display image.
360+
fire_and_forget (bool): When True the request runs in the background and event_id will be empty.
361+
disable_sink (bool): When True the block is skipped entirely.
362+
request_timeout (int): HTTP request timeout in seconds.
363+
364+
Returns:
365+
dict: A dictionary with ``error_status`` (bool), ``event_id`` (str), and ``message`` (str).
366+
"""
339367
if disable_sink:
340368
return {
341369
"error_status": False,

0 commit comments

Comments
 (0)