# Class EmbeddingRequest

java.lang.Object
com.codename1.ai.EmbeddingRequest

public final class EmbeddingRequest extends Object
Request payload for `LlmClient.embed(EmbeddingRequest)`. Carries one or more input strings plus optional `dimensions` (OpenAI's `dimensions`, Gemini's `outputDimensionality`). A `null` value means "use the model's default dimensionality".

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `EmbeddingRequest.Builder`
  Mutable builder for an immutable `EmbeddingRequest`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static EmbeddingRequest.Builder`
  `builder()`
  `Integer`
  `getDimensions()`
  `List<String>`
  `getInputs()`
  `String`
  `getModel()`
  `static EmbeddingRequest`
  `of(String model, String text)`
  Creates a single-input request.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### builder

    public static EmbeddingRequest.Builder builder()
    Returns:
      a new empty embedding request builder

  - ### of

    public static EmbeddingRequest of(String model, String text)
    Creates a single-input request.
    Parameters:
      `model` - provider model id, or `null` for the client default
      `text` - text to embed
    Returns:
      immutable embedding request

  - ### getModel

    public String getModel()
    Returns:
      requested model id, or `null` for the client default

  - ### getInputs

    public List<String> getInputs()
    Returns:
      immutable input strings in request order

  - ### getDimensions

    public Integer getDimensions()
    Returns:
      requested output dimensions, or `null` for model default