#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
记忆银行接口定义
Memory Bank Interface Definition
"""

from abc import ABC, abstractmethod
from typing import List, Dict, Any, Optional
from datetime import datetime


class MemoryBankInterface(ABC):
    """记忆银行接口"""
    
    @abstractmethod
    async def initialize(self):
        """初始化记忆银行"""
        pass
    
    @abstractmethod
    async def close(self):
        """关闭记忆银行"""
        pass
    
    @abstractmethod
    async def add_debate_message(
        self,
        debate_id: str,
        speaker: str,
        message: str,
        round_num: int
    ):
        """添加辩论消息"""
        pass
    
    @abstractmethod
    async def get_debate_history(
        self,
        debate_id: str
    ) -> List[Dict[str, Any]]:
        """获取辩论历史"""
        pass
    
    @abstractmethod
    async def save_debate_result(
        self,
        debate_id: str,
        summary: Dict[str, Any],
        participants: List[str]
    ):
        """保存辩论结果"""
        pass
    
    @abstractmethod
    async def get_debate_result(
        self,
        debate_id: str
    ) -> Optional[Dict[str, Any]]:
        """获取辩论结果"""
        pass
    
    @abstractmethod
    async def list_debates(
        self,
        limit: int = 10
    ) -> List[Dict[str, Any]]:
        """列出辩论"""
        pass
    
    @abstractmethod
    async def add_market_data(
        self,
        symbol: str,
        data: Dict[str, Any]
    ):
        """添加市场数据"""
        pass
    
    @abstractmethod
    async def get_market_data(
        self,
        symbol: str,
        start_date: datetime,
        end_date: datetime
    ) -> List[Dict[str, Any]]:
        """获取市场数据"""
        pass
    
    @abstractmethod
    async def store_analysis(
        self,
        analysis_id: str,
        analysis_type: str,
        content: Dict[str, Any]
    ):
        """存储分析结果"""
        pass
    
    @abstractmethod
    async def get_analysis(
        self,
        analysis_id: str
    ) -> Optional[Dict[str, Any]]:
        """获取分析结果"""
        pass