Class ChatModelErrorContext
java.lang.Object
dev.langchain4j.model.chat.listener.ChatModelErrorContext
The error context. It contains the error, corresponding
ChatModelRequest,
partial ChatModelResponse (if available) and attributes.
The attributes can be used to pass data between methods of a ChatModelListener
or between multiple ChatModelListeners.-
Constructor Summary
ConstructorsConstructorDescriptionChatModelErrorContext(Throwable error, ChatModelRequest request, ChatModelResponse partialResponse, Map<Object, Object> attributes) -
Method Summary
-
Constructor Details
-
ChatModelErrorContext
public ChatModelErrorContext(Throwable error, ChatModelRequest request, ChatModelResponse partialResponse, Map<Object, Object> attributes)
-
-
Method Details
-
error
- Returns:
- The error that occurred.
-
request
- Returns:
- The request to the
ChatLanguageModelthe error corresponds to.
-
partialResponse
- Returns:
- The partial response from the
ChatLanguageModel, if available. When used withStreamingChatLanguageModel, it might contain the tokens that were received before the error occurred.
-
attributes
- Returns:
- The attributes map. It can be used to pass data between methods of a
ChatModelListeneror between multipleChatModelListeners.
-