Files

31 lines
1007 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""Agent 层配置(第三方 LLM API,OpenAI 兼容格式)。
DeepSeek 官方 API:https://api.deepseek.com(OpenAI 兼容)。
生产用 .env 注入 DEEPSEEK_API_KEY,不要提交 git。
"""
import os
def _env(key, default):
return os.environ.get(key, default)
class AgentSettings:
# 模型 API(OpenAI 兼容)
api_base = _env("AGENT_API_BASE", "https://api.deepseek.com")
api_key = _env("AGENT_API_KEY", _env("DEEPSEEK_API_KEY", ""))
model = _env("AGENT_MODEL", "deepseek-v4-flash-vision-exp")
# MCP Server(工具源)
mcp_url = _env("AGENT_MCP_URL", "http://127.0.0.1:8033/mcp")
# 默认目标设备(命令行不指定 serial 时用它;空则让模型先 de_list_devices)
default_serial = _env("AGENT_DEFAULT_SERIAL", "")
# Agent 循环上限与请求超时
max_steps = int(_env("AGENT_MAX_STEPS", "40"))
request_timeout = float(_env("AGENT_TIMEOUT", "120"))
# system prompt 语言
language = _env("AGENT_LANG", "zh")