- protocol.py: pydantic models for all AICC message types (envelope, session_init, tool_call, tool_result, event, error, heartbeat) - bridge.py: Bridge with @bridge.tool registration, capability checks, session management, serve_forever - client.py: AICCClient with single background reader (safe on concurrent transports like WebSocket), call_tool, events, manifest - tool.py: @tool decorator with schema generation from type hints - schema.py: JSON Schema generation (str/int/float/bool, list, dict, Optional, pydantic models) - transport: Transport protocol, InProcessTransport, WebSocket client+server - tests: 12 passing (integration, schema, websocket roundtrip) - examples: bridge_minimal.py + agent_minimal.py (verified end-to-end)
46 lines
870 B
Python
46 lines
870 B
Python
"""aicc-py: Python SDK for the AI-Controlled Character Protocol."""
|
|
|
|
from aicc.protocol import (
|
|
ErrorCode,
|
|
MessageType,
|
|
TickMode,
|
|
WorldKind,
|
|
ModelClass,
|
|
ToolClass,
|
|
SessionInit,
|
|
SessionClose,
|
|
ToolCall,
|
|
ToolResult,
|
|
EventMessage,
|
|
ErrorMessage,
|
|
Heartbeat,
|
|
)
|
|
from aicc.errors import AICCError, ToolError, CapabilityError, ProtocolError
|
|
from aicc.bridge import Bridge
|
|
from aicc.client import AICCClient
|
|
from aicc.tool import tool
|
|
|
|
__version__ = "0.1.0"
|
|
__all__ = [
|
|
"Bridge",
|
|
"AICCClient",
|
|
"tool",
|
|
"ErrorCode",
|
|
"MessageType",
|
|
"TickMode",
|
|
"WorldKind",
|
|
"ModelClass",
|
|
"ToolClass",
|
|
"SessionInit",
|
|
"SessionClose",
|
|
"ToolCall",
|
|
"ToolResult",
|
|
"EventMessage",
|
|
"ErrorMessage",
|
|
"Heartbeat",
|
|
"AICCError",
|
|
"ToolError",
|
|
"CapabilityError",
|
|
"ProtocolError",
|
|
]
|