Skip to main content

Module python

Module python 

Source
Expand description

The generic Python (/ LangChain / LlamaIndex) provider kind: introspects and executes a drop-in .py provider through a bounded Python sidecar running python_bridge::python_bridge_program. Ported from soma-service::providers::python.

load_python_catalog here applies only generic manifest validation (soma_provider_core::validate_provider_manifest_value) — Soma’s own CLI reserved-command / env-prefix policy layer is applied downstream by the host’s provider registry when it builds every provider’s catalog (regardless of kind), so dropping the redundant Soma-specific pre-check here does not weaken overall enforcement — see the PR10 deviation notes.

Modules§

cache
Read-only inventory for content-addressed Python environment caches.
environment
Non-executing PEP 723 discovery and deterministic Python environment plans.
host
Capability broker for persistent Python workers.
lifecycle
Provider-source preparation that composes PEP 723 discovery, deterministic environment planning, and atomic uv materialization.
materializer
Atomic materialization and frozen startup for planned Python environments.
supervisor
Serial persistent Python worker supervision.

Structs§

PythonProvider

Enums§

PythonInterpreter
Selects the Python interpreter. Ambient preserves historical command overrides, while Prepared is authoritative so a managed immutable environment cannot be bypassed by process or provider configuration.

Functions§

describe_persistent_catalog
Discover a Python catalog inside the same supervised containment boundary used for activation. This prevents brokered mode from importing provider code in the host process or an ambient one-shot subprocess.
load_python_catalog
Introspects a .py provider file by importing it (in “catalog” mode) in a bounded sidecar and validating the resulting manifest against the generic provider-core contract. Callers that layer additional product policy on top of every provider’s catalog (e.g. Soma’s reserved CLI-command / env-prefix checks) apply it to the returned catalog themselves — see the module docs above.
load_python_catalog_with_interpreter