Create Context Manager • AI Agent SDK

create_context_manager: Create a context manager with proper config precedence.

create_context_manager

Function

</div>

This function is defined in the manager module.

Create a context manager with proper config precedence.

Precedence: CLI &gt; ENV &gt; config_file &gt; defaults

Signature

python
def create_context_manager(model: str, session_id: str, agent_name: str, config_file: Optional[str], cli_overrides: Optional[Dict[str, Any]]) -> ContextManager

Parameters

ParamField str

Model name

ParamField str

Session ID

ParamField str

Agent name

ParamField Optional[str]

Path to config.yaml

ParamField Optional

CLI argument overrides

Returns

ResponseField ContextManager

Configured ContextManager

Uses

  • ManagerConfig
  • ManagerConfig.from_env
  • config.merge
  • env_config.to_dict
  • ContextManager

Source

View on GitHub

praisonaiagents/context/manager.py at line 1082


Related Documentation