resolve • AI Agent SDK
Turn-time runtime resolution API for handoffs and sub-agents.
resolve
AI Agent
Turn-time runtime resolution API for handoffs and sub-agents.
This module addresses the issue where handoffs and sub-agents inherit construction-time runtime pins from the parent agent, causing wrong harness execution when the delegate uses a different model_ref or provider.
The solution provides turn-time resolution that re-resolves runtime from (agent_id, model_ref) at each handoff/sub-agent invocation.
Import
from praisonaiagents.runtime import resolveClasses
Protocol for agent runtime implementations.
AgentRuntimeProtocolExtended protocol for agent-specific runtime features.
SessionContextContext for runtime resolution within a session.
RuntimeResolverAbstract base class for runtime resolution strategies.
DefaultRuntimeResolverDefault runtime resolver that creates appropriate runtime instances.
LLMRuntimeWrapperWrapper around existing LLM class to provide runtime protocol.
FallbackRuntimeFallback runtime implementation that raises errors instead of returning stubs.
Functions
Set the global runtime resolver.
get_global_resolver()Get the global runtime resolver, creating default if needed.
resolve_runtime()Resolve runtime for the given agent and model at turn-time.
get_runtime_cache()Get a copy of the current runtime cache (for debugging/testing).
clear_runtime_cache()Clear runtime cache for a specific session or all sessions.