Class ChatStoreUtils

java.lang.Object
ai.driftkit.clients.util.ChatStoreUtils

public class ChatStoreUtils extends Object
Utility methods for ChatStore operations and conversions to model API format.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage>
    getModelMessages(ai.driftkit.common.service.ChatStore chatStore, String chatId)
    Get messages from ChatStore and convert to model format.
    static List<ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage>
    getModelMessages(ai.driftkit.common.service.ChatStore chatStore, String chatId, int maxTokens)
    Get messages within token limit and convert to model format.
    static ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage
    toModelMessage(ai.driftkit.common.domain.chat.ChatMessage message)
    Convert a single ChatMessage to ModelContentMessage.
    static List<ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage>
    toModelMessages(List<ai.driftkit.common.domain.chat.ChatMessage> messages)
    Convert ChatMessages to ModelContentMessages for LLM API calls.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ChatStoreUtils

      public ChatStoreUtils()
  • Method Details

    • toModelMessages

      public static List<ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage> toModelMessages(List<ai.driftkit.common.domain.chat.ChatMessage> messages)
      Convert ChatMessages to ModelContentMessages for LLM API calls.
    • toModelMessage

      public static ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage toModelMessage(ai.driftkit.common.domain.chat.ChatMessage message)
      Convert a single ChatMessage to ModelContentMessage.
    • getModelMessages

      public static List<ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage> getModelMessages(ai.driftkit.common.service.ChatStore chatStore, String chatId)
      Get messages from ChatStore and convert to model format.
    • getModelMessages

      public static List<ai.driftkit.common.domain.client.ModelImageResponse.ModelContentMessage> getModelMessages(ai.driftkit.common.service.ChatStore chatStore, String chatId, int maxTokens)
      Get messages within token limit and convert to model format.