Initialize or get the application context.
(
self,
tool_manager: ToolManager | None = None,
config_path: Path | None = None,
**kwargs,
)
| 262 | return cls._instance |
| 263 | |
| 264 | def initialize( |
| 265 | self, |
| 266 | tool_manager: ToolManager | None = None, |
| 267 | config_path: Path | None = None, |
| 268 | **kwargs, |
| 269 | ) -> ApplicationContext: |
| 270 | """ |
| 271 | Initialize or get the application context. |
| 272 | """ |
| 273 | if self._context is None: |
| 274 | self._context = ApplicationContext.create( |
| 275 | tool_manager=tool_manager, config_path=config_path, **kwargs |
| 276 | ) |
| 277 | return self._context |
| 278 | |
| 279 | def get_context(self) -> ApplicationContext: |
| 280 | """ |