Files
trade-assistant/backend/app/ai/base.py
T
TradeMate Dev 7b62c2f8b4 feat: 修复 H5 底部导航覆盖 + 更新项目进度文档
## H5 底部导航修复 (Bug #10)
- 精简 App.vue,移除重复 tabbar,仅保留全局样式
- uni-page 设置 height: calc(100% - 50px) + overflow-y: auto
- 内容区域精确停在底部导航上方,独立滚动不再叠加
- 恢复 custom-tab-bar 组件

## 项目进度文档
- PROGRESS.md 更新至 10 个 Bug 修复
- 新增 H5 底部导航修复记录
- 新增历史变更条目
2026-05-12 20:24:42 +08:00

47 lines
1.1 KiB
Python

from abc import ABC, abstractmethod
from typing import Dict, Any, Optional
class AIProvider(ABC):
@abstractmethod
async def translate(
self, text: str, source_lang: Optional[str], target_lang: str,
context: Optional[str] = None,
) -> Dict[str, Any]:
pass
@abstractmethod
async def reply(
self, inquiry: str, context: Optional[Dict[str, Any]] = None,
tone: str = "professional", preference_context: Optional[str] = None,
) -> Dict[str, Any]:
pass
@abstractmethod
async def generate_marketing(
self, product_info: Dict[str, Any], target: str,
style: str = "professional", language: str = "en",
preference_context: Optional[str] = None,
) -> Dict[str, Any]:
pass
@abstractmethod
async def extract_info(
self, text: str, schema: Dict[str, Any],
) -> Dict[str, Any]:
pass
@property
@abstractmethod
def name(self) -> str:
pass
@property
@abstractmethod
def cost_per_1k_tokens(self) -> float:
pass
@property
def supports_streaming(self) -> bool:
return False