@@ -893,61 +893,55 @@ async def disable_tts() -> str:
893893 return await _disable_tts_internal ()
894894
895895@conditional_tool (masked_for_claude = True )
896- async def speak_text (text : str , clean_text_flag : bool = True ) -> str :
896+ async def speak_text (text : str , clean_text_flag : bool = True ) -> None :
897897 """
898898 Convert text to speech using the talkito TTS engine
899899
900900 Args:
901901 text: Text to speak
902902 clean_text_flag: Whether to clean ANSI codes and symbols from text
903-
904- Returns:
905- Status message about the speech request
906903 """
907904 try :
908905 global _last_spoken_text , _last_spoken_time
909-
906+
910907 _ensure_initialization ()
911908 log_message ("INFO" , f"speak_text called with text length: { len (text )} , clean_text_flag: { clean_text_flag } " )
912-
909+
913910 # Clean text if requested
914911 processed_text = text
915912 if clean_text_flag :
916913 from .core import clean_text , strip_profile_symbols
917914 processed_text = clean_text (text )
918915 processed_text = strip_profile_symbols (processed_text )
919-
916+
920917 # Skip empty or unwanted text
921918 from .core import should_skip_line
922919 if not processed_text .strip () or should_skip_line (processed_text ):
923- result = f"Skipped speaking: '{ text [:50 ]} ...' (filtered out)"
924- log_message ("INFO" , f"speak_text returning: { result } " )
925- return result
926-
920+ log_message ("INFO" , f"Skipped speaking: '{ text [:50 ]} ...' (filtered out)" )
921+ return None
922+
927923 # Check for duplicate text
928924 if _last_spoken_text == processed_text :
929925 # Check time difference to allow re-speaking after some time (e.g., 5 seconds)
930926 current_time = time .time ()
931927 if _last_spoken_time and (current_time - _last_spoken_time ) < 5.0 :
932- result = f"Skipped duplicate text: '{ processed_text [:50 ]} ...' (spoken { current_time - _last_spoken_time :.1f} s ago)"
933- log_message ("INFO" , f"speak_text duplicate detected and skipped: { result } " )
934- return result
935-
928+ log_message ("INFO" , f"Skipped duplicate text: '{ processed_text [:50 ]} ...' (spoken { current_time - _last_spoken_time :.1f} s ago)" )
929+ return None
930+
936931 # Update last spoken text and time
937932 _last_spoken_text = processed_text
938933 _last_spoken_time = time .time ()
939-
934+
940935 # Queue for speech
941936 tts .queue_for_speech (processed_text , None )
942-
943- result = f"Queued for speech: '{ processed_text [:50 ]} ...'"
944- log_message ("INFO" , f"speak_text returning: { result } " )
945- return result
946-
937+
938+ log_message ("INFO" , "speak_text completed" )
939+ return None
940+
947941 except Exception as e :
948942 error_msg = f"Error speaking text: { str (e )} "
949943 log_message ("ERROR" , f"speak_text error: { error_msg } " )
950- return error_msg
944+ return None
951945
952946@app .tool ()
953947async def skip_current_speech () -> str :
0 commit comments