Class SpanChatModelListener
java.lang.Object
io.quarkiverse.langchain4j.runtime.listeners.SpanChatModelListener
- All Implemented Interfaces:
dev.langchain4j.model.chat.listener.ChatModelListener
public class SpanChatModelListener
extends Object
implements dev.langchain4j.model.chat.listener.ChatModelListener
Creates a span that follows the
Semantic Conventions
for GenAI operations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonError(dev.langchain4j.model.chat.listener.ChatModelErrorContext errorContext) voidonRequest(dev.langchain4j.model.chat.listener.ChatModelRequestContext requestContext) voidonResponse(dev.langchain4j.model.chat.listener.ChatModelResponseContext responseContext)
-
Constructor Details
-
SpanChatModelListener
@Inject public SpanChatModelListener(io.opentelemetry.api.trace.Tracer tracer)
-
-
Method Details
-
onRequest
public void onRequest(dev.langchain4j.model.chat.listener.ChatModelRequestContext requestContext) - Specified by:
onRequestin interfacedev.langchain4j.model.chat.listener.ChatModelListener
-
onResponse
public void onResponse(dev.langchain4j.model.chat.listener.ChatModelResponseContext responseContext) - Specified by:
onResponsein interfacedev.langchain4j.model.chat.listener.ChatModelListener
-
onError
public void onError(dev.langchain4j.model.chat.listener.ChatModelErrorContext errorContext) - Specified by:
onErrorin interfacedev.langchain4j.model.chat.listener.ChatModelListener
-