# Class SpringAIEmbedding

java.lang.Object
com.google.adk.models.springai.SpringAIEmbedding

public class SpringAIEmbedding extends Object
Spring AI embedding model wrapper that provides ADK-compatible embedding generation.

This wrapper allows Spring AI embedding models to be used within the ADK framework by providing reactive embedding generation with observability and error handling.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SpringAIEmbedding(org.springframework.ai.embedding.EmbeddingModel embeddingModel)`
  `SpringAIEmbedding(org.springframework.ai.embedding.EmbeddingModel embeddingModel, String modelName)`
  `SpringAIEmbedding(org.springframework.ai.embedding.EmbeddingModel embeddingModel, String modelName, SpringAIProperties.Observability observabilityConfig)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `dimensions()`
  Get the embedding dimensions for this model.
  `io.reactivex.rxjava3.core.Single<float[]>`
  `embed(String text)`
  Generate embeddings for a single text input.
  `io.reactivex.rxjava3.core.Single<List<float[]>>`
  `embed(List<String> texts)`
  Generate embeddings for multiple text inputs.
  `io.reactivex.rxjava3.core.Single<org.springframework.ai.embedding.EmbeddingResponse>`
  `embedForResponse(org.springframework.ai.embedding.EmbeddingRequest request)`
  Generate embeddings using a full EmbeddingRequest.
  `org.springframework.ai.embedding.EmbeddingModel`
  `getEmbeddingModel()`
  Get the underlying Spring AI embedding model.
  `String`
  `modelName()`
  Get the model name.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### SpringAIEmbedding

    public SpringAIEmbedding(org.springframework.ai.embedding.EmbeddingModel embeddingModel)

  - ### SpringAIEmbedding

    public SpringAIEmbedding(org.springframework.ai.embedding.EmbeddingModel embeddingModel, String modelName)

  - ### SpringAIEmbedding

    public SpringAIEmbedding(org.springframework.ai.embedding.EmbeddingModel embeddingModel, String modelName, SpringAIProperties.Observability observabilityConfig)

- ## Method Details

  - ### embed

    public io.reactivex.rxjava3.core.Single<float[]> embed(String text)
    Generate embeddings for a single text input.
    Parameters:
      `text` - The input text to embed
    Returns:
      Single emitting the embedding vector

  - ### embed

    public io.reactivex.rxjava3.core.Single<List<float[]>> embed(List<String> texts)
    Generate embeddings for multiple text inputs.
    Parameters:
      `texts` - The input texts to embed
    Returns:
      Single emitting the list of embedding vectors

  - ### embedForResponse

    public io.reactivex.rxjava3.core.Single<org.springframework.ai.embedding.EmbeddingResponse> embedForResponse(org.springframework.ai.embedding.EmbeddingRequest request)
    Generate embeddings using a full EmbeddingRequest.
    Parameters:
      `request` - The embedding request
    Returns:
      Single emitting the embedding response

  - ### dimensions

    public int dimensions()
    Get the embedding dimensions for this model.
    Returns:
      The number of dimensions in the embedding vectors

  - ### modelName

    public String modelName()
    Get the model name.
    Returns:
      The model name

  - ### getEmbeddingModel

    public org.springframework.ai.embedding.EmbeddingModel getEmbeddingModel()
    Get the underlying Spring AI embedding model.
    Returns:
      The Spring AI EmbeddingModel instance