From 4c8c9516dcc29bdecc4b100a8ece43e159dbe796 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 11 Feb 2026 14:15:19 +0530 Subject: [PATCH 1/7] chore: update pipecat submodule --- api/services/pipecat/run_pipeline.py | 6 +++++- api/services/pipecat/service_factory.py | 21 +++++++++++++-------- pipecat | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/api/services/pipecat/run_pipeline.py b/api/services/pipecat/run_pipeline.py index 484d5112..ddffa9ca 100644 --- a/api/services/pipecat/run_pipeline.py +++ b/api/services/pipecat/run_pipeline.py @@ -62,6 +62,7 @@ from pipecat.turns.user_mute import ( MuteUntilFirstBotCompleteUserMuteStrategy, ) from pipecat.turns.user_start import ( + ExternalUserTurnStartStrategy, TranscriptionUserTurnStartStrategy, ) from pipecat.turns.user_start.vad_user_turn_start_strategy import ( @@ -580,7 +581,10 @@ async def _run_pipeline( if is_deepgram_flux: user_turn_strategies = UserTurnStrategies( - start=[VADUserTurnStartStrategy(), TranscriptionUserTurnStartStrategy()], + start=[ + VADUserTurnStartStrategy(), + ExternalUserTurnStartStrategy(enable_interruptions=True), + ], stop=[ExternalUserTurnStopStrategy()], ) elif turn_stop_strategy == "turn_analyzer": diff --git a/api/services/pipecat/service_factory.py b/api/services/pipecat/service_factory.py index 4fb3b677..a3462521 100644 --- a/api/services/pipecat/service_factory.py +++ b/api/services/pipecat/service_factory.py @@ -30,7 +30,9 @@ if TYPE_CHECKING: from api.services.pipecat.audio_config import AudioConfig -def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[str] | None = None): +def create_stt_service( + user_config, audio_config: "AudioConfig", keyterms: list[str] | None = None +): """Create and return appropriate STT service based on user configuration Args: @@ -53,7 +55,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[ keyterm=keyterms or [], ), should_interrupt=False, # Let UserAggregator take care of sending InterruptionFrame - sample_rate=audio_config.transport_in_sample_rate + sample_rate=audio_config.transport_in_sample_rate, ) # Other models than flux @@ -64,21 +66,24 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[ profanity_filter=False, endpointing=100, model=user_config.stt.model, - keyterm=keyterms or [] + keyterm=keyterms or [], ) logger.debug(f"Using DeepGram Model - {user_config.stt.model}") return DeepgramSTTService( live_options=live_options, api_key=user_config.stt.api_key, should_interrupt=False, # Let UserAggregator take care of sending InterruptionFrame - sample_rate=audio_config.transport_in_sample_rate + sample_rate=audio_config.transport_in_sample_rate, ) elif user_config.stt.provider == ServiceProviders.OPENAI.value: return OpenAISTTService( api_key=user_config.stt.api_key, model=user_config.stt.model ) elif user_config.stt.provider == ServiceProviders.CARTESIA.value: - return CartesiaSTTService(api_key=user_config.stt.api_key, sample_rate=audio_config.transport_in_sample_rate) + return CartesiaSTTService( + api_key=user_config.stt.api_key, + sample_rate=audio_config.transport_in_sample_rate, + ) elif user_config.stt.provider == ServiceProviders.DOGRAH.value: base_url = MPS_API_URL.replace("http://", "ws://").replace("https://", "wss://") language = getattr(user_config.stt, "language", None) or "multi" @@ -88,7 +93,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[ model=user_config.stt.model, language=language, keyterms=keyterms, - sample_rate=audio_config.transport_in_sample_rate + sample_rate=audio_config.transport_in_sample_rate, ) elif user_config.stt.provider == ServiceProviders.SARVAM.value: # Map Sarvam language code to pipecat Language enum @@ -112,7 +117,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[ api_key=user_config.stt.api_key, model=user_config.stt.model, params=SarvamSTTService.InputParams(language=pipecat_language), - sample_rate=audio_config.transport_in_sample_rate + sample_rate=audio_config.transport_in_sample_rate, ) elif user_config.stt.provider == ServiceProviders.SPEECHMATICS.value: from pipecat.services.speechmatics.stt import ( @@ -138,7 +143,7 @@ def create_stt_service(user_config, audio_config: "AudioConfig", keyterms: list[ operating_point=operating_point, additional_vocab=additional_vocab, ), - sample_rate=audio_config.transport_in_sample_rate + sample_rate=audio_config.transport_in_sample_rate, ) else: raise HTTPException( diff --git a/pipecat b/pipecat index d67983b3..3de34e0c 160000 --- a/pipecat +++ b/pipecat @@ -1 +1 @@ -Subproject commit d67983b3b165f945a93e5ce594f47781a96bff9b +Subproject commit 3de34e0c4bb2e5d5b564ae801ba276eeb9f3fcdb From cff9674c9efae53e6fffb910776529ef03dca04c Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 11 Feb 2026 18:18:32 +0530 Subject: [PATCH 2/7] chore: bump pipecat version --- api/logging_config.py | 2 +- api/routes/stasis_rtp.py | 2 +- api/routes/telephony.py | 2 +- api/routes/webrtc_signaling.py | 2 +- api/services/looptalk/orchestrator.py | 2 +- api/services/pipecat/pipeline_builder.py | 2 +- api/services/pipecat/run_pipeline.py | 6 +++--- api/services/pipecat/turn_context.py | 2 +- api/services/telephony/worker_event_subscriber.py | 2 +- api/tasks/run_integrations.py | 2 +- api/tasks/s3_upload.py | 2 +- api/tasks/workflow_run_cost.py | 2 +- api/tests/test_pipecat_engine_context_update.py | 2 +- api/tests/test_pipecat_engine_end_call.py | 2 +- .../test_pipecat_engine_node_switch_with_user_speech.py | 2 +- api/tests/test_pipecat_engine_tool_calls.py | 2 +- api/tests/test_pipecat_engine_variable_extraction.py | 2 +- api/tests/test_tts_endframe_with_audio_write_failure.py | 2 +- api/tests/test_user_idle_handler.py | 2 +- api/tests/test_user_muting_during_bot_speech.py | 2 +- api/tests/test_voicemail_detector.py | 2 +- pipecat | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/api/logging_config.py b/api/logging_config.py index 37f5ea3e..dc44b691 100644 --- a/api/logging_config.py +++ b/api/logging_config.py @@ -7,7 +7,7 @@ import loguru from api.constants import SERIALIZE_LOG_OUTPUT from api.enums import Environment from api.utils.worker import get_worker_id, is_worker_process -from pipecat.utils.context import run_id_var, turn_var +from pipecat.utils.run_context import run_id_var, turn_var ENVIRONMENT = os.getenv("ENVIRONMENT", Environment.LOCAL.value) ENABLE_TURN_LOGGING = os.getenv("ENABLE_TURN_LOGGING", "false").lower() == "true" diff --git a/api/routes/stasis_rtp.py b/api/routes/stasis_rtp.py index c18682ac..0fede33f 100644 --- a/api/routes/stasis_rtp.py +++ b/api/routes/stasis_rtp.py @@ -1,12 +1,12 @@ import random from loguru import logger -from pipecat.utils.context import set_current_run_id from api.db import db_client from api.enums import WorkflowRunMode from api.services.pipecat.run_pipeline import run_pipeline_ari_stasis from api.services.telephony.stasis_rtp_connection import StasisRTPConnection +from pipecat.utils.run_context import set_current_run_id async def on_stasis_call(call: StasisRTPConnection, call_context_vars: dict): diff --git a/api/routes/telephony.py b/api/routes/telephony.py index 0ed6c87f..e93dd60b 100644 --- a/api/routes/telephony.py +++ b/api/routes/telephony.py @@ -37,7 +37,7 @@ from api.utils.telephony_helper import ( numbers_match, parse_webhook_request, ) -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id router = APIRouter(prefix="/telephony") diff --git a/api/routes/webrtc_signaling.py b/api/routes/webrtc_signaling.py index f50180da..d33aa5dd 100644 --- a/api/routes/webrtc_signaling.py +++ b/api/routes/webrtc_signaling.py @@ -44,7 +44,7 @@ from api.services.pipecat.ws_sender_registry import ( ) from api.services.quota_service import check_dograh_quota from pipecat.transports.smallwebrtc.connection import SmallWebRTCConnection -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id router = APIRouter(prefix="/ws") diff --git a/api/services/looptalk/orchestrator.py b/api/services/looptalk/orchestrator.py index 917774a2..d4c969ad 100644 --- a/api/services/looptalk/orchestrator.py +++ b/api/services/looptalk/orchestrator.py @@ -14,7 +14,7 @@ from api.services.looptalk.internal_transport import ( ) from api.services.pipecat.transport_setup import create_internal_transport from pipecat.pipeline.task import PipelineTask -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id from .core.pipeline_builder import LoopTalkPipelineBuilder from .core.recording_manager import RecordingManager diff --git a/api/services/pipecat/pipeline_builder.py b/api/services/pipecat/pipeline_builder.py index 1706a2eb..00807706 100644 --- a/api/services/pipecat/pipeline_builder.py +++ b/api/services/pipecat/pipeline_builder.py @@ -10,7 +10,7 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext from pipecat.processors.audio.audio_buffer_processor import AudioBufferProcessor -from pipecat.utils.context import turn_var +from pipecat.utils.run_context import turn_var def create_pipeline_components(audio_config: AudioConfig): diff --git a/api/services/pipecat/run_pipeline.py b/api/services/pipecat/run_pipeline.py index ddffa9ca..41a18820 100644 --- a/api/services/pipecat/run_pipeline.py +++ b/api/services/pipecat/run_pipeline.py @@ -70,12 +70,12 @@ from pipecat.turns.user_start.vad_user_turn_start_strategy import ( ) from pipecat.turns.user_stop import ( ExternalUserTurnStopStrategy, - TranscriptionUserTurnStopStrategy, + SpeechTimeoutUserTurnStopStrategy, TurnAnalyzerUserTurnStopStrategy, ) from pipecat.turns.user_turn_strategies import UserTurnStrategies -from pipecat.utils.context import set_current_run_id from pipecat.utils.enums import EndTaskReason +from pipecat.utils.run_context import set_current_run_id from pipecat.utils.tracing.context_registry import ContextProviderRegistry # Setup tracing if enabled @@ -602,7 +602,7 @@ async def _run_pipeline( # Transcription-based (default): best for short 1-2 word responses user_turn_strategies = UserTurnStrategies( start=[VADUserTurnStartStrategy(), TranscriptionUserTurnStartStrategy()], - stop=[TranscriptionUserTurnStopStrategy()], + stop=[SpeechTimeoutUserTurnStopStrategy()], ) # Create user mute strategies diff --git a/api/services/pipecat/turn_context.py b/api/services/pipecat/turn_context.py index 9d3683d2..05e6e4d8 100644 --- a/api/services/pipecat/turn_context.py +++ b/api/services/pipecat/turn_context.py @@ -8,7 +8,7 @@ propagate through asyncio.create_task() calls. import asyncio from typing import Dict, Optional -from pipecat.utils.context import turn_var +from pipecat.utils.run_context import turn_var class TurnContextManager: diff --git a/api/services/telephony/worker_event_subscriber.py b/api/services/telephony/worker_event_subscriber.py index 42afb393..61263725 100644 --- a/api/services/telephony/worker_event_subscriber.py +++ b/api/services/telephony/worker_event_subscriber.py @@ -23,7 +23,7 @@ from api.services.telephony.stasis_event_protocol import ( parse_event, ) from api.services.telephony.stasis_rtp_connection import StasisRTPConnection -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id class WorkerEventSubscriber: diff --git a/api/tasks/run_integrations.py b/api/tasks/run_integrations.py index fb38e5c8..b622f386 100644 --- a/api/tasks/run_integrations.py +++ b/api/tasks/run_integrations.py @@ -10,7 +10,7 @@ from api.db import db_client from api.db.models import WorkflowRunModel from api.utils.credential_auth import build_auth_header from api.utils.template_renderer import render_template -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id async def run_integrations_post_workflow_run(_ctx, workflow_run_id: int): diff --git a/api/tasks/s3_upload.py b/api/tasks/s3_upload.py index d1c55a6d..f1b821d7 100644 --- a/api/tasks/s3_upload.py +++ b/api/tasks/s3_upload.py @@ -6,7 +6,7 @@ from loguru import logger from api.db import db_client from api.services.storage import get_current_storage_backend, storage_fs from api.tasks.run_integrations import run_integrations_post_workflow_run -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id async def upload_voicemail_audio_to_s3( diff --git a/api/tasks/workflow_run_cost.py b/api/tasks/workflow_run_cost.py index 25400fca..a0c06a1e 100644 --- a/api/tasks/workflow_run_cost.py +++ b/api/tasks/workflow_run_cost.py @@ -4,7 +4,7 @@ from api.db import db_client from api.enums import WorkflowRunMode from api.services.pricing.cost_calculator import cost_calculator from api.services.telephony.factory import get_telephony_provider -from pipecat.utils.context import set_current_run_id +from pipecat.utils.run_context import set_current_run_id async def calculate_workflow_run_cost(ctx, workflow_run_id: int): diff --git a/api/tests/test_pipecat_engine_context_update.py b/api/tests/test_pipecat_engine_context_update.py index d40be6c9..cb99cdf0 100644 --- a/api/tests/test_pipecat_engine_context_update.py +++ b/api/tests/test_pipecat_engine_context_update.py @@ -31,8 +31,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, ) from pipecat.tests import MockLLMService, MockTTSService diff --git a/api/tests/test_pipecat_engine_end_call.py b/api/tests/test_pipecat_engine_end_call.py index 46fa2486..78bb0203 100644 --- a/api/tests/test_pipecat_engine_end_call.py +++ b/api/tests/test_pipecat_engine_end_call.py @@ -46,8 +46,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, LLMUserAggregatorParams, ) diff --git a/api/tests/test_pipecat_engine_node_switch_with_user_speech.py b/api/tests/test_pipecat_engine_node_switch_with_user_speech.py index e65e036e..efad8fd5 100644 --- a/api/tests/test_pipecat_engine_node_switch_with_user_speech.py +++ b/api/tests/test_pipecat_engine_node_switch_with_user_speech.py @@ -30,8 +30,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, LLMUserAggregatorParams, ) diff --git a/api/tests/test_pipecat_engine_tool_calls.py b/api/tests/test_pipecat_engine_tool_calls.py index 7938df84..43a05c44 100644 --- a/api/tests/test_pipecat_engine_tool_calls.py +++ b/api/tests/test_pipecat_engine_tool_calls.py @@ -18,8 +18,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, ) from pipecat.tests import MockLLMService, MockTTSService diff --git a/api/tests/test_pipecat_engine_variable_extraction.py b/api/tests/test_pipecat_engine_variable_extraction.py index 31593792..8a516142 100644 --- a/api/tests/test_pipecat_engine_variable_extraction.py +++ b/api/tests/test_pipecat_engine_variable_extraction.py @@ -27,8 +27,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, ) from pipecat.tests import MockLLMService, MockTTSService diff --git a/api/tests/test_tts_endframe_with_audio_write_failure.py b/api/tests/test_tts_endframe_with_audio_write_failure.py index 73509641..fa0dba6f 100644 --- a/api/tests/test_tts_endframe_with_audio_write_failure.py +++ b/api/tests/test_tts_endframe_with_audio_write_failure.py @@ -43,8 +43,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, LLMUserAggregatorParams, ) diff --git a/api/tests/test_user_idle_handler.py b/api/tests/test_user_idle_handler.py index 3b01df09..4548ca79 100644 --- a/api/tests/test_user_idle_handler.py +++ b/api/tests/test_user_idle_handler.py @@ -29,8 +29,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, LLMUserAggregatorParams, ) diff --git a/api/tests/test_user_muting_during_bot_speech.py b/api/tests/test_user_muting_during_bot_speech.py index b127e68e..6fd6b781 100644 --- a/api/tests/test_user_muting_during_bot_speech.py +++ b/api/tests/test_user_muting_during_bot_speech.py @@ -34,8 +34,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, LLMUserAggregator, LLMUserAggregatorParams, diff --git a/api/tests/test_voicemail_detector.py b/api/tests/test_voicemail_detector.py index d0681c26..64511ee3 100644 --- a/api/tests/test_voicemail_detector.py +++ b/api/tests/test_voicemail_detector.py @@ -21,8 +21,8 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.llm_context import LLMContext -from pipecat.processors.aggregators.llm_response import LLMAssistantAggregatorParams from pipecat.processors.aggregators.llm_response_universal import ( + LLMAssistantAggregatorParams, LLMContextAggregatorPair, LLMUserAggregatorParams, ) diff --git a/pipecat b/pipecat index 3de34e0c..0df2d1d3 160000 --- a/pipecat +++ b/pipecat @@ -1 +1 @@ -Subproject commit 3de34e0c4bb2e5d5b564ae801ba276eeb9f3fcdb +Subproject commit 0df2d1d36f30e285bfd4dbe287c18c0dc9ea397e From e1565246fa6ecc5b73a663e9251a92d0796d19d3 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Thu, 12 Feb 2026 15:41:44 +0530 Subject: [PATCH 3/7] fix: fixes aggregation in elevenlabs TTS (#153) * chore: enhance media preview dialog * fix: fixes elevenlabs tts service --- .../workflow/pipecat_engine_callbacks.py | 4 + pipecat | 2 +- ui/src/app/superadmin/runs/page.tsx | 7 +- ui/src/app/usage/page.tsx | 7 +- .../[workflowId]/run/[runId]/page.tsx | 9 +- ui/src/components/MediaPreviewDialog.tsx | 138 ++++++++---------- .../workflow-runs/WorkflowRunsTable.tsx | 7 +- 7 files changed, 81 insertions(+), 93 deletions(-) diff --git a/api/services/workflow/pipecat_engine_callbacks.py b/api/services/workflow/pipecat_engine_callbacks.py index a422734b..684514f7 100644 --- a/api/services/workflow/pipecat_engine_callbacks.py +++ b/api/services/workflow/pipecat_engine_callbacks.py @@ -116,6 +116,10 @@ def create_aggregation_correction_callback(engine: "PipecatEngine"): if corrupted in ref or len(alnum_ref) < len(alnum_corr) or len(alnum_corr) < 10: return corrupted + logger.debug( + f"In correct_corrupted_aggregation: ref: {ref} corrupted: {corrupted}" + ) + # 2) Find where in `ref` we should start aligning. # We take the first N (N=10) characters of `corrupted` # and look for all their occurrences in `ref`. diff --git a/pipecat b/pipecat index 0df2d1d3..1bd0ea6b 160000 --- a/pipecat +++ b/pipecat @@ -1 +1 @@ -Subproject commit 0df2d1d36f30e285bfd4dbe287c18c0dc9ea397e +Subproject commit 1bd0ea6b44518040c87074c6086e4fedc0864ca9 diff --git a/ui/src/app/superadmin/runs/page.tsx b/ui/src/app/superadmin/runs/page.tsx index d20cb944..c58961f9 100644 --- a/ui/src/app/superadmin/runs/page.tsx +++ b/ui/src/app/superadmin/runs/page.tsx @@ -7,7 +7,7 @@ import { useCallback, useEffect, useState } from "react"; import { getWorkflowRunsApiV1SuperuserWorkflowRunsGet, setAdminCommentApiV1SuperuserWorkflowRunsRunIdCommentPost } from '@/client/sdk.gen'; import { FilterBuilder } from "@/components/filters/FilterBuilder"; -import { MediaPreviewButtons, MediaPreviewDialog } from '@/components/MediaPreviewDialog'; +import { MediaPreviewButton, MediaPreviewDialog } from '@/components/MediaPreviewDialog'; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; @@ -515,12 +515,11 @@ export default function RunsPage() {
- - {mediaDownloadKey && accessToken && ( - - )} +
+ {recordingKey && accessToken && ( + + )} + {transcriptKey && accessToken && ( + + )} +
@@ -114,53 +120,35 @@ export function MediaPreviewDialog({ accessToken }: MediaPreviewDialogProps) { }; } -interface MediaPreviewButtonsProps { +interface MediaPreviewButtonProps { recordingUrl: string | null | undefined; transcriptUrl: string | null | undefined; runId: number; - onOpenAudio: (fileKey: string | null, runId: number) => void; - onOpenTranscript: (fileKey: string | null, runId: number) => void; + onOpenPreview: (recordingUrl: string | null, transcriptUrl: string | null, runId: number) => void; onSelect?: (runId: number) => void; } -export function MediaPreviewButtons({ +export function MediaPreviewButton({ recordingUrl, transcriptUrl, runId, - onOpenAudio, - onOpenTranscript, + onOpenPreview, onSelect, -}: MediaPreviewButtonsProps) { - const handleOpenAudio = () => { - onSelect?.(runId); - onOpenAudio(recordingUrl ?? null, runId); - }; +}: MediaPreviewButtonProps) { + if (!recordingUrl && !transcriptUrl) return null; - const handleOpenTranscript = () => { + const handleOpen = () => { onSelect?.(runId); - onOpenTranscript(transcriptUrl ?? null, runId); + onOpenPreview(recordingUrl ?? null, transcriptUrl ?? null, runId); }; return ( -
- {recordingUrl && ( - - )} - {transcriptUrl && ( - - )} -
+ ); } diff --git a/ui/src/components/workflow-runs/WorkflowRunsTable.tsx b/ui/src/components/workflow-runs/WorkflowRunsTable.tsx index 7c082a10..7f5b752e 100644 --- a/ui/src/components/workflow-runs/WorkflowRunsTable.tsx +++ b/ui/src/components/workflow-runs/WorkflowRunsTable.tsx @@ -5,7 +5,7 @@ import { useState } from "react"; import { WorkflowRunResponseSchema } from "@/client/types.gen"; import { FilterBuilder } from "@/components/filters/FilterBuilder"; -import { MediaPreviewButtons, MediaPreviewDialog } from "@/components/MediaPreviewDialog"; +import { MediaPreviewButton, MediaPreviewDialog } from "@/components/MediaPreviewDialog"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; @@ -211,12 +211,11 @@ export function WorkflowRunsTable({
e.stopPropagation()}> -