Dillonu's comment on "Media resolution o...

Is there a way to pass media_resolution into a generate call with a youtube url being passed in the prompt:media part?
I've tried passing it in the config object but that doesn't work.
According to this: https://www.reddit.com/r/Bard/comments/1lq28xy/comment/n1uyxet/ it works in google-genai. (cf. https://googleapis.github.io/python-genai/genai.html#genai.types.MediaResolution)

const extractionResult = await ai.generate({
          model: youtubeModel,
          prompt: [
            {
              text: `Analyze the video content from the provided YouTube URL. The video is titled "${title}" by the channel "${channelName}". Your task is to extract the following information and return it as a single, valid JSON object:
           1. summary: A concise, one-paragraph summary of the video's content.
           2. primaryTopics: An array of 3-5 primary topics discussed.
           3. transcript: A full and clean transcript of all spoken content in the video.`,
            },
            {
              media: {
                url: videoUrl,
                contentType: 'video/mp4',
              },
            },
          ],
          output: {
            schema: LlmOutputSchema,
          },
          config: {
            temperature: 0.2,
            // not supported here?
          },
        });

https://ai.google.dev/api/generate-content#MediaResolution
Reddit
Explore this conversation and more from the Bard community
Dillonu's comment on "Media resolution on Gemini 2.5 Pro?"
Was this page helpful?