Gemini 2.5 flash output youtube URLs are broken

I am building an app with AI studio and the goal for the app is to output some recommended YT urls that I can click out to. The output URLs are always broken. How should I fix this?

1 Like

@Vijai_Rangan ,

welcome to the community.

Are you asking the gemini to generate links if so please know that any llm might not be able to give you a valid accessible link that works , they can only generate text that looks like a youtube URL from based on their training.

you might want to enable “grounding with google” feature/tool and ask the model to search for any specific type of videos on youtube and give you the links