openbox-langchain-sdk-python 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openbox_langchain_sdk_python-0.1.0/.github/workflows/publish.yml +71 -0
- openbox_langchain_sdk_python-0.1.0/.gitignore +21 -0
- openbox_langchain_sdk_python-0.1.0/AGENTS.md +112 -0
- openbox_langchain_sdk_python-0.1.0/PKG-INFO +121 -0
- openbox_langchain_sdk_python-0.1.0/README.md +104 -0
- openbox_langchain_sdk_python-0.1.0/docs/code-standards.md +483 -0
- openbox_langchain_sdk_python-0.1.0/docs/codebase-summary.md +116 -0
- openbox_langchain_sdk_python-0.1.0/docs/project-overview-pdr.md +211 -0
- openbox_langchain_sdk_python-0.1.0/docs/project-roadmap.md +289 -0
- openbox_langchain_sdk_python-0.1.0/docs/system-architecture.md +260 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/AGENTS.md +42 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/README.md +147 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/blogs/langchain-overview/post.md +32 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/blogs/prompt-engineering/post.md +42 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/content_writer.py +346 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/pyproject.toml +23 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/research/langchain-overview.md +36 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/research/prompt-engineering.md +30 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/skills/blog-post/SKILL.md +134 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/skills/social-media/SKILL.md +185 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/subagents.yaml +29 -0
- openbox_langchain_sdk_python-0.1.0/examples/content-builder-agent/uv.lock +2010 -0
- openbox_langchain_sdk_python-0.1.0/openbox_langchain/__init__.py +124 -0
- openbox_langchain_sdk_python-0.1.0/openbox_langchain/middleware.py +239 -0
- openbox_langchain_sdk_python-0.1.0/openbox_langchain/middleware_factory.py +67 -0
- openbox_langchain_sdk_python-0.1.0/openbox_langchain/middleware_hook_handlers.py +231 -0
- openbox_langchain_sdk_python-0.1.0/openbox_langchain/middleware_hooks.py +220 -0
- openbox_langchain_sdk_python-0.1.0/openbox_langchain/middleware_tool_hook.py +144 -0
- openbox_langchain_sdk_python-0.1.0/pyproject.toml +42 -0
- openbox_langchain_sdk_python-0.1.0/tests/__init__.py +0 -0
- openbox_langchain_sdk_python-0.1.0/tests/conftest.py +56 -0
- openbox_langchain_sdk_python-0.1.0/tests/test_middleware_factory.py +251 -0
- openbox_langchain_sdk_python-0.1.0/tests/test_middleware_hook_handlers.py +618 -0
- openbox_langchain_sdk_python-0.1.0/tests/test_middleware_hooks.py +596 -0
- openbox_langchain_sdk_python-0.1.0/tests/test_middleware_tool_hook.py +501 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["*.*.*"]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
with:
|
|
15
|
+
python-version: "3.11"
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v4
|
|
19
|
+
|
|
20
|
+
- name: Install dependencies
|
|
21
|
+
run: uv sync --all-extras
|
|
22
|
+
|
|
23
|
+
- name: Lint
|
|
24
|
+
run: uv run ruff check openbox_langchain/
|
|
25
|
+
|
|
26
|
+
- name: Test
|
|
27
|
+
run: uv run pytest
|
|
28
|
+
|
|
29
|
+
- name: Verify tag matches package version
|
|
30
|
+
run: |
|
|
31
|
+
TAG="${GITHUB_REF#refs/tags/}"
|
|
32
|
+
PKG_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
33
|
+
if [ "$TAG" != "$PKG_VERSION" ]; then
|
|
34
|
+
echo "::error::Tag $TAG does not match pyproject.toml version $PKG_VERSION"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
build:
|
|
39
|
+
needs: test
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v4
|
|
43
|
+
|
|
44
|
+
- uses: actions/setup-python@v5
|
|
45
|
+
with:
|
|
46
|
+
python-version: "3.11"
|
|
47
|
+
|
|
48
|
+
- name: Build sdist and wheel
|
|
49
|
+
run: pip install build && python -m build
|
|
50
|
+
|
|
51
|
+
- uses: actions/upload-artifact@v4
|
|
52
|
+
with:
|
|
53
|
+
name: dist
|
|
54
|
+
path: dist/
|
|
55
|
+
|
|
56
|
+
publish:
|
|
57
|
+
needs: build
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
environment: pypi
|
|
60
|
+
permissions:
|
|
61
|
+
id-token: write
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/download-artifact@v4
|
|
64
|
+
with:
|
|
65
|
+
name: dist
|
|
66
|
+
path: dist/
|
|
67
|
+
|
|
68
|
+
- name: Publish to PyPI
|
|
69
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
70
|
+
with:
|
|
71
|
+
verbose: true
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# AGENTS.md — OpenBox LangChain SDK
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
OpenBox governance SDK for LangChain agents. Intercepts agent execution via `AgentMiddleware` and enforces OpenBox policies, guardrails, HITL approvals, and behavior rules.
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+
Three-layer governance:
|
|
10
|
+
|
|
11
|
+
- **Layer 1:** `OpenBoxLangChainMiddleware` (AgentMiddleware subclass) — Intercepts agent lifecycle (before/after agent, wrap model/tool calls)
|
|
12
|
+
- **Layer 2:** Hook governance (HTTP/DB/File I/O) — Imported from `openbox-langgraph-sdk-python`
|
|
13
|
+
- **Layer 3:** Activity context mapping via `WorkflowSpanProcessor` — Imported from `openbox-langgraph-sdk-python`
|
|
14
|
+
|
|
15
|
+
**Key principle:** Only the middleware integration layer is new code. All governance infrastructure is imported from `openbox-langgraph-sdk-python` (not copied).
|
|
16
|
+
|
|
17
|
+
## Package Structure
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
openbox_langchain/
|
|
21
|
+
├── __init__.py # Public API (re-exports + exports middleware)
|
|
22
|
+
├── middleware.py # OpenBoxLangChainMiddleware + options
|
|
23
|
+
├── middleware_factory.py # create_openbox_langchain_middleware() factory
|
|
24
|
+
├── middleware_hooks.py # Event builders, PII redaction, OTel helpers
|
|
25
|
+
├── middleware_hook_handlers.py # before_agent, after_agent, wrap_model_call handlers
|
|
26
|
+
└── middleware_tool_hook.py # wrap_tool_call handler
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Code count:** 1,025 total lines (all new), focused on middleware integration only.
|
|
30
|
+
|
|
31
|
+
## Key Classes
|
|
32
|
+
|
|
33
|
+
- `OpenBoxLangChainMiddleware` — Main middleware (AgentMiddleware subclass)
|
|
34
|
+
- `OpenBoxLangChainMiddlewareOptions` — Configuration dataclass
|
|
35
|
+
|
|
36
|
+
## Key Functions
|
|
37
|
+
|
|
38
|
+
- `create_openbox_langchain_middleware()` — Factory (primary entry point)
|
|
39
|
+
- `handle_before_agent()` / `ahandle_before_agent()` — Session setup, pre-screen
|
|
40
|
+
- `handle_after_agent()` / `ahandle_after_agent()` — Cleanup
|
|
41
|
+
- `handle_wrap_model_call()` / `ahandle_wrap_model_call()` — LLM interception, PII redaction
|
|
42
|
+
- `handle_wrap_tool_call()` / `ahandle_wrap_tool_call()` — Tool governance, OTel spans
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from langchain_openai import ChatOpenAI
|
|
48
|
+
from langgraph.prebuilt import create_react_agent
|
|
49
|
+
from openbox_langchain import create_openbox_langchain_middleware
|
|
50
|
+
|
|
51
|
+
# Create middleware
|
|
52
|
+
middleware = create_openbox_langchain_middleware(
|
|
53
|
+
api_url="https://core.openbox.ai",
|
|
54
|
+
api_key="obx_live_...",
|
|
55
|
+
agent_name="MyAgent",
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
# Create agent with middleware
|
|
59
|
+
model = ChatOpenAI(model="gpt-4")
|
|
60
|
+
tools = [...]
|
|
61
|
+
|
|
62
|
+
agent = create_react_agent(
|
|
63
|
+
model=model,
|
|
64
|
+
tools=tools,
|
|
65
|
+
middleware=[middleware],
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Invoke — governance applied automatically
|
|
69
|
+
result = agent.invoke({"messages": [("user", "your query")]})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Commands
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Install
|
|
76
|
+
pip install -e ".[dev]"
|
|
77
|
+
|
|
78
|
+
# Test
|
|
79
|
+
pytest tests/ -v
|
|
80
|
+
|
|
81
|
+
# Lint
|
|
82
|
+
ruff check openbox_langchain/
|
|
83
|
+
|
|
84
|
+
# Type check
|
|
85
|
+
mypy openbox_langchain/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Testing
|
|
89
|
+
|
|
90
|
+
**Current:** 99 tests, 100% pass rate
|
|
91
|
+
|
|
92
|
+
**Coverage:**
|
|
93
|
+
- Unit tests for each hook handler
|
|
94
|
+
- Integration tests for full agent workflow
|
|
95
|
+
- Mock client tests for verdict enforcement
|
|
96
|
+
- Pre-screen caching, OTel context, async/sync bridge
|
|
97
|
+
- Error handling (network, timeout, invalid verdicts)
|
|
98
|
+
|
|
99
|
+
## Documentation
|
|
100
|
+
|
|
101
|
+
- **README.md** — Quick start + configuration
|
|
102
|
+
- **docs/project-overview-pdr.md** — Functional/non-functional requirements
|
|
103
|
+
- **docs/system-architecture.md** — 3-layer design, data flow, verdict system
|
|
104
|
+
- **docs/code-standards.md** — Patterns, conventions, guidelines
|
|
105
|
+
- **docs/codebase-summary.md** — Module organization, dependencies
|
|
106
|
+
- **docs/project-roadmap.md** — Timeline, milestones, future work
|
|
107
|
+
|
|
108
|
+
## References
|
|
109
|
+
|
|
110
|
+
- **DeepAgent SDK:** `/Users/tino/code/openbox-deepagent-sdk-python/` (reference middleware pattern)
|
|
111
|
+
- **LangGraph SDK:** `/Users/tino/code/openbox-langgraph-sdk-python/` (governance infrastructure)
|
|
112
|
+
- **SDK Guide:** `/Users/tino/code/sdk-implementation-guide/README.md`
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: openbox-langchain-sdk-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: OpenBox governance and observability SDK for LangChain
|
|
5
|
+
License: MIT
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: langchain-core>=0.3.0
|
|
8
|
+
Requires-Dist: langchain>=0.3.0
|
|
9
|
+
Requires-Dist: langgraph>=0.2.0
|
|
10
|
+
Requires-Dist: openbox-langgraph-sdk-python>=0.1.0
|
|
11
|
+
Provides-Extra: dev
|
|
12
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
13
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
14
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
15
|
+
Requires-Dist: ruff>=0.6.0; extra == 'dev'
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# OpenBox LangChain SDK — Python
|
|
19
|
+
|
|
20
|
+
Governance and observability SDK for LangChain agents. Intercepts agent execution via `AgentMiddleware` to enforce OpenBox policies, guardrails, HITL approval flows, and hook-level governance (HTTP/DB/File I/O).
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install openbox-langchain-sdk-python
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from langchain.agents import create_agent
|
|
32
|
+
from openbox_langchain import create_openbox_langchain_middleware
|
|
33
|
+
|
|
34
|
+
# 1. Create middleware
|
|
35
|
+
middleware = create_openbox_langchain_middleware(
|
|
36
|
+
api_url="https://core.openbox.ai",
|
|
37
|
+
api_key="obx_live_...",
|
|
38
|
+
agent_name="MyAgent",
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# 2. Create agent with middleware
|
|
42
|
+
agent = create_agent(
|
|
43
|
+
model="openai:gpt-4o",
|
|
44
|
+
tools=[...],
|
|
45
|
+
middleware=[middleware],
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
# 3. Invoke — governance applied automatically
|
|
49
|
+
result = agent.invoke({"messages": [("user", "your query")]})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## How It Works
|
|
53
|
+
|
|
54
|
+
Three-layer governance architecture:
|
|
55
|
+
|
|
56
|
+
| Layer | Mechanism | Governs |
|
|
57
|
+
|-------|-----------|---------|
|
|
58
|
+
| 1 | AgentMiddleware hooks | Agent lifecycle (before/after), model calls, tool execution |
|
|
59
|
+
| 2 | Hook Governance | HTTP requests, DB queries, file I/O at kernel boundary |
|
|
60
|
+
| 3 | Activity Context Mapping | Links hook traces to governance activities via OTel |
|
|
61
|
+
|
|
62
|
+
**Middleware hooks:**
|
|
63
|
+
- `before_agent` / `abefore_agent` — Session setup, pre-screen guardrails
|
|
64
|
+
- `wrap_model_call` / `awrap_model_call` — LLM interception, PII redaction
|
|
65
|
+
- `wrap_tool_call` / `awrap_tool_call` — Tool governance, OTel span registration
|
|
66
|
+
- `after_agent` / `aafter_agent` — Session cleanup
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
middleware = create_openbox_langchain_middleware(
|
|
72
|
+
api_url="https://core.openbox.ai", # OpenBox Core URL
|
|
73
|
+
api_key="obx_live_...", # API key (obx_live_* or obx_test_*)
|
|
74
|
+
agent_name="MyAgent", # Agent name (from dashboard)
|
|
75
|
+
governance_timeout=30.0, # HTTP timeout in seconds
|
|
76
|
+
validate=True, # Validate API key on startup
|
|
77
|
+
session_id="session-123", # Optional session tracking
|
|
78
|
+
sqlalchemy_engine=engine, # Optional DB governance
|
|
79
|
+
tool_type_map={ # Optional tool classification
|
|
80
|
+
"search_web": "http",
|
|
81
|
+
"query_db": "database",
|
|
82
|
+
},
|
|
83
|
+
)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Supported Agent Types
|
|
87
|
+
|
|
88
|
+
- `create_agent(model, tools, middleware=[...])` — recommended
|
|
89
|
+
- Any LangChain agent builder that accepts `middleware`
|
|
90
|
+
|
|
91
|
+
## Verdict Enforcement
|
|
92
|
+
|
|
93
|
+
5-tier verdict system:
|
|
94
|
+
- **ALLOW** — Request permitted
|
|
95
|
+
- **CONSTRAIN** — Request constrained (e.g., rate limit)
|
|
96
|
+
- **REQUIRE_APPROVAL** — Human approval required (HITL polling)
|
|
97
|
+
- **BLOCK** — Request blocked with error
|
|
98
|
+
- **HALT** — Entire workflow halted (unrecoverable error)
|
|
99
|
+
|
|
100
|
+
## Requirements
|
|
101
|
+
|
|
102
|
+
- Python 3.11+
|
|
103
|
+
- LangChain >= 0.3.0
|
|
104
|
+
- LangGraph >= 0.2.0
|
|
105
|
+
- openbox-langgraph-sdk-python >= 0.1.0
|
|
106
|
+
|
|
107
|
+
## API Reference
|
|
108
|
+
|
|
109
|
+
**Primary factory:**
|
|
110
|
+
- `create_openbox_langchain_middleware()` — Creates configured middleware
|
|
111
|
+
|
|
112
|
+
**Re-exported from langgraph SDK:**
|
|
113
|
+
- `enforce_verdict()` — Enforce verdicts
|
|
114
|
+
- `poll_until_decision()` — HITL approval polling
|
|
115
|
+
- `GovernanceClient`, `GovernanceConfig` — Core types
|
|
116
|
+
|
|
117
|
+
See `openbox_langchain.__init__.py` for full API export list.
|
|
118
|
+
|
|
119
|
+
## License
|
|
120
|
+
|
|
121
|
+
MIT
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# OpenBox LangChain SDK — Python
|
|
2
|
+
|
|
3
|
+
Governance and observability SDK for LangChain agents. Intercepts agent execution via `AgentMiddleware` to enforce OpenBox policies, guardrails, HITL approval flows, and hook-level governance (HTTP/DB/File I/O).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install openbox-langchain-sdk-python
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from langchain.agents import create_agent
|
|
15
|
+
from openbox_langchain import create_openbox_langchain_middleware
|
|
16
|
+
|
|
17
|
+
# 1. Create middleware
|
|
18
|
+
middleware = create_openbox_langchain_middleware(
|
|
19
|
+
api_url="https://core.openbox.ai",
|
|
20
|
+
api_key="obx_live_...",
|
|
21
|
+
agent_name="MyAgent",
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
# 2. Create agent with middleware
|
|
25
|
+
agent = create_agent(
|
|
26
|
+
model="openai:gpt-4o",
|
|
27
|
+
tools=[...],
|
|
28
|
+
middleware=[middleware],
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# 3. Invoke — governance applied automatically
|
|
32
|
+
result = agent.invoke({"messages": [("user", "your query")]})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## How It Works
|
|
36
|
+
|
|
37
|
+
Three-layer governance architecture:
|
|
38
|
+
|
|
39
|
+
| Layer | Mechanism | Governs |
|
|
40
|
+
|-------|-----------|---------|
|
|
41
|
+
| 1 | AgentMiddleware hooks | Agent lifecycle (before/after), model calls, tool execution |
|
|
42
|
+
| 2 | Hook Governance | HTTP requests, DB queries, file I/O at kernel boundary |
|
|
43
|
+
| 3 | Activity Context Mapping | Links hook traces to governance activities via OTel |
|
|
44
|
+
|
|
45
|
+
**Middleware hooks:**
|
|
46
|
+
- `before_agent` / `abefore_agent` — Session setup, pre-screen guardrails
|
|
47
|
+
- `wrap_model_call` / `awrap_model_call` — LLM interception, PII redaction
|
|
48
|
+
- `wrap_tool_call` / `awrap_tool_call` — Tool governance, OTel span registration
|
|
49
|
+
- `after_agent` / `aafter_agent` — Session cleanup
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
middleware = create_openbox_langchain_middleware(
|
|
55
|
+
api_url="https://core.openbox.ai", # OpenBox Core URL
|
|
56
|
+
api_key="obx_live_...", # API key (obx_live_* or obx_test_*)
|
|
57
|
+
agent_name="MyAgent", # Agent name (from dashboard)
|
|
58
|
+
governance_timeout=30.0, # HTTP timeout in seconds
|
|
59
|
+
validate=True, # Validate API key on startup
|
|
60
|
+
session_id="session-123", # Optional session tracking
|
|
61
|
+
sqlalchemy_engine=engine, # Optional DB governance
|
|
62
|
+
tool_type_map={ # Optional tool classification
|
|
63
|
+
"search_web": "http",
|
|
64
|
+
"query_db": "database",
|
|
65
|
+
},
|
|
66
|
+
)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Supported Agent Types
|
|
70
|
+
|
|
71
|
+
- `create_agent(model, tools, middleware=[...])` — recommended
|
|
72
|
+
- Any LangChain agent builder that accepts `middleware`
|
|
73
|
+
|
|
74
|
+
## Verdict Enforcement
|
|
75
|
+
|
|
76
|
+
5-tier verdict system:
|
|
77
|
+
- **ALLOW** — Request permitted
|
|
78
|
+
- **CONSTRAIN** — Request constrained (e.g., rate limit)
|
|
79
|
+
- **REQUIRE_APPROVAL** — Human approval required (HITL polling)
|
|
80
|
+
- **BLOCK** — Request blocked with error
|
|
81
|
+
- **HALT** — Entire workflow halted (unrecoverable error)
|
|
82
|
+
|
|
83
|
+
## Requirements
|
|
84
|
+
|
|
85
|
+
- Python 3.11+
|
|
86
|
+
- LangChain >= 0.3.0
|
|
87
|
+
- LangGraph >= 0.2.0
|
|
88
|
+
- openbox-langgraph-sdk-python >= 0.1.0
|
|
89
|
+
|
|
90
|
+
## API Reference
|
|
91
|
+
|
|
92
|
+
**Primary factory:**
|
|
93
|
+
- `create_openbox_langchain_middleware()` — Creates configured middleware
|
|
94
|
+
|
|
95
|
+
**Re-exported from langgraph SDK:**
|
|
96
|
+
- `enforce_verdict()` — Enforce verdicts
|
|
97
|
+
- `poll_until_decision()` — HITL approval polling
|
|
98
|
+
- `GovernanceClient`, `GovernanceConfig` — Core types
|
|
99
|
+
|
|
100
|
+
See `openbox_langchain.__init__.py` for full API export list.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|