refactor: 截图理解并入图片工具 — image-tools新增「AI看图理解」tab(5预设问题+自定义提问+结果面板), 移除独立/screenshot-qa入口, 授权与试用归入image-tools
This commit is contained in:
1 parent
5797fed492
commit
6bcdfebf04
7 files changed
+97
-339
No files matched your search
@@ -1704,7 +1704,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
def _handle_vision(self):
|
||||
payload = self._read_payload()
|
||||
machine = str(payload.get("machine") or "")
|
||||
if check(machine, "screenshot-qa") != 200:
|
||||
if check(machine, "image-tools") != 200:
|
||||
self._reply(403, json.dumps({"code": 403, "message": "需要授权或免费试用已结束"}, ensure_ascii=False).encode("utf-8"), "application/json")
|
||||
return
|
||||
b64 = str(payload.get("image") or "")
|
||||
@@ -1723,7 +1723,7 @@ class Handler(BaseHTTPRequestHandler):
|
||||
{"type": "image_url", "image_url": {"url": "data:image/png;base64," + b64}},
|
||||
]},
|
||||
])
|
||||
log_usage(machine, "screenshot-qa")
|
||||
log_usage(machine, "image-tools")
|
||||
self._reply(200, json.dumps({"code": 200, "message": "ok", "data": {"reply": reply}}, ensure_ascii=False).encode("utf-8"), "application/json")
|
||||
except Exception as e: # noqa: BLE001
|
||||
self._reply(502, json.dumps({"code": 502, "message": f"AI 服务异常: {e}"}, ensure_ascii=False).encode(), "application/json")
|
||||
|
||||
Reference in new issue
Block a user