Imperal Docs
SDK Reference

Imperal SDK overview

The Imperal SDK — build federal-grade Python extensions for Webbee: manifest schema v3, typed Pydantic params, runtime quality guarantees & federal validators.

The Imperal SDK is how you build extensions for Webbee 🐝 in Python. It enforces the federal extension contract (manifest schema v3, 11 ERROR-severity validators V14V22 + V24 + V31), the SDL Typed Return Contract (every @chat.function returns a typed sdl.Entity / sdl.EntityList[T] via data_model=), and ships runtime quality guarantees — the Pydantic feedback loop, declarative center-overlay surfaces, federal-grade panel rendering contracts, and per-user encrypted secrets backed by the platform KMS (@ext.secret + ctx.secrets, v4.2.2+).

For per-release migration notes, see the changelog.

Install

pip install --upgrade imperal-sdk

Federal hygiene

Bump every venv that imports imperal_sdk in the same window. Worker fleets that mix old and new SDK lines work but are not recommended — pin the version in your pyproject.toml and roll all workers together.

Verify

python -c "import imperal_sdk; print(imperal_sdk.__version__)"

Hello world

from imperal_sdk import Extension, ChatExtension, ActionResult, sdl
from pydantic import BaseModel, Field

ext = Extension(
    "hello-world",
    display_name="Hello World",
    description="Minimal demonstration extension for Webbee.",
    icon="icon.svg",
    actions_explicit=True,
)

chat = ChatExtension(ext, tool_name="hello-world", description="Hello World assistant")

class Greeting(sdl.Entity, sdl.Bodied):
    pass

class GreetParams(BaseModel):
    name: str = Field(description="Person to greet")

@chat.function(
    "greet",
    description="Send a friendly greeting by name.",
    action_type="read",
    data_model=Greeting,   # ← read tools declare their SDL return shape (V23)
)
async def greet(ctx, params: GreetParams) -> ActionResult:
    return ActionResult.success(
        Greeting(id=params.name, title=f"Hello, {params.name}!", body=f"Hello, {params.name}!"),
        summary="Greeting sent",
    )

That's a real, complete, federal-clean extension. The LLM sees the JSON schema for GreetParams and calls greet(name="Alex"); the handler returns a typed SDL Greeting entity — the now-required data_model= return shape for every @chat.function.

Every handler MUST be annotated -> ActionResult (validator V5).

Reference contents

Compatibility

SurfaceSupported
Python3.11+
Anthropic modelsclaude-haiku-4-5, claude-sonnet-4-6, claude-opus-4-8
OpenAI modelsgpt-4.1 family, gpt-5 family, o3, o-series
Local models via BYOLLMOllama-compatible servers (Qwen, Llama, etc.)
Pydanticv2.x
ICNLI Worker1.30+

Where to next

On this page