mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
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.
|
||
|---|---|---|
| .. | ||
| api | ||
| events | ||
| handle | ||
| mcp | ||
| providers | ||
| utils | ||
| auth.py | ||
| connection.py | ||
| http_server.py | ||
| websocket_server.py | ||