---
title: prefactor_core.runtime module
editUrl: true
head: []
template: doc
sidebar:
  hidden: false
  attrs: {}
pagefind: true
draft: false
---

# prefactor_core.runtime module

Runtime environment collection for agent version registration.

Provides [`build_runtime_environment()`](#prefactor_core.runtime.build_runtime_environment) which collects OS, Python
runtime, and SDK version information into the dict format expected by
the Prefactor API’s `agent_version.runtime_environment` field.

### prefactor_core.runtime.build_runtime_environment(sdk_header_entry: str | None = None) → dict

Build the `runtime_environment` dict for `agent_version`.

Parses *sdk_header_entry* (a space-separated list of `"pkg@ver"`
tokens as set by upstream adaptors) into `agent_sdk` entries.
Always includes `prefactor_sdk`, `os`, and `runtime`.

* **Parameters:**
  **sdk_header_entry** – Space-separated SDK header string set by
  upstream adaptors (e.g. `"prefactor-langchain@0.2.7"`).
  The trailing `prefactor-core@...` self-entry added by the
  client is automatically stripped from `agent_sdk`.
* **Returns:**
  A dict with keys `agent_sdk`, `os`, `prefactor_sdk`, and
  `runtime`, suitable for use as the `runtime_environment`
  field of `agent_version`.