# -*- coding: utf-8 -*- """PineAgents 算力目录:用户端算力中心「自动对接的供应商」模型清单与价目。 供应商自动对接 PineAgents —— 用户无需配置上游,直接看到本平台经 server-core /v1 中继 可调用的模型与价格。模型列表与 relay.py 的 _ENGINE_MODEL_IDS 保持一致;价格为 元/百万token。 """ from __future__ import annotations # 模型目录(id = OpenAI 兼容模型名,供 /v1/chat/completions 使用) MODELS: list[dict] = [ {"id": "deepseek-chat", "name": "DeepSeek Chat", "company": "深度求索", "tags": ["对话", "通用"]}, {"id": "deepseek-reasoner", "name": "DeepSeek Reasoner", "company": "深度求索", "tags": ["推理", "深度思考"]}, {"id": "deepseek-v4-flash", "name": "DeepSeek V4 Flash", "company": "深度求索", "tags": ["快速", "低延迟"]}, {"id": "deepseek-v4-pro", "name": "DeepSeek V4 Pro", "company": "深度求索", "tags": ["旗舰", "高性能"]}, ] # 价目:元 / 百万token(输入 / 输出) PRICES: dict[str, dict] = { "deepseek-chat": {"input": 0.5, "output": 1.5, "unit": "/百万tokens"}, "deepseek-reasoner": {"input": 1.0, "output": 2.5, "unit": "/百万tokens"}, "deepseek-v4-flash": {"input": 0.3, "output": 1.0, "unit": "/百万tokens"}, "deepseek-v4-pro": {"input": 2.0, "output": 6.0, "unit": "/百万tokens"}, } def models() -> list[dict]: """可用模型清单(加入价格为可选)。""" out = [] for m in MODELS: price = PRICES.get(m["id"], {}) out.append({**m, "price": price}) return out def prices() -> list[dict]: return [{"id": m["id"], "name": m["name"], **PRICES.get(m["id"], {})} for m in MODELS]