-
Notifications
You must be signed in to change notification settings - Fork 9
Refactor #15
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
base: main
Are you sure you want to change the base?
Refactor #15
Conversation
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.
Bug: ASR Interface Refactor Causes Parameter Mismatch
The ASR interface was refactored from a function to an ASRService object. In agent_cli/agents/chat.py and agent_cli/agents/transcribe.py, the transcriber.transcribe() method is called with parameters like p, stop_event, quiet, live, and logger. However, the ASRService.transcribe() method, as defined in its base class, only accepts audio_data: bytes, leading to a TypeError at runtime.
agent_cli/agents/chat.py#L178-L193
agent-cli/agent_cli/agents/chat.py
Lines 178 to 193 in 3d0c3b9
| start_time = time.monotonic() | |
| transcriber = get_asr_service( | |
| provider_cfg, | |
| wyoming_asr_cfg, | |
| openai_asr_cfg, | |
| openai_llm_cfg, | |
| LOGGER, | |
| quiet=general_cfg.quiet, | |
| ) | |
| instruction = await transcriber.transcribe( | |
| p=p, | |
| stop_event=stop_event, | |
| quiet=general_cfg.quiet, | |
| live=live, | |
| logger=LOGGER, | |
| ) |
agent_cli/agents/transcribe.py#L84-L99
agent-cli/agent_cli/agents/transcribe.py
Lines 84 to 99 in 3d0c3b9
| with signal_handling_context(LOGGER, general_cfg.quiet) as stop_event: | |
| transcriber = get_asr_service( | |
| provider_cfg, | |
| wyoming_asr_cfg, | |
| openai_asr_cfg, | |
| openai_llm_cfg, | |
| LOGGER, | |
| quiet=general_cfg.quiet, | |
| ) | |
| transcript = await transcriber.transcribe( | |
| logger=LOGGER, | |
| p=p, | |
| stop_event=stop_event, | |
| quiet=general_cfg.quiet, | |
| live=live, | |
| ) |
Bug: Function Call Error: Mismatched Parameters
Interface mismatch: The synthesizer function returned by get_synthesizer() now only accepts a text parameter. However, it is still being called with additional keyword arguments such as wyoming_tts_config, openai_tts_config, openai_llm_config, logger, quiet, and live, which will cause a TypeError at runtime.
agent_cli/tts.py#L287-L297
Lines 287 to 297 in 3d0c3b9
| async with live_timer(live, "🔊 Synthesizing text", style="blue", quiet=quiet): | |
| audio_data = await synthesizer( | |
| text=text, | |
| wyoming_tts_config=wyoming_tts_config, | |
| openai_tts_config=openai_tts_config, | |
| openai_llm_config=openai_llm_config, | |
| logger=logger, | |
| quiet=quiet, | |
| live=live, | |
| ) | |
| except Exception: |
Bug: ASR Service Fails Without Audio Input Configuration
The audio_in_cfg parameter, which configured the audio input device (e.g., input_device_index via setup_devices) for the ASR service, was removed from the _handle_conversation_turn and _async_main functions. This prevents the ASR service from correctly selecting the audio input device, causing transcription failures.
agent_cli/agents/transcribe.py#L69-L79
agent-cli/agent_cli/agents/transcribe.py
Lines 69 to 79 in 3d0c3b9
| async def _async_main( | |
| *, | |
| provider_cfg: config.ProviderSelection, | |
| general_cfg: config.General, | |
| wyoming_asr_cfg: config.WyomingASR, | |
| openai_asr_cfg: config.OpenAIASR, | |
| ollama_cfg: config.Ollama, | |
| openai_llm_cfg: config.OpenAILLM, | |
| llm_enabled: bool, | |
| p: pyaudio.PyAudio, |
agent_cli/agents/chat.py#L145-L162
agent-cli/agent_cli/agents/chat.py
Lines 145 to 162 in 3d0c3b9
| async def _handle_conversation_turn( | |
| *, | |
| p: pyaudio.PyAudio, | |
| stop_event: InteractiveStopEvent, | |
| conversation_history: list[ConversationEntry], | |
| provider_cfg: config.ProviderSelection, | |
| general_cfg: config.General, | |
| history_cfg: config.History, | |
| wyoming_asr_cfg: config.WyomingASR, | |
| openai_asr_cfg: config.OpenAIASR, | |
| ollama_cfg: config.Ollama, | |
| openai_llm_cfg: config.OpenAILLM, | |
| audio_out_cfg: config.AudioOutput, | |
| wyoming_tts_cfg: config.WyomingTTS, | |
| openai_tts_cfg: config.OpenAITTS, | |
| live: Live, | |
| ) -> None: |
BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.
Was this report helpful? Give feedback by reacting with 👍 or 👎
No description provided.