create_sub_agent(
spec: SubAgent,
*,
state_schema: type | None = None,
response_format: ResponseFormatCreate a runnable agent from a raw SubAgent spec.
This is the shared entrypoint for the create_agent path used by
raw subagent specs. Pre-compiled CompiledSubAgent runnables are already
created by the caller and are handled separately by SubAgentMiddleware.
Optional response format override for this compiled subagent instance.