xiaozhi-esp32-server/main/xiaozhi-server/core/api
google-labs-jules[bot] fbdedcd4c5 feat: Add integrated image recognition and feedback
This feature enables xiaozhi-server to process images you upload via the
/mcp/vision/explain HTTP endpoint and provide spoken feedback based on
the image content.

Key changes:
- Introduced an internal event system (`core/events/vision_events.py`)
  using asyncio.Queue to decouple image processing from dialogue handling.
- Modified `VisionHandler` (`core/api/vision_handler.py`) to publish the
  textual output from the VLLM to this event system, instead of
  returning it directly in the HTTP response. The HTTP response now
  serves as an acknowledgment.
- Enhanced `ConnectionHandler` (`core/connection.py`):
    - It now listens for visual context events relevant to its device_id.
    - Stores the received visual text.
    - Uses an asyncio.Event (`visual_context_ready_event`) to signal
      the arrival of visual context.
    - Integrates the visual context into the prompt sent to the main LLM
      provider, allowing the LLM to generate responses informed by the
      image content.
    - Implements a timeout mechanism to wait for visual context if a
      vision-related query is made before the context is available.
- The spoken feedback is delivered through the existing TTS pipeline,
  processing the LLM's now visually-informed response.

This provides a more integrated way for you to interact with the
system regarding visual information.
2025-06-07 13:14:47 +00:00
..
base_handler.py update:单模块部署xiaozhi-server,支持mcp调用摄像头识图 2025-06-01 02:26:19 +08:00
ota_handler.py update:单模块部署xiaozhi-server,支持mcp调用摄像头识图 2025-06-01 02:26:19 +08:00
vision_handler.py feat: Add integrated image recognition and feedback 2025-06-07 13:14:47 +00:00