prepare_for_new_conversation
Reset conversation context to start fresh interactions, clearing previous chat history and settings on user request.
Instructions
Instructions for preparing for a new conversation. This tool should only be called on explicit user request.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- PrepareForNewConversationTool class defines the tool handler. Its apply() method executes the tool logic by calling the prompt factory to generate the preparation instructions for a new conversation.class PrepareForNewConversationTool(Tool): """ Provides instructions for preparing for a new conversation (in order to continue with the necessary context). """ def apply(self) -> str: """ Instructions for preparing for a new conversation. This tool should only be called on explicit user request. """ return self.prompt_factory.create_prepare_for_new_conversation()
- PromptFactory method that renders the prompt template named 'prepare_for_new_conversation', used by the tool handler.def create_prepare_for_new_conversation(self) -> str: return self._render_prompt("prepare_for_new_conversation", locals())
- src/serena/tools/tools_base.py:359-367 (registration)ToolRegistry automatically discovers and registers all Tool subclasses (including PrepareForNewConversationTool) by iterating subclasses in serena.tools package.for cls in iter_subclasses(Tool): if not any(cls.__module__.startswith(pkg) for pkg in tool_packages): continue is_optional = issubclass(cls, ToolMarkerOptional) name = cls.get_name_from_cls() if name in self._tool_dict: raise ValueError(f"Duplicate tool name found: {name}. Tool classes must have unique names.") self._tool_dict[name] = RegisteredTool(tool_class=cls, is_optional=is_optional, tool_name=name)