| 1234567891011121314151617 |
- # -*- coding: utf-8 -*-
- """对话上下文处理。
- 文档状态由前端/业务后端管理,此组件仅规范化请求上下文供模型提示词使用。
- """
- from typing import Any, Dict
- class ConversationContextBuilder:
- def build(self, state: Dict[str, Any]) -> Dict[str, Any]:
- return {
- "project_info": state.get("project_info", {}),
- "selected_section": state.get("selected_section", {}),
- "document_context": state.get("document_context", {}),
- "conversation_history": state.get("conversation_history", []),
- }
|