Skip to content

File part metadata support for Google Generative AI #8748

@raymondhechen

Description

@raymondhechen

Description

Google generative AI allows for custom video metadata for file parts (e.g. fps, clipping, resolution):

  const ai = new GoogleGenAI({
    apiKey: process.env.GEMINI_API_KEY,
  });
  const tools = [ ];
  const model = 'gemini-2.5-pro';
  const contents = [
    {
      role: 'user',
      parts: [
        {
          fileData: {
            fileUri: 'https://www.youtube.com/watch?v=9hE5-98ZeCg',
            mimeType: 'video/*',
          },
          videoMetadata: {
            startOffset: '40s',
            endOffset: '80s',
          }
        },
        {
          text: `Please summarize the video in 3 sentences.`,
        },
      ],
    },
  ];

Is this feature implemented in vercel ai sdk/can we expect it to be? Thanks!

AI SDK Version

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelprovider/googleIssues related to the @ai-sdk/google providersupport

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions