Interface EmbeddingModelListener


@Experimental public interface EmbeddingModelListener
An EmbeddingModel listener that listens for requests, responses and errors.
Since:
1.11.0
  • Method Details

    • onRequest

      default void onRequest(EmbeddingModelRequestContext requestContext)
      This method is called before the request is executed against the embedding model.
      Parameters:
      requestContext - The request context. It contains the input and attributes. The attributes can be used to pass data between methods of this listener or between multiple listeners.
    • onResponse

      default void onResponse(EmbeddingModelResponseContext responseContext)
      This method is called after a successful embedding operation completes.
      Parameters:
      responseContext - The response context. It contains the response, corresponding request and attributes. The attributes can be used to pass data between methods of this listener or between multiple listeners.
    • onError

      default void onError(EmbeddingModelErrorContext errorContext)
      This method is called when an error occurs during interaction with the embedding model.
      Parameters:
      errorContext - The error context. It contains the error, corresponding request and attributes. The attributes can be used to pass data between methods of this listener or between multiple listeners.