feat: add session updates and message dialogs
This commit is contained in:
@@ -74,6 +74,7 @@ from services.pipecat.processors import (
|
||||
PassthroughLLMAssistantAggregator,
|
||||
RealtimeDynamicVariableProcessor,
|
||||
RealtimeUserInputProcessor,
|
||||
SessionUpdateProcessor,
|
||||
UserInput,
|
||||
UserInputProcessor,
|
||||
UserTurnRoutingProcessor,
|
||||
@@ -365,6 +366,10 @@ async def run_pipeline(
|
||||
or tool_interruption_strategy.is_muted
|
||||
)
|
||||
)
|
||||
session_update = SessionUpdateProcessor(
|
||||
brain.on_session_update,
|
||||
should_ignore_update=lambda: call_end.ending,
|
||||
)
|
||||
client_tools = ClientToolBroker()
|
||||
vision_capture = VisionCaptureProcessor()
|
||||
knowledge_retrieval = KnowledgeRetrievalProcessor(
|
||||
@@ -578,6 +583,7 @@ async def run_pipeline(
|
||||
[
|
||||
transport.input(),
|
||||
client_tools,
|
||||
session_update,
|
||||
vision_capture,
|
||||
user_input,
|
||||
stt_processor,
|
||||
@@ -778,6 +784,16 @@ async def run_realtime_pipeline(
|
||||
input_sample_rate, output_sample_rate = realtime_audio_sample_rates(cfg)
|
||||
user_input = RealtimeUserInputProcessor()
|
||||
dynamic_variables = RealtimeDynamicVariableProcessor(brain, cfg, realtime)
|
||||
|
||||
async def refresh_realtime_instructions() -> None:
|
||||
update = getattr(realtime, "update_instructions", None)
|
||||
if callable(update):
|
||||
await update(brain.system_prompt(cfg))
|
||||
|
||||
session_update = SessionUpdateProcessor(
|
||||
brain.on_session_update,
|
||||
after_update=refresh_realtime_instructions,
|
||||
)
|
||||
greeting = await brain.greeting(cfg)
|
||||
|
||||
recorder = await ConversationRecorder.start(
|
||||
@@ -790,6 +806,7 @@ async def run_realtime_pipeline(
|
||||
pipeline = Pipeline(
|
||||
[
|
||||
transport.input(),
|
||||
session_update,
|
||||
user_input,
|
||||
realtime,
|
||||
dynamic_variables,
|
||||
|
||||
Reference in New Issue
Block a user