Restart#
Restart the gptme process.
This tool allows restarting gptme from within a conversation, which can be useful for applying configuration changes, reloading tools, or recovering from state issues.
- gptme.tools.restart.execute_restart(code: str | None, args: list[str] | None, kwargs: dict[str, str] | None) Generator[Message, None, None]
Execute restart by confirming intent.
The actual restart happens in the restart_hook (GENERATION_PRE), after all messages have been saved to the log.
- gptme.tools.restart.restart_hook(messages: list[Message], **kwargs) Generator[Message, None, None]
Hook that detects restart tool call and performs the restart.
Runs at GENERATION_PRE (before generating response) to restart immediately after the restart tool is called.
By this point, all messages (including the assistant’s restart message and the system confirmation) have been saved to the log.