stream_publish
Publish already-read numeric point data to a NATS message bus for downstream integration, skipping non-numeric values.
Instructions
[READ][risk=low] Publish already-read normalized points to a message bus (NATS).
Egress of data the agent already READ — NOT a control write. Each numeric point becomes a JSON
message on ``<subject_prefix>.tag.<metric>``; non-numeric points are skipped (use a historian
sink for text/state). Needs the extra: pip install iaiops[nats].
Args:
points: Collected point dicts (e.g. from *_read_many): {ref/metric, value, timestamp, ...}.
subject_prefix: NATS subject root (default 'iaiops').
servers: Comma-separated NATS server URLs (default nats://localhost:4222).
token: Optional NATS auth token.
tls: Use TLS to the broker.
publisher: Bus kind (currently 'nats').
Returns dict: {publisher, subject_prefix, received, published, skipped_non_numeric}.
Example: stream_publish(points=[{"ref": "line1.temp", "value": 21.5}], subject_prefix="plant").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tls | No | ||
| token | No | ||
| points | Yes | ||
| servers | No | nats://localhost:4222 | |
| publisher | No | nats | |
| subject_prefix | No | iaiops |