agentops-rpc
Shared Pydantic wire types for the AgentOps SDK and controlplane.
Both the SDK (komodor-agentops) and the controlplane import models from this
package, giving build-time (mypy) and runtime (Pydantic v2) type safety across
the wire boundary.
Install
pip install agentops-rpc
Quick Start
from agentops_rpc import RunEventIn, IngestRunEventsRequest, HOOK_EVENT_TYPE_MAP
event = RunEventIn(
event_type="span.started",
span_id="span_abc",
kind="tool",
name="Bash",
hook_event_type="tool.start",
)
event.model_dump() # JSON-safe dict
request = IngestRunEventsRequest(worker_id="wrk_1", events=[event])
Exported Models
types.py -- Literal type aliases
| Type | Values |
|---|---|
EventType |
run.started, run.completed, run.failed, span.started, span.ended, message.created, log.created, token.created, custom.created, output.updated |
RunStatus |
queued, claimed, running, succeeded, failed |
SpanKind |
agent, llm, tool, chain, generation |
HookEventName |
SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, SubagentStart, SubagentStop, Notification, Stop, SessionEnd, PermissionRequest, PreCompact, PostCompact |
HookEventType |
session.start, prompt.submit, tool.start, tool.end, tool.error, subagent.start, subagent.end, notification, session.stop, compaction.start, compaction.end |
AgentStatus |
online, offline |
RunTransport |
polling, api_sync, api_sse, a2a |
events.py -- Event ingest models
RunEventIn-- unified event sent SDK -> controlplaneTraceEventIn,LogEventIn-- structured events for DB tablesIngestRunEventsRequest/IngestRunEventsResponseBatchEventsRequestTraceEventResponse,LogEventResponse,RunMessageResponse
runs.py -- Run lifecycle models
CreateRunRequest,RunSummary,RunDetail,RunJobPollNextRunRequest,ClaimRunResponseStartRunRequest,StartRunDirectRequestCompleteRunRequest,FailRunRequest,UpdateRunOutputRequestAddRunMessageRequestInvokeAgentRequest/InvokeAgentResponseWorkerInvokeRequest/WorkerInvokeResponse
agents.py -- Agent registration models
AgentManifest,HeartbeatRequest,HeartbeatResponseAgentInstanceResponse
hook_types.py -- Hook event mapping
HOOK_EVENT_TYPE_MAP-- maps Claude CodeHookEventNametoHookEventType
a2a.py -- A2A protocol wire types
A2AMessage,A2AMessagePartA2AMessageRequest,A2ATaskResponse
Type Safety Guarantees
| Layer | Protection |
|---|---|
| Build-time (mypy) | SDK and controlplane import the same Pydantic models -- field mismatches caught at type-check |
| Runtime (Pydantic) | Every event validated at construction and at API boundary |
| Wire (JSON) | model_dump() / model_validate() guarantee JSON matches schema |
| Hook events | HookEventType literal -- typos fail both type-check and runtime |
Dependencies
Only pydantic>=2.0. Zero internal dependencies.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
agentops_rpc-0.1.0.tar.gz
(33.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentops_rpc-0.1.0.tar.gz.
File metadata
- Download URL: agentops_rpc-0.1.0.tar.gz
- Upload date:
- Size: 33.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9df66af920b55d31fdec79ed5b068adc04b85b11cb603fda1864bfce0d7a22f3
|
|
| MD5 |
9320d63ec43165831bf67e0abaf0c3a1
|
|
| BLAKE2b-256 |
c8086f3b970eb080d93ec21adf8b35505392136d847896049568e56e26527218
|
File details
Details for the file agentops_rpc-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentops_rpc-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.31 {"installer":{"name":"uv","version":"0.11.31","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67e9f27417ae20576cd3c6f39e7c59128e968c59b16b83e28d80a4706fa86374
|
|
| MD5 |
c9409d3c29a4f33e34d0136c11639a06
|
|
| BLAKE2b-256 |
b4052c0cb87d5ff606e3affaa703a8a1f383bbcac3227197fed070b569f7ffaa
|