mirror of
https://github.com/7836246/cursor2api.git
synced 2026-06-05 21:39:38 +08:00
- 新增 proxy-agent.ts: 基于 undici.ProxyAgent 让 Node.js fetch 走代理 - cursor-client.ts / vision.ts: 接入代理 dispatcher - config.yaml: 补充代理配置说明 (含认证格式) - 新增 16 个单元测试覆盖代理模块逻辑 - 版本升级至 v2.5.4
35 lines
1.4 KiB
YAML
35 lines
1.4 KiB
YAML
# Cursor2API v2 配置文件
|
||
|
||
# 服务端口
|
||
port: 3010
|
||
|
||
# 请求超时(秒)
|
||
timeout: 120
|
||
|
||
# 代理设置(可选)
|
||
# ⚠️ Node.js fetch 不读取 HTTP_PROXY / HTTPS_PROXY 环境变量,
|
||
# 必须在此处或通过 PROXY 环境变量显式配置代理。
|
||
# 支持 http 代理,含认证格式: http://用户名:密码@代理地址:端口
|
||
# proxy: "http://127.0.0.1:7890"
|
||
|
||
# Cursor 使用的模型
|
||
cursor_model: "anthropic/claude-sonnet-4.6"
|
||
|
||
# 浏览器指纹配置
|
||
fingerprint:
|
||
user_agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36"
|
||
|
||
# 视觉处理降级配置(可选)
|
||
# 如果开启,可以拦截您发给大模型的图片进行降级处理(因为目前免费 Cursor 不支持视觉)。
|
||
vision:
|
||
enabled: true
|
||
# mode 选项: 'ocr' 或 'api'
|
||
# 'ocr': [默认模式] 彻底免 Key,零配置,完全依赖本机的 CPU 识图,提取文本、报错日志、代码段后发给大模型。
|
||
# 'api': 需要配置下方的 baseUrl 和 apiKey,把图发给外部视觉模型(如 Gemini、OpenRouter),能“看到”画面内容和色彩。
|
||
mode: 'ocr'
|
||
|
||
# ---------- 以下选项仅在 mode: 'api' 时才生效 ----------
|
||
# base_url: "https://openrouter.ai/api/v1/chat/completions"
|
||
# api_key: "sk-or-v1-..."
|
||
# model: "meta-llama/llama-3.2-11b-vision-instruct:free"
|