-
Notifications
You must be signed in to change notification settings - Fork 46
Origin/audio for waiting #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
naveenJuspay
wants to merge
7
commits into
juspay:release
Choose a base branch
from
naveenJuspay:origin/audio_for_waiting
base: release
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cf9afad
initial - audio for waiting
naveenJuspay 702ece2
refactored code
naveenJuspay bcc5a10
minor change for ptt to fix audio processing bug
naveenJuspay 3a1de70
removed unwanted logs
naveenJuspay 2c7ed25
removed commented code
naveenJuspay e55280a
removed unused code
naveenJuspay bd96a7e
minor change
naveenJuspay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,9 +2,13 @@ | |||||
| import asyncio | ||||||
| import os | ||||||
| import random | ||||||
| import argparse | ||||||
| from dotenv import load_dotenv | ||||||
| import wave | ||||||
| from datetime import datetime | ||||||
| from zoneinfo import ZoneInfo | ||||||
| from pydub import AudioSegment | ||||||
| import audioop | ||||||
|
|
||||||
| from dotenv import load_dotenv | ||||||
| from langfuse import get_client | ||||||
|
|
@@ -20,7 +24,12 @@ | |||||
| LLMFullResponseEndFrame, | ||||||
| OutputAudioRawFrame, | ||||||
| TTSSpeakFrame, | ||||||
| OutputAudioRawFrame, | ||||||
| LLMFullResponseStartFrame, | ||||||
| FunctionCallInProgressFrame, | ||||||
| FunctionCallResultFrame | ||||||
| ) | ||||||
|
|
||||||
| from pipecat.pipeline.pipeline import Pipeline | ||||||
| from pipecat.pipeline.runner import PipelineRunner | ||||||
| from pipecat.pipeline.task import PipelineParams, PipelineTask | ||||||
|
|
@@ -54,10 +63,23 @@ | |||||
|
|
||||||
| from .processors import LLMSpyProcessor | ||||||
| from .processors.ptt_vad_filter import PTTVADFilter | ||||||
| from .processors.user_speaking_audio import UserSpeakingAudioProcessor | ||||||
| from .prompts import get_system_prompt | ||||||
| from .stt import get_stt_service | ||||||
| from .tools import initialize_tools | ||||||
| from .tts import get_tts_service | ||||||
| from .stt import get_stt_service | ||||||
| from .audio.audio_manager import initialize_audio_manager, get_audio_manager | ||||||
| from app.agents.voice.automatic.processors.llm_spy import handle_confirmation_response | ||||||
| from app.agents.voice.automatic.types import ( | ||||||
| TTSProvider, | ||||||
| Mode, | ||||||
| decode_tts_provider, | ||||||
| decode_voice_name, | ||||||
| decode_mode, | ||||||
| ) | ||||||
| from opentelemetry import trace | ||||||
| from langfuse import get_client | ||||||
| from .types import ( | ||||||
| Mode, | ||||||
| TTSProvider, | ||||||
|
|
@@ -212,6 +234,9 @@ async def main(): | |||||
| enable_chart_text_filter=config.ENABLE_CHARTS, | ||||||
| ) | ||||||
|
|
||||||
| # Initialize audio manager for looping waiting audio | ||||||
| audio_manager = initialize_audio_manager(tts) | ||||||
|
|
||||||
| llm = LLMServiceWrapper( | ||||||
| AzureLLMService( | ||||||
| api_key=config.AZURE_OPENAI_API_KEY, | ||||||
|
|
@@ -273,39 +298,61 @@ async def main(): | |||||
|
|
||||||
| rtvi = RTVIProcessor(config=RTVIConfig(config=[])) | ||||||
|
|
||||||
| # Simplified event handler for TTS feedback | ||||||
| # LLM response started handler - DO NOT start audio here | ||||||
| # Audio should only start when user stops speaking, not when LLM processes | ||||||
| @llm.event_handler("on_llm_response_started") | ||||||
| async def on_llm_response_started(service,function_calls): | ||||||
|
||||||
| async def on_llm_response_started(service,function_calls): | |
| async def on_llm_response_started(service, function_calls): |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate import of
load_dotenv- it's imported again on line 13 and was already imported earlier. Remove the duplicate import.