Package org.netxms.client.ai
Class AiContextUsage
java.lang.Object
org.netxms.client.ai.AiContextUsage
LLM context window usage by AI assistant chat
-
Method Summary
Modifier and TypeMethodDescriptionstatic AiContextUsageCreate context usage object from NXCP message.longGet number of tokens occupied in context window by last LLM call.intGet context window usage in percents.intGet context window size of the model that served last LLM call.booleanCheck if context window size is known.toString()
-
Method Details
-
createFromMessage
Create context usage object from NXCP message.- Parameters:
msg- NXCP message- Returns:
- context usage object or null if message does not contain context usage information
-
getTokens
public long getTokens()Get number of tokens occupied in context window by last LLM call.- Returns:
- number of tokens
-
getWindow
public int getWindow()Get context window size of the model that served last LLM call.- Returns:
- context window size in tokens or 0 if unknown
-
isWindowKnown
public boolean isWindowKnown()Check if context window size is known.- Returns:
- true if context window size is known
-
getUsagePercentage
public int getUsagePercentage()Get context window usage in percents.- Returns:
- context window usage in percents or -1 if context window size is unknown
-
toString
-