通过在 Steam 创意工坊安装官方 Mod,可以使用部分外部 API。 请自行获取 API 密钥等认证信息。
默认支持的 API (1.0.1):
- Google Cloud Vision (DOCUMENT_TEXT_DETECTION)
- Microsoft Azure AI Vision (Read API)
- *OpenAI Vision Sample (gpt4o-mini)
* 作为用户扩展的示例附带
默认支持的 API (1.0.1):
- DeepL API
- Microsoft Azure AI Translator
- *Google App Script Sample (兼容 VRHandsFrame v1)
- *LibreTranslate
* 作为用户扩展的示例附带
安装 Mod 后,设置界面侧边栏底部会显示相应项目。 将滑动条设为 ON,即可使用 Mod 代替内置功能。 如果未显示 Mods 项目,请重启 VRHandsFrame 或 Steam 客户端。

如果想使用官方 Mod 不支持的 API,有以下两种方法:
Extension Object 的新 json 文件 (推荐)user_extension.json 文件Extension Object 是用于定义用户扩展的 API URL 端点、请求/响应参数等信息的对象。
user_extension.json 是包含若干 Extension Object 示例的文件。
从 Steam 创意工坊安装 Mod 后,应用启动时会在以下目录生成所需的 user_extension.json 和 manifest.json 文件:
../SteamLibrary/steamapp/common/VRHandsFrame/Mods/VisionBaseMod/
../SteamLibrary/steamapp/common/VRHandsFrame/Mods/TranslationBaseMod/
请在此位置添加描述 Extension Object 的 json 文件。
文件名可以任意指定,但 Extension Object 中 "name" 键的值在每个 Mod 内必须唯一。
** 请勿删除原有的 user_extension.json 和 manifest.json 文件! 这些文件是必需的。 **
| name required | string 扩展名称
|
| url required | string API 请求的目标 URL |
required | Key (object) 作为 API 请求密钥的认证信息。
|
object API 请求的可选 HTTP 头 | |
required | Array of APIRequestObject (object) non-empty API 请求所需的参数
|
required | APIResponseObject (object) API 响应期望的参数 |
{- "name": "OpenAI Vision Sample (gpt-4o-mini)",
- "key": {
- "type": "bearer",
- "value": ""
}, - "headers": {
- "Content-Type": "application/json"
}, - "request": [
- {
- "type": "json",
- "params": {
- "model": "gpt-4o-mini",
- "messages": [
- {
- "role": "user",
- "content": [
- {
- "type": "text",
- "text": "What is in this image?"
}, - {
- "type": "image_url",
- "image_url": {
- "url": "data:image/png;base64,$image_data"
}
}
]
}
], - "max_tokens": 1024
}
}
], - "response": {
- "type": "json",
- "jsonKey": "choices[0].message.content"
}
}| type required | string Enum: "json" "form" "query" 参数类型
query 参数对象可与 JSON 或表单数据组合使用。 此时请作为数组元素分别定义。 |
| params required | object API 请求参数 请根据要使用的 API 的规范设置参数。 以下字符串用作占位符:
|
{- "type": "json",
- "params": {
- "image": "$image_png"
}
}| type required | string Value: "json" |
| jsonKey required | string 存放要接收的文本信息的 Json 键
|
{- "type": "json",
- "jsonKey": "choices[0].message.content"
}| description required | string Mod 名称 |
| version required | string Mod 版本 |
required | Array of ExtensionObject (object) >= 0 items 用户扩展定义 |
{- "description": "Vision User Extension",
- "version": "1.0.1",
- "extensions": [
- {
- "name": "OpenAI Vision Sample (gpt-4o-mini)",
- "key": {
- "type": "bearer",
- "value": ""
}, - "headers": {
- "Content-Type": "application/json"
}, - "request": [
- {
- "type": "json",
- "params": {
- "model": "gpt-4o-mini",
- "messages": [
- {
- "role": "user",
- "content": [
- {
- "type": "text",
- "text": "What is in this image?"
}, - {
- "type": "image_url",
- "image_url": {
- "url": "data:image/png;base64,$image_data"
}
}
]
}
], - "max_tokens": 1024
}
}
], - "response": {
- "type": "json",
- "jsonKey": "choices[0].message.content"
}
}
]
}