GenAI.Media.Request (GenAI Core v0.3.1)

Copy Markdown

A media-generation request (ADR-016). The consumer facade GenAI.generate_media/2 takes one of these, the Router picks a provider, and the provider's generate_media/2 fulfils it.

  • prompt - the generation prompt: a string, or content parts (incl. an image part
             for image+text -> image edits).
  • output - the target modality (GenAI.InferenceProviderBehaviour.modality):
             `:image | :speech | :music | :sfx | :video | :document` (`:text` rides
             the normal chat/Thread path, not this).
  • provider - optional explicit provider (module or config-key atom); nil => the
             Router picks by declared capability.
  • model - optional model override (e.g. "gpt-image-1").
  • settings - provider-interpreted knobs (size, quality, voice, duration, ...).
  • api_key - optional per-request key; providers otherwise read their config/env.

Summary

Types

modality()

t()

@type t() :: %GenAI.Media.Request{
  api_key: String.t() | nil,
  model: String.t() | nil,
  output: modality(),
  prompt: term(),
  provider: module() | atom() | nil,
  settings: map()
}