Class EmbeddingModelErrorContext
java.lang.Object
dev.langchain4j.model.embedding.listener.EmbeddingModelErrorContext
The context passed to
EmbeddingModelListener.onError(EmbeddingModelErrorContext) when an embedding
call fails. It gives access to the Throwable that was thrown, the EmbeddingRequest that was
being embedded, the EmbeddingModel, the ModelProvider, and the attributes map shared
with the request callback of the same listener.- Since:
- 1.11.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EmbeddingModelErrorContext
-
-
Method Details
-
error
- Returns:
- The error that occurred.
-
embeddingRequest
- Returns:
- the
EmbeddingRequestthat was being embedded, including its per-call parameters and multimodal inputs. For a convenience call (EmbeddingModel.embed(String)/EmbeddingModel.embedAll(List)) it is reconstructed from the inputs, and isnullonly when there are no inputs.
-
embeddingModel
-
modelProvider
- Returns:
- the
ModelProviderof the embedding model (for exampleModelProvider.OPEN_AI).
-
attributes
- Returns:
- The attributes map. It can be used to pass data between methods of an
EmbeddingModelListeneror between multipleEmbeddingModelListeners.
-
textSegments
- Returns:
- the text of each input that was being embedded. For the full request, including per-call
parameters and multimodal inputs, use
embeddingRequest().
-
builder
-