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 ChatModelListener
s.-
Constructor Summary
ConstructorDescriptionChatModelErrorContext
(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
ChatLanguageModel
the 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
ChatModelListener
or between multipleChatModelListener
s.
-