feat: persist photos and enrich conversation history
This commit is contained in:
@@ -36,6 +36,7 @@ from services.vision import (
|
||||
config_with_main_llm_as_vision,
|
||||
config_with_vision_resource,
|
||||
image_data_uri,
|
||||
image_jpeg_bytes,
|
||||
)
|
||||
from services.workflow_engine import WorkflowEngine
|
||||
|
||||
@@ -58,6 +59,7 @@ from pipecat.processors.aggregators.llm_response_universal import (
|
||||
)
|
||||
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
||||
from pipecat.services.llm_service import FunctionCallParams
|
||||
from pipecat.utils.time import time_now_iso8601
|
||||
from services.pipecat.turn_config import (
|
||||
ConfigurableLLMUserAggregator,
|
||||
create_user_turn_strategies,
|
||||
@@ -763,6 +765,14 @@ async def run_pipeline(
|
||||
except asyncio.TimeoutError as exc:
|
||||
raise ValueError("等待摄像头视频帧超时") from exc
|
||||
|
||||
if recorder:
|
||||
image_bytes = await asyncio.to_thread(image_jpeg_bytes, image_frame)
|
||||
recorder.record_image_later(
|
||||
image_bytes,
|
||||
input_id=value.input_id,
|
||||
timestamp=time_now_iso8601(),
|
||||
)
|
||||
|
||||
if native_vision:
|
||||
input_frame = await asyncio.to_thread(
|
||||
_multimodal_user_input_frame,
|
||||
|
||||
Reference in New Issue
Block a user