Creative Analyzer - v0.0.1
    Preparing search index...

    Function analyzeWithGemini

    • Upload a Drive file to the Gemini Files API, wait for processing if needed (video), call generateContent, validate the response via Zod, and return the typed AnalyzeResponse.

      The apiKey is a parameter rather than read from env so this module remains unit-testable without mocking the runtime binding.

      Parameters

      • file: DriveFile

        Bytes + MIME from "./drive".downloadFromDrive.

      • apiKey: string

        Gemini API key (from env.GEMINI_API_KEY).

      Returns Promise<
          {
              person: | {
                  gender: string
                  | null;
                  age_range: string | null;
                  ethnicity: string | null;
                  hair_color: string | null;
                  body_type: string | null;
                  expression: string | null;
                  setting: string | null;
              }
              | null;
              transcript: string
              | null;
          },
      >

      The validated { person, transcript } response.

      On config error (500), upstream failure (502/429), polling timeout (504), or unexpected exception (500).