在 Windows 上启动项目后,发送普通消息,界面报错: ```text Model API error (TypeError): unsupported operand type(s) for *: 'decimal.Decimal' and 'float' ``` 环境是 Python 3.14.0,本地提交 fd9bf63,连接的是 DeepSeek。 排查发现,不连接模型也能复现。在仓库根目录,使用安装了本项目的 Python 执行: ```bash python -c "from minicode.cost_tracker import calculate_cost; print(calculate_cost('deepseek-flash', input_tokens=100, output_tokens=20))" ``` 同样会报 TypeError,位置在 `minicode/cost_tracker.py` 的 `calculate_cost()`: ```python (input_tokens / _DECIMAL_1M) * pricing["input"] ``` 这里 `_DECIMAL_1M` 是 `Decimal("1000000")`,但价格表中的值是 float,两者相乘会报错。其余三项也用了同样的写法。 预期是正常返回费用估算值,而不是让这一轮对话中断。是否可以统一这里的数值类型? #### 以下是报错的截图: <img width="2560" height="1600" alt="download" src="https://github.com/user-attachments/assets/0e7739e8-564a-4c5c-98e9-1ca0ce3cd9c5" />
Activity