Class DefaultChatModelObservationConvention
java.lang.Object
org.springframework.ai.chat.observation.DefaultChatModelObservationConvention
- All Implemented Interfaces:
io.micrometer.observation.KeyValuesConvention
,io.micrometer.observation.ObservationConvention<ChatModelObservationContext>
,ChatModelObservationConvention
public class DefaultChatModelObservationConvention
extends Object
implements ChatModelObservationConvention
Default conventions to populate observations for chat model operations.
- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Field Summary
Fields inherited from interface io.micrometer.observation.ObservationConvention
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected io.micrometer.common.KeyValue
protected io.micrometer.common.KeyValue
aiProvider
(ChatModelObservationContext context) io.micrometer.common.KeyValues
io.micrometer.common.KeyValues
getName()
protected io.micrometer.common.KeyValues
requestFrequencyPenalty
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
requestMaxTokens
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValue
requestModel
(ChatModelObservationContext context) protected io.micrometer.common.KeyValues
requestPresencePenalty
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
requestStopSequences
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
requestTemperature
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
requestTopK
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
requestTopP
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
responseFinishReasons
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
responseId
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValue
responseModel
(ChatModelObservationContext context) protected io.micrometer.common.KeyValues
usageInputTokens
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
usageOutputTokens
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) protected io.micrometer.common.KeyValues
usageTotalTokens
(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.chat.observation.ChatModelObservationConvention
supportsContext
-
Field Details
-
DEFAULT_NAME
- See Also:
-
-
Constructor Details
-
DefaultChatModelObservationConvention
public DefaultChatModelObservationConvention()
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceio.micrometer.observation.ObservationConvention<ChatModelObservationContext>
-
getContextualName
- Specified by:
getContextualName
in interfaceio.micrometer.observation.ObservationConvention<ChatModelObservationContext>
-
getLowCardinalityKeyValues
public io.micrometer.common.KeyValues getLowCardinalityKeyValues(ChatModelObservationContext context) - Specified by:
getLowCardinalityKeyValues
in interfaceio.micrometer.observation.ObservationConvention<ChatModelObservationContext>
-
aiOperationType
-
aiProvider
-
requestModel
-
responseModel
-
getHighCardinalityKeyValues
public io.micrometer.common.KeyValues getHighCardinalityKeyValues(ChatModelObservationContext context) - Specified by:
getHighCardinalityKeyValues
in interfaceio.micrometer.observation.ObservationConvention<ChatModelObservationContext>
-
requestFrequencyPenalty
protected io.micrometer.common.KeyValues requestFrequencyPenalty(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
requestMaxTokens
protected io.micrometer.common.KeyValues requestMaxTokens(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
requestPresencePenalty
protected io.micrometer.common.KeyValues requestPresencePenalty(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
requestStopSequences
protected io.micrometer.common.KeyValues requestStopSequences(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
requestTemperature
protected io.micrometer.common.KeyValues requestTemperature(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
requestTopK
protected io.micrometer.common.KeyValues requestTopK(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
requestTopP
protected io.micrometer.common.KeyValues requestTopP(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
responseFinishReasons
protected io.micrometer.common.KeyValues responseFinishReasons(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
responseId
protected io.micrometer.common.KeyValues responseId(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
usageInputTokens
protected io.micrometer.common.KeyValues usageInputTokens(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
usageOutputTokens
protected io.micrometer.common.KeyValues usageOutputTokens(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context) -
usageTotalTokens
protected io.micrometer.common.KeyValues usageTotalTokens(io.micrometer.common.KeyValues keyValues, ChatModelObservationContext context)
-