Refactor vision model configuration handling in voice_webrtc.py
- Update vision model authorization logic to rely solely on server-side configuration, removing client offer dependency for vision capabilities. - Enhance clarity in comments regarding the role of server configurations in enabling vision understanding.
This commit is contained in:
@@ -87,7 +87,8 @@ async def _handle_offer(websocket, payload, peers):
|
||||
await pc.renegotiate(sdp=offer.sdp, type=offer.type, restart_pc=False)
|
||||
else:
|
||||
cfg = await _resolve_config(offer) # 解析放在建连前,配置错就别建连
|
||||
vision_enabled = offer.vision_enabled or cfg.vision_enabled
|
||||
# 服务端助手配置是视觉理解的唯一授权来源;客户端 offer 只负责携带媒体轨。
|
||||
vision_enabled = cfg.vision_enabled
|
||||
if vision_enabled:
|
||||
has_native_vision = (
|
||||
not cfg.vision_model_resource_id and cfg.llm_support_image_input
|
||||
|
||||
Reference in New Issue
Block a user