• Preprocess a GenerateRequest to download referenced http(s) media URLs and inline them as data URIs.

    Parameters

    • Optionaloptions: {
          filter?: (
              part: {
                  custom?: Record<string, unknown>;
                  data?: unknown;
                  media: { contentType?: string; url: string };
                  metadata?: Record<string, unknown>;
                  text?: undefined;
                  toolRequest?: undefined;
                  toolResponse?: undefined;
              },
          ) => boolean;
          maxBytes?: number;
      }

    Returns ModelMiddleware