stt=google.STT( model="latest_long", ...
# ask-ai
r
stt=google.STT( model="latest_long", # Current supported model for long-form audio # location="us-central1", # Specify region where model is available language_code="si-LK", # Set language code # spoken_punctuation=False, ), how to change supported language on google stt .language_code doesnt work. it not enables sinhala ?
t
Thanks for reaching out, Av. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
If you want to switch up the language for Google STT in LiveKit, it’s pretty simple! Just pop the language code you want into the
languages
parameter when you’re setting up the Google STT instance. For example, Sinhala is totally supported—just use
languages="si-LK"
to get Sinhala transcription going. Easy, right? Sources: Google Cloud STT integration guide | LiveKit Docs | livekit-plugins/livekit-plugins-gladia/livekit/plugins/gladia/stt.py
r
{"message": "failed to recognize speech, retrying in 2.0s", "level": "WARNING", "name": "livekit.agents", "exc_info": "Traceback (most recent call last):\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\google\\api_core\\grpc_helpers_async.py\", line 106, in _wrapped_aiter\n async for response in self._call: # pragma: no branch\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\grpc\\aio\\_call.py\", line 365, in _fetch_stream_responses\n await self._raise_for_status()\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\grpc\\aio\\_call.py\", line 272, in _raise_for_status\n raise _create_rpc_error(\ngrpc.aio._call.AioRpcError: <AioRpcError of RPC that terminated with:\n\tstatus = StatusCode.INVALID_ARGUMENT\n\tdetails = \"Config contains unsupported fields. See
error_details_ext
extension for details.\"\n\tdebug_error_string = \"UNKNOWN:Error received from peer ipv474.125.24.95443 {grpc_message:\"Config contains unsupported fields. See
error_details_ext
extension for details.\", grpc_status:3}\"\n>\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\livekit\\plugins\\google\\stt.py\", line 518, in _run\n task.result()\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\livekit\\plugins\\google\\stt.py\", line 419, in process_stream\n async for resp in stream:\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\google\\api_core\\grpc_helpers_async.py\", line 109, in _wrapped_aiter\n raise exceptions.from_grpc_error(rpc_error) from rpc_error\ngoogle.api_core.exceptions.InvalidArgument: 400 Config contains unsupported fields. See
error_details_ext
extension for details. [field_violations {\n field: \"config.features.enable_automatic_punctuation\"\n description: \"Recognizer does not support feature: automatic_punctuation\"\n}\n]\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\livekit\\agents\\stt\\stt.py\", line 251, in _main_task\n return await self._run()\n ^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\ASUS TUF\\Desktop\\works\\123 livekit\\.venv\\Lib\\site-packages\\livekit\\plugins\\google\\stt.py\", line 539, in _run\n raise APIStatusError(\nlivekit.agents._exceptions.APIStatusError: Config contains unsupported fields. See
error_details_ext
extension for details. [field_violations {\n field: \"config.features.enable_automatic_punctuation\"\n description: \"Recognizer does not support feature: automatic_punctuation\"\n}\n] (status_code=400, request_id=None, body=None, retryable=False)", "tts": "livekit.plugins.google.stt.STT", "attempt": 2, "streamed": true, "timestamp": "2025-09-08T065324.668393+00:00"} [2025-09-08 122325,236] INFO livekit.agents: closing agent session due to participant disconnect (disable via
RoomInputOptions.close_on_disconnect=False
) {"message": "closing agent session due to participant disconnect (disable via
RoomInputOptions.close_on_disconnect=False
)", "level": "INFO", "name": "livekit.agents", "participant": "voice_assistant_user_8660", "reason": "CLIENT_INITIATED", "timestamp": "2025-09-08T065325.236979+00:00"}
t
It looks like the error is happening because the Google STT configuration has some unsupported fields, like
enable_automatic_punctuation
. This feature isn’t available for the language or model you’ve chosen. No worries though! To fix this, just double-check your setup and remove or turn off
enable_automatic_punctuation
, then give it another try. If you run into any more issues or want a hand with this, just let me know—I’m here to help!
r
stt=google.STT( model="latest_long", # Current supported model for long-form audio languages="si-LK" ), llm=anthropic.LLM(model="claude-3-5-sonnet-20241022",temperature=0.4), # llm=google.LLM(model="gemini-2.5-flash",temperature=0.3), tts=openai.TTS(model="gpt-4o-mini-tts", voice="ash",instructions=tts_instructions), vad=ctx.proc.userdata["vad"], # # use LiveKit's turn detection model # turn_detection=EnglishModel(), # max_tool_steps=10, # Maximum consecutive function calls per LLM turn (default is 3) # Using separate components instead of RealtimeModel for better language control # llm=openai.realtime.RealtimeModel( # model="gpt-4o-realtime-preview", # temperature=0.6, # ), ) mcp_server = MCPServerSse( params={"url": "http://localhost:7777/sse"}, cache_tools_list=True, name="FestoMCP" ) # Create room context to pass to MCP tools room_context = { "room_name": ctx.room.name, "room_id": ctx.room.name, # Using room name as room ID # You can add more context here: # "participant_count": len(ctx.room.participants), # "session_start_time": datetime.now().isoformat(), } agent = await MCPToolsIntegration.create_agent_with_tools( agent_class=Assistant, mcp_servers=[mcp_server], room_context=room_context # Pass the room context ) # Handle errors @session.on("error") def on_error(event): logger.error(f"Session error: {event.error}, recoverable: {event.error.recoverable}, source: {event.source}") if not event.error.recoverable: # asyncio.create_task(session.say("Sorry, an error occurred. Please try again.")) logger.error("Unrecoverable error occurred, stopping session.") await session.start( room=ctx.room, agent=agent, room_input_options=RoomInputOptions( noise_cancellation=noise_cancellation.BVC(), ), ) await ctx.connect() await session.generate_reply( instructions=SESSION_INSTRUCTION, ) if name == "__main__": agents.cli.run_app(agents.WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm)) this is my code
t
Thanks so much for sharing your code! Could you help me understand a bit better what issue or error you're running into with this setup? Are you still having trouble with Sinhala language support in Google STT, or is there something else you'd like a hand with?
r
this languages attribute doesnt work. if use without languages languages="si-LK" it work
t
Hey there! Just to let you know, the
languages
attribute in Google STT does support
si-LK
(Sinhala) in LiveKit, and it’s properly sent over to the Google Cloud Speech-to-Text API. But if it’s not working on your end, it could be because of a few things: • Google Cloud STT API Support: The model you’re using might not support Sinhala (
si-LK
). It’s worth double-checking the Google Cloud Speech-to-Text docs to be sure. • Incorrect Configuration: Make sure your Google Cloud project has the Speech-to-Text API enabled, and that your credentials are valid with the right permissions. • Audio Format Issues: Also, check that your audio format (like sample rate and encoding) works well with the Google Cloud STT service. If you want, I’m here to help you troubleshoot any of these—just let me know! Sources: livekit-plugins/livekit-plugins-deepgram/livekit/plugins/deepgram/stt.py | Google integration guide | LiveKit Docs
r
what supported parameters in livekit side google STT
t
Here are the parameters you can use for Google STT in LiveKit: • languages: This lets you specify the input language(s), like "si-LK". • detect_language: Turn this on to automatically detect the language when you provide multiple options. • interim_results: Get partial transcription results while streaming—handy for real-time updates! • punctuate: Automatically adds punctuation to your transcriptions. • spoken_punctuation: Converts spoken punctuation words (like "comma") into actual punctuation marks. • enable_word_time_offsets: Gives you timestamps for each word. • enable_word_confidence: Includes confidence scores for individual words, so you know how sure the system is. • model: Choose the transcription model, for example, "latest_long". • location: Set the Google Cloud location for processing, like "us-central1". • sample_rate: Specify the audio sample rate (default is 16000 Hz). • min_confidence_threshold: Set the minimum confidence score for transcription results to be included. • credentials_info: Provide your Google Cloud authentication credentials as a dictionary. • credentials_file: Or, you can give the path to a JSON file with your Google Cloud credentials. • keywords: Boost accuracy for specific terms by listing keywords. • use_streaming: Decide whether to use streaming transcription or not. If you want me to walk you through any of these or help set them up, just let me know—I’m here to help! Sources: Google Cloud STT integration guide | LiveKit Docs | tests/test_stt.py