Class OmniModel

java.lang.Object
com.google.genkit.plugins.googlegenai.OmniModel
All Implemented Interfaces:
Model, Action<ModelRequest,ModelResponse,ModelResponseChunk>, Registerable

public class OmniModel extends Object implements Model
Gemini Omni video generation and editing model using the Gemini Interactions API.

Gemini Omni (gemini-omni-flash-preview) natively processes text, image, audio, and video and produces video (with audio). It is served by the Interactions API (POST /v1beta/interactions) rather than generateContent, and supports conversational editing: each turn can build on a previous result.

Conversational editing. The Interactions API is stateful server-side. This model bridges it to Genkit's stateless Model interface as follows:

  • On the first turn, send a prompt (and optional media). The response's custom map carries the returned interactionId.
  • To iteratively edit, pass that id back as the previousInteractionId config option on the next generate call, with the edit instruction as the prompt. The model applies the change while preserving elements you did not mention.

Supported config options (via the request config map): previousInteractionId, aspectRatio (e.g. "16:9"), duration (e.g. "10s"), delivery ("inline" (default) | "uri"), task ("text_to_video" | "image_to_video"), thinkingLevel, maxOutputTokens.

Only the Gemini Developer API (API key) is supported; Vertex AI is not.

Note: the Interactions API is in preview; request/response field shapes may evolve.