pyagent-blueprint API Reference¶
pyagent_blueprint
¶
PyAgent Blueprint — declarative YAML specs for multi-agent LLM systems.
AdapterRegistry
¶
Discovers adapters via Python entry points.
Core never imports any adapter package directly — third parties can
ship a backend without touching this repo at all by registering an
entry point in the pyagent_blueprint.adapters group.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
discover()
staticmethod
¶
Return all installed adapters, keyed by entry-point name.
An entry point that fails to import (e.g. an adapter registered
by pyproject.toml whose own optional dependency — like
pyagent-patterns for the pyagent adapter — isn't installed)
is skipped rather than raised: one adapter's missing dependency
must never break discovery of every OTHER adapter. This is what
lets validate/generate degrade gracefully with zero runtime
packages installed, while the zero-dependency reference adapters
remain fully discoverable.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
get(name)
staticmethod
¶
Look up a single adapter class by entry-point name.
Raises:
| Type | Description |
|---|---|
KeyError
|
If no adapter is registered under |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
AdapterResult
¶
Normalized result envelope.
Every adapter must map its native return shape into this, so callers
never branch on adapter identity (e.g. never special-case "if adapter
is LangGraph, read .raw['messages'][-1]").
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
Capability
¶
Bases: Flag
Optional features an adapter may or may not support.
Core only ever requires COMPILE + RUN (i.e. the two abstract methods below). Everything else is negotiated at runtime via these flags so the contract never assumes a graph, async streaming, or native tool-calling exists.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
CompiledArtifact
dataclass
¶
Result of compile(): the opaque native handle plus diagnostics.
Attributes:
| Name | Type | Description |
|---|---|---|
handle |
Any
|
Opaque, framework-native compiled object. Core never inspects this — that's the whole point of the abstraction. |
diagnostics |
list[CompileDiagnostic]
|
Every governance feature the blueprint declared that this adapter could NOT honor, as structured diagnostics. Empty means every declared feature was either honored or not applicable to this blueprint. |
intent |
dict[str, str]
|
Optional map of workflow name -> original pattern name, preserved so pattern intent survives even when an adapter lowers a named pattern (e.g. "debate") to a generic graph. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
CompileDiagnostic
dataclass
¶
A single structured diagnostic emitted during compile().
Attributes:
| Name | Type | Description |
|---|---|---|
code |
DiagnosticCode
|
A stable |
path |
str
|
Dotted path into the blueprint that triggered this
diagnostic, e.g. |
detail |
str
|
Adapter-specific human-readable detail. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
RuntimeAdapter
¶
Bases: ABC
Compiles a framework-agnostic BlueprintIR into a runnable object
native to a specific agent framework, and executes it.
Deliberately minimal: only compile and run are required. This is
the lowest common denominator across graph-based (LangGraph),
turn-based (AutoGen), role-based (CrewAI), handoff-based (OpenAI
Agents SDK), event-driven (Semantic Kernel), and hand-rolled loop
runtimes.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
compile(ir)
abstractmethod
¶
Compile a BlueprintIR into a CompiledArtifact.
Must report every governance feature it cannot honor via
CompiledArtifact.diagnostics — never drop one silently.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
run(compiled, workflow, input_, **kwargs)
abstractmethod
async
¶
Execute a compiled workflow.
Adapters that are natively sync (Capability.SYNC_EXECUTION) wrap
their own sync call internally (e.g. via asyncio.to_thread) —
callers of RuntimeAdapter always await, even for sync-native SDKs.
Raises:
| Type | Description |
|---|---|
UnknownWorkflowError
|
If |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
supported_patterns()
¶
Pattern/topology vocabulary this adapter understands, for
validator.py's optional pattern-existence check. Adapters
without a fixed pattern vocabulary (e.g. a loop-based adapter)
return an empty list — validator treats that as "no constraint",
not an error.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
export(compiled)
¶
Export a compiled artifact back toward a portable form.
Only meaningful if Capability.ROUND_TRIP is declared. Default
raises — adapters that support round-tripping (e.g. a future
Agent Spec bridge) override this.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
UnknownWorkflowError
¶
Bases: Exception
Raised by RuntimeAdapter.run()/stream() for an unresolvable workflow name.
Adapters MUST raise this (not let an internal AttributeError/KeyError leak through) so callers get one documented, catchable error type regardless of which adapter is installed.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter.py
BlueprintCompiler
¶
DEPRECATED: use PyAgentAdapter (or any RuntimeAdapter) directly.
Compile a BlueprintSpec into a RuntimeGraph, delegating to
pyagent_blueprint.adapters.pyagent_adapter.PyAgentAdapter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
provider_registry
|
Any
|
Optional |
None
|
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/compiler.py
compile(spec)
¶
Compile a blueprint spec into a runnable RuntimeGraph.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
BlueprintSpec
|
Validated |
required |
Returns:
| Type | Description |
|---|---|
RuntimeGraph
|
|
Raises:
| Type | Description |
|---|---|
CompilationError
|
If the spec references unknown patterns or agents. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/compiler.py
CompilationError
¶
Bases: Exception
Raised when a blueprint cannot be compiled.
Preserved for backward compatibility — wraps
adapters.pyagent_adapter.PyAgentCompilationError.
BlueprintDiffer
¶
Compute semantic diff between two blueprint specs.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/differ.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
diff(old, new)
¶
Diff two blueprint specs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
old
|
BlueprintSpec
|
Previous version. |
required |
new
|
BlueprintSpec
|
Updated version. |
required |
Returns:
| Type | Description |
|---|---|
list[Change]
|
List of |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/differ.py
summary(changes)
¶
Human-readable summary of changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
changes
|
list[Change]
|
List from |
required |
Returns:
| Type | Description |
|---|---|
str
|
Multi-line summary string. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/differ.py
Change
dataclass
¶
A single semantic change between two blueprint versions.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Dotted path to the changed field. |
change_type |
ChangeType
|
Added, removed, or modified. |
old_value |
Any
|
Previous value (None for added). |
new_value |
Any
|
New value (None for removed). |
severity |
ChangeSeverity
|
Impact level. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/differ.py
BlueprintGenerator
¶
Generate scaffold blueprint YAML from a pattern name and agent list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
default_provider_model
|
str
|
Model to use in the default provider binding. |
'gpt-4.1-mini'
|
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/generator.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
generate(pattern, agents, *, name='my-blueprint', version='0.1.0', description='', adapter=None)
¶
Generate a blueprint YAML string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pattern
|
str
|
Pattern registry name (e.g., |
required |
agents
|
list[str]
|
List of agent names. |
required |
name
|
str
|
Blueprint name. |
'my-blueprint'
|
version
|
str
|
Blueprint version. |
'0.1.0'
|
description
|
str
|
Blueprint description. |
''
|
adapter
|
str | None
|
Optional adapter entry-point name to validate |
None
|
Returns:
| Type | Description |
|---|---|
str
|
YAML string. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a pattern vocabulary is available (from the
resolved adapter, or any installed adapter) and |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/generator.py
BlueprintIR
dataclass
¶
Root intermediate representation of a complete blueprint.
This is the single normalized structure that RuntimeAdapter.compile(),
BlueprintDiffer, BlueprintRenderer, and any future exporter (e.g. an
Agent Spec backend) should consume — never the raw BlueprintSpec.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/ir.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | |
from_spec(spec)
classmethod
¶
Build a BlueprintIR from a validated BlueprintSpec.
This is the ONE place that knows how to read the Pydantic schema. Everything downstream (adapters, differ, renderer) should be written against this dataclass shape instead.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/ir.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
governance_features()
¶
Which governance features this blueprint actually declares.
Used by adapters/conformance checks to know what MUST be honored
or diagnosed — never silently dropped. Keys map 1:1 to the
diagnostic codes in diagnostics.py.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/ir.py
BlueprintLoadError
¶
AgentUnitMetadata
dataclass
¶
Resolved, packaging-ready metadata for an Agent Unit.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/packaging.py
PackagingError
¶
BlueprintRenderer
¶
Render a BlueprintSpec as Mermaid diagrams or Markdown docs.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/renderer.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | |
to_mermaid(spec)
¶
Render the blueprint as a Mermaid flowchart.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
BlueprintSpec
|
Blueprint specification. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Mermaid diagram string. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/renderer.py
to_markdown(spec)
¶
Render the blueprint as Markdown documentation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
BlueprintSpec
|
Blueprint specification. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Markdown string. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/renderer.py
RuntimeGraph
¶
Executable graph of compiled workflows.
Each workflow is a fully wired Pattern instance ready to run.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflows
|
dict[str, Pattern]
|
Mapping of workflow name → compiled Pattern. |
required |
agents
|
dict[str, Agent] | None
|
Mapping of agent name → Agent instance. |
None
|
metadata
|
dict[str, Any] | None
|
Blueprint metadata dict. |
None
|
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
wire_trace(bus)
¶
Set trace_bus on all patterns and their agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bus
|
Any
|
A |
required |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
wire_context(ledger)
¶
Set context ledger on all agents in all workflows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ledger
|
Any
|
A |
required |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
wire_compressor(compressor)
¶
Set compressor on all agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
compressor
|
Any
|
A |
required |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
wire_cost_tracker(tracker)
¶
Set cost tracker on all agents.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tracker
|
Any
|
A |
required |
run(workflow, task)
async
¶
Run a workflow by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow
|
str
|
Workflow name from the blueprint. |
required |
task
|
str
|
Input task string. |
required |
Returns:
| Type | Description |
|---|---|
Result
|
Pattern |
Raises:
| Type | Description |
|---|---|
KeyError
|
If workflow name doesn't exist. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
stream(workflow, task)
async
¶
Stream results from a workflow.
Falls back to run() and yields the full output if the pattern
doesn't support native streaming.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
describe()
¶
Introspect the runtime graph.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Dict with metadata and workflow descriptions. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/runtime.py
AgentSpec
¶
Bases: BaseModel
Specification of a single agent.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/agents.py
BlueprintSpec
¶
Bases: BaseModel
Root specification for a declarative agent system.
This is the top-level Pydantic model that represents a complete blueprint YAML/JSON document.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/spec.py
ContextConfigSpec
¶
Bases: BaseModel
Context configuration for a blueprint.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/context.py
ContractSpec
¶
Bases: BaseModel
Input/output contract for a workflow.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/contracts.py
MetadataSpec
¶
Bases: BaseModel
Blueprint metadata.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/metadata.py
ObservabilitySpec
¶
Bases: BaseModel
Observability configuration for a blueprint.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/observability.py
PackageSpec
¶
Bases: BaseModel
Optional packaging metadata for producing an 'Agent Unit' artifact.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/package.py
ProviderBindingSpec
¶
Bases: BaseModel
Binding of a logical provider name to a model + backend.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/providers.py
WorkflowSpec
¶
Bases: BaseModel
Specification of a workflow: pattern + agent wiring.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/schema/workflows.py
BlueprintTester
¶
Run conformance tests for blueprint contracts using MockLLM.
Compiles the blueprint with mock providers and verifies that: - Workflows produce output - Output type matches contract expectations - SLA constraints are within bounds (basic checks)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
compiler
|
BlueprintCompiler | None
|
Optional compiler instance. Creates one if not provided. |
None
|
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/tester.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
test(spec, test_inputs=None)
async
¶
Run contract conformance tests for all workflows with contracts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
BlueprintSpec
|
Blueprint spec to test. |
required |
test_inputs
|
dict[str, str] | None
|
Optional mapping of workflow name → test input. If not provided, uses a default test string. |
None
|
Returns:
| Type | Description |
|---|---|
list[TestResult]
|
List of |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/tester.py
summary(results)
¶
Human-readable summary of test results.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/tester.py
TestResult
dataclass
¶
Result of a single contract test.
Attributes:
| Name | Type | Description |
|---|---|---|
workflow |
str
|
Workflow name tested. |
passed |
bool
|
Whether the test passed. |
output |
str
|
The actual output from the workflow. |
checks |
dict[str, bool]
|
Dict of check name → pass/fail. |
error |
str | None
|
Error message if the test failed with an exception. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/tester.py
BlueprintValidator
¶
Run static checks on a BlueprintSpec.
Checks: - All agent refs in workflows exist in agents dict - All provider refs in agents exist in providers dict - Pattern names are registered - No cyclic workflow dependencies - SLA values are realistic - Security: no hardcoded API keys in prompts
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/validator.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | |
validate(spec)
¶
Run all validation checks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
BlueprintSpec
|
The blueprint spec to validate. |
required |
Returns:
| Type | Description |
|---|---|
list[ValidationIssue]
|
List of issues found (may be empty). |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/validator.py
ValidationIssue
dataclass
¶
A single validation finding.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Dotted path to the problematic field. |
message |
str
|
Human-readable description. |
severity |
IssueSeverity
|
Error, warning, or info. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/validator.py
render_adapter_template(framework_name, adapter_name=None, dist_name=None)
¶
Render the file contents for a starter adapter package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
framework_name
|
str
|
Human-readable SDK name, e.g. "LangGraph". |
required |
adapter_name
|
str | None
|
entry-point / RuntimeAdapter.name value. Defaults to a snake_case derivation of framework_name. |
None
|
dist_name
|
str | None
|
PyPI distribution name. Defaults to
"pyagent-blueprint-adapter- |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, str]
|
Mapping of relative file path -> file content, ready to be |
dict[str, str]
|
written to disk. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter_template.py
write_adapter_template(framework_name, output_dir, adapter_name=None, dist_name=None)
¶
Render and write a starter adapter package to output_dir.
Returns the output directory path.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/adapter_template.py
blueprint_contracts_json_schema(ir)
¶
Render every declared contract in a BlueprintIR as JSON Schema
documents, keyed by workflow name.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/contract.py
contract_json_schema(contract)
¶
Render a single workflow's ContractIR as a JSON Schema document.
The document's $id-less shape is intentionally minimal: input/
output are the declared JSON Schemas verbatim (empty dict means
"unconstrained"), and SLA constraints are surfaced under the
x-pyagent extension namespace since they have no native JSON
Schema representation — a non-Python consumer can still read them,
it's just not part of core JSON Schema vocabulary.
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/contract.py
load_blueprint(path)
¶
Load a blueprint from a YAML or JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to a |
required |
Returns:
| Type | Description |
|---|---|
BlueprintSpec
|
Validated |
Raises:
| Type | Description |
|---|---|
BlueprintLoadError
|
If the file is missing, unreadable, or invalid. |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/loader.py
load_blueprint_from_str(text, fmt='yaml')
¶
Load a blueprint from a string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
YAML or JSON text. |
required |
fmt
|
str
|
|
'yaml'
|
Returns:
| Type | Description |
|---|---|
BlueprintSpec
|
Validated |
Source code in packages/pyagent-blueprint/src/pyagent_blueprint/loader.py
package_blueprint(spec, raw_source, source_filename, output_dir)
¶
Build a distributable Agent Unit archive.
Produces <output_dir>/<name>-<version>.agentunit.zip containing:
- unit.json — the AgentUnitMetadata manifest
- the original blueprint source, preserved under its own filename
Returns the path to the written archive.