Get language from STT plugin

I made custom STT plugin

            return stt.SpeechEvent(

                type=stt.SpeechEventType.FINAL_TRANSCRIPT,

                alternatives=[

                    stt.SpeechData(text=result.get("result"), language=result.get("lang")),

                ],

            )

and returning like this, WITH LANGUAGE FIELD

But in Agent method, on_user_turn_completed, i couldn’t find how to get the language property, this API so spaguetti, Why i can get the message_text, BUT can’t get the same way easy the language, that i set

    async def on_user_turn_completed(self, chat_ctx: llm.ChatContext, new_message: llm.ChatMessage) -> None:

        user_transcript = new_message.text_content

        lang = new_message.lang...

Can you tell me a little more about your use case? Why can’t you persist it, either by enriching the message content before it’s added to the context or by storing it in session state during stt_node?

Yes i can do by stt_node, and etc (if you mentioned about it in docs, can your share with me please)?

Usecase stupidly simple, i cannot say details, but it looks like echo translator from livekit examples (if you remember), it gets text from on_user_turn_completed, and response back with translation, but i wanted to detec the language while user talking to this type of agent, and overrided stt class, where i stored text AND language, SO, why i cannot use it directly, not making some preprocessing/postprocessing steps? Why should i make some strange implementations via context saving manipulation and making stt_node. Why i cannot just take from the new_message THE SAME WAY AS THE TEXT