create_feedback_template
Create custom feedback templates with multi-language support to standardize and streamline feedback collection for AI tools.
Instructions
创建自定义反馈模板
Args:
template_name: 模板名称
template_content: 模板内容 (多语言支持)
template_type: 模板类型
Returns:
创建结果
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| template_name | Yes | ||
| template_content | Yes | ||
| template_type | No | custom |
Implementation Reference
- server.py:410-446 (handler)The handler function for 'create_feedback_template' tool. It creates a custom feedback template YAML file using the provided name, content dictionary, and type. The function is registered via the @self.app.tool() decorator within the _register_tools method.
@self.app.tool() def create_feedback_template( template_name: str, template_content: Dict[str, str], template_type: str = "custom" ) -> Dict[str, Any]: """ 创建自定义反馈模板 Args: template_name: 模板名称 template_content: 模板内容 (多语言支持) template_type: 模板类型 Returns: 创建结果 """ try: templates_file = self.template_manager.templates_dir / f"{template_name}.yaml" template_data = { "type": template_type, "created_at": datetime.now().isoformat(), "content": template_content } with open(templates_file, 'w', encoding='utf-8') as f: yaml.dump(template_data, f, default_flow_style=False, allow_unicode=True) return { "template_name": template_name, "file_path": str(templates_file), "status": "created" } except Exception as e: logger.error(f"Error creating template: {e}") return {"error": str(e), "status": "error"}