Factory method to create a context with common defaults.
(
cls,
tool_manager: ToolManager | None = None,
config_path: Path | None = None,
provider: str | None = None,
model: str | None = None,
**kwargs,
)
| 78 | |
| 79 | @classmethod |
| 80 | def create( |
| 81 | cls, |
| 82 | tool_manager: ToolManager | None = None, |
| 83 | config_path: Path | None = None, |
| 84 | provider: str | None = None, |
| 85 | model: str | None = None, |
| 86 | **kwargs, |
| 87 | ) -> ApplicationContext: |
| 88 | """ |
| 89 | Factory method to create a context with common defaults. |
| 90 | """ |
| 91 | context = cls( |
| 92 | tool_manager=tool_manager, |
| 93 | config_path=config_path or Path("server_config.json"), |
| 94 | provider=provider or DEFAULT_PROVIDER, |
| 95 | model=model or DEFAULT_MODEL, |
| 96 | **kwargs, |
| 97 | ) |
| 98 | return context |
| 99 | |
| 100 | async def initialize(self) -> None: |
| 101 | """ |